Mathematical and Physical Journal
for High Schools
Issued by the MATFUND Foundation
Already signed up?
New to KöMaL?

Problem I. 200. (December 2008)

I. 200. With the ``combination play ticket'' in the Hungarian national lottery (5 numbers out of 90) one can play several number combinations simultaneously. One has to specify two groups of numbers: the first group (``fixed numbers'') contains at most 4 numbers, while the second group (``complementary numbers'') consists of at least 2 numbers. Then all possible combinations of 5 numbers are formed: each ticket contains all the fixed numbers and some of the complementary numbers (so that there are altogether 5 numbers on each ticket).

Example: if the fixed numbers are 23, 35 and 87, while the complementary numbers are 56, 13 and 90, then three tickets are created with 23, 35, 87, 56, 13, and 23, 35, 87, 56, 90, finally 23, 35, 87, 13, 90.

The first 3 lines of the input file of your program contain the fixed numbers, then the complementary numbers of the player, finally the winning numbers for the current week, respectively. The 5 lines of the output file should contain the number of tickets that can be generated by the given combination play ticket, then the number of tickets that contain 5, 4, 3 or 2 matches, respectively.

The source code of your program (i200.pas, i200.cpp, ...) together with a short documentation (i200.txt, i200.pdf, ...) should be submitted, also containing a brief description of your solution and the name of the developer environment to use for compiling.

(10 pont)

Deadline expired on January 15, 2009.


Sorry, the solution is available only in Hungarian. Google translation

Jelöljük a fix számok számát f-el, a kombinációs számok számát k-val. A fogadásban megjátszott számötösök számát ekkor a \binom{k}{5-f} képlettel tudjuk kiszámítani.

A nyerőszámok ismeretében adjuk meg, hogy hány t találatos (5>=t>=2) szelvényünk van. Ha az f fix számból ft darab és a k kombinációs számból kt darab egyezik meg a nyerőszámokkal, akkor t<ft találatos szelvényünk nincs, t>=ft találatos szelvényünk pedig úgy lehet, hogy t-ft<=kt találatunk van a kombinációs számok között. A t találatos szelvények száma tehát ft fix találat és t-ft kombinációs találat mellett \binom{kt}{t-ft} \cdot \binom{k-kt}{5-f-(t-ft))}.

A mellékelt (lotto.dpr) Pascal (Delphi konzol alkalmazás) program a fenti gondolatmenet alapján szolgáltatja az eredményeket.


Statistics:

15 students sent a solution.
10 points:Barta 111 János, Englert Péter, Erdős Gergely, Kővágó Zoltán, Pap 999 Dávid, Szabó 928 Attila, Tóth Szabolcs.
9 points:Fehér Péter, Nagy 111 Miklós, Póta Kristóf.
8 points:2 students.
3 points:1 student.
1 point:2 students.

Problems in Information Technology of KöMaL, December 2008