Mathematical and Physical Journal
for High Schools
Issued by the MATFUND Foundation
Already signed up?
New to KöMaL?
I want the old design back!!! :-)

Problem I. 118. (December 2005)

I. 118. We have n ceramic piggy banks and n keys, each corresponding to exactly one of the banks. We throw one key into each bank at random. Then we break open t ceramic pigs. Find the probability that we are able to open the remaining banks using the keys found in the broken ones without any further breaking. Write a program that estimates this probability by making k experiments. If n<10, then we should also compute the exact probability by examining all possible cases.

Your program should read the values of n, t and k from the keyboard, then make the experiments and display the resulting relative frequencies (that is, the ratio of successful outcomes to k), further, the exact probability.

The source code of the program should be submitted (i118.pas, i118.cpp, ...).

(10 pont)

Deadline expired on January 16, 2006.


14 students sent a solution.
10 points:Balambér Dávid, Czigler András, Gombos Gergely, Kiss Dániel Miklós, Véges Márton.
6 points:2 students.
4 points:4 students.
0 point:3 students.

Problems in Information Technology of KöMaL, December 2005