![]() |
Exercises and problems in Informatics |
Please read The Conditions of the Problem Solving Competition.
I. 64. The Farey sequence FN for any positive integer N is the sequence of irreducible rational numbers between 0 and 1 for which the denominator is at most N and they are arranged in increasing order. For example, F6={01,16,15,14,13,25,12,35,23,34,45,56,11}.
For any given N (1≤N ≤100), your program (i64.pas, ...) should display the Farey sequence FN.
(10 points)
I. 65. Given N+1 points (xi,yi) in the plane, a Bézier curve nicely approximating them is given by its coordinate-functions x and y in the following parametric form (with 0≤u ≤1 being a real parameter):
x(u)=n∑i=0xi(ni)ui(1−u)n−i,y(u)=n∑i=0yi(ni)ui(1−u)n−i.
Write your program (i65.pas, ...) which reads the coordinates of the N+1 points then draws them together with the corresponding Bézier curve.
Example.:
N=14 The points: (0,0),(16,40),(25,45), (36,65),(49,70),(64,80), (81,90),(100,100),(121,120), (144,120),(169,120),(196,140), (225,150),(256,160),(289,170)
(10 points)
I. 66. Euler's number triangle is similar to Pascal's triangle, but instead of the binomial coefficients, it contains the Eulerian numbers E(n,k). For 0≤n ≤15 and 0≤k ≤n, E(n,k) is defined as the number of permutations of {1,2,...,n} having exactly k permutation ascents (i.e. having k pairs of adjacent positions in the permutation that are out of order).
Prepare your sheet (i66.xls) that - on entering the value of m (0≤m≤15) into cell <<\texttt>>A1 - displays the Eulerian numbers E(n,k) (n=0,1,...,m) in the first n+1 rows of the sheet. Numbers should only appear in valid cells.
Example for m=10:
|