Homework 7, assigned :
MON APRIL 29, due TUE MAY 7
All due times are at 11:59 pm on the due date.
Write a program that produces the output shown on slide 26 of the
presentation Powerpoint for more Probability . The problem
is the birthday problem for a planet that has 20 days in a year.
The results show the probability of non-coincidence and that of
birthday coincidence for a class that varies from 1 to 21 students.
After a time (when the value of num becomes 20), the value of prod
will become zero.
- Use a for loop for j in range (1, 24)
- Have a variable prod start at 1 and another variable num
start at 20.
- Have num decrement at each cycle of the loop so that num
assumes the values 20, 19, 18, ... and finally 0. The value of 0 is obtained
when there are no more days in the year on which there can be no more
- Use the tab "\t" to position the output in the proper column.