Nu aveti permisiuni pentru a descarca fisierul grader_test4.in
Diferente pentru blog/probability-shortlist intre reviziile #19 si #20
Nu exista diferente intre titluri.
Diferente intre continut:
# (Reservoir sampling) Given a stream of integers build an algorithm that returns a uniform random sample of size k using O(k) memory. # (Coupon collector’s problem) Suppose a kid wants to collect all the cartoon characters in a kinder surprise series. Given that there are n different characters in total and they are distributed uniformly random. # (Balls and bins problem) m balls are thrown into n bins. Each ball has 1/n probability of falling into each bin. What’s the expected number of empty bins?
# What’s the expectednumber of times line 4 is executed if p is a random permutation of numbers 1 to n.
# What’s the average number of times line 4 is executed if p is a random permutation of numbers 1 to n.
==code(python) | min = p[0]
