ZawHtinECE257 Quiz 4

ZawHtinECE257 Quiz 4 - ECE257 Quiz 4 Date: 3/10/08, Monday,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE257 Quiz 4 Date: 3/10/08, Monday, week 10 Due Date: 3/12/08, Wednesday, week 10 Total Points: 120 points Total Grade Points: 3 grade points 1. (50%) Birthday Probability In the textbook, exercise 5.24 states the birthday problem about the probability of two or more people have the same birthday in a group of n people. The solution is posted in the distribution folder. As I showed you in my ECE114 Final Practice Questions in 2002, reproduced here below of writing a C program to compute such probability: From the theory of probability, we know that such probability (consider ordinary year with 365 days) is equal to 1 - P (365, 20) / 365 20 . Here P (365, 20) is the number of permutations of choosing 20 from 365 or 365! / (345!), where 365! Is 365 factorial or 365 * 364 * 363 * 362 * ,. . * 3 * 2 * 1. Prove this statement is correct or invalidate this by computing such a number (using C programming) (hint: compute (365.0 / 365. 0) * (364.0 / 365.0) * (363.0 / 365.0) * … * (346.0 / 365.0), which is a for loop of 20 iterations, for i = 1 to 20). Generalize this question to compute the probability of n people with 2 of them having the same birth date. Print out in tabular format, such probability for n = 11, 12, up to n = 50, listing 5 in a row if possible. For verification purpose, the output should look like below: Printing out probabilities of 2 identical birthdays for 11 to 50 people 0.141141 0.167025 0.19441 0.223103 0.252901 0.283604 0.315008 0.346911 0.379119 0.411438
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

ZawHtinECE257 Quiz 4 - ECE257 Quiz 4 Date: 3/10/08, Monday,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online