![]() | English Issue, December 2002 | |||
Previous page | Contents | Next page | ORDER FORM |
Problems in information technology
(34-36.)
I. 34. Binomial coefficients can be used to represent natural numbers in the so-called binomial base. For a fixed m (2≤m ≤50) every natural number n (0≤n≤10000) can uniquely be represented as
n=(a11)+(a22)+⋯+(amm), where 0≤a1<a2<...<am.
Your program (I34.pas, ...) should read the numbers n and m, then display the corresponding sequence a1,a2,...,am.
Example. Let n=41, then a1=1, a2=2, a3=4, a4=7, because
41=(11)+(22)+(43)+(74)=1+1+4+35.
(10 points)
I. 35. We put an ant close beside the base of a cylinder-jacket with radius R and height H. In every minute the ant creeps upwards M centimetres. The cylinder is rotated around its axis (which is just the Z-axis) anticlockwise completing T turns per minute. The ant starts from the point (R,0,0), and we are watching it at an angle of ALPHA degree relative to the Y-axis, see Figure 1.
![]() | ![]() |
Figure 1 | Figure 2 |
Write your program (I35.pas, ...) which reads the values of R (1≤R≤50), H (1≤H≤200), M (1≤M≤H), T (1≤T≤100) and ALPHA (0≤ALPHA<90), then displays the axonometric projection to the plane Y=0 of the path of the ant using continuous line on the visible side of the cylinder and dotted line on the back side.
Example. Figure 2 shows the path of the ant with R=50, H=200, M=1, T=40, ALPHA=30.
(10 points)
I. 36. According to the trinomial theorem
(x+y+z)n=∑0≤a,b,c≤na+b+c=n(a+b+ca,b,c)xaybzc.
The trinomial coefficients can be computed, for example, by the formula
(a+b+ca,b,c)=(a+b+c)!a!b!c!.
However, these factorials can be very large, thus their direct computation is not always feasible. Nevertheless, writing trinomial coefficients as a product of binomial coefficients can settle this problem.
Prepare your sheet (I36.xls) which, if n (n=a+b+c, n≤20) is entered into a given cell, displays a table of trinomial coefficients, similar to the one below.
The example shows the coefficients when n=5.
|
(10 points)