Dynamic Programming Problems Birthday Paradox
Birthday Paradox There are 365 days in a year (no leap years) You have N students in a classroom How many students would you need so that the probability of there being at least one pair of students that have the same birthday, is greater than 50% Well we know the answer is: At least 2 Not more that 365
It must be: Number of Students Probability of at least one match 1 2 1 2 1/365 3 (1/365) + [1 – (1/365)] * [ (2/365 ] N (prob match with N-1) + (prob no match) * (prob N will match other) 365
Shortest path example Graph coming soon…come back later
Seats on an Airplane 100 seats on a plane $59/seat and all sell $5,900 and no empty seats $100/seat and 80 sell $8,000 and 20 empty seats $200/seat and 50 sell $10,000 and 50 empty seats $300/seat and 30 sell $9,000 and 70 empty seats
Seats on an Airplane Suppose some customers would pay $299 but not $699 Some customers would pay $699 (or better $299) We would like to reserve a seat for everyone willing to pay $699 and sell the rest for $299. How many seats would be reserve for the $699 customers and the rest go to the $299 customers