What is the least number of people that need to be in a room such that there is greater than a 50% chance that at least two of the people have the same birthday?
Only 23 people need to be in the room.
Our first observation in solving this problem is the following:
(the probability that at least 2 people have the same birthday + the probability that nobody has the same birthday) = 1.0
What this means is that there is a 100% chance that EITHER everybody in the room has a different birthday, OR at least two people in the room have the same birthday (and these probabilities don't add up to more than 1.0 because they cover mutually exclusive situations).
With some simple re-arranging of the formula, we get:
the probability that at least 2 people have the same birthday = (1.0 - the probability that nobody has the same birthday)
So now if we can find the probability that nobody in the room has the same birthday, we just subtract this value from 1.0 and we'll have our answer.
The probability that nobody in the room has the same birthday is fairly straightforward to calculate. We can think of this as a "selection without replacement" problem, where each person "selects" a birthday at random, and we then have to figure out the probability that no two people select the same birthday. The first selection has a 365/365 chance of being different than the other birthdays (since none have been selected yet). The next selection has a 364/365 chance of being different than the 1 birthday that has been selected so far. The next selection has a 363/365 chance of being different than the 2 birthdays that have been selected so far.
These probabilities are multiplied together since each is conditional on the previous. So for example, the probability that nobody in a room of 3 people have the same birthday is (365/365 * 364/365 * 363/365) =~ 0.9918
More generally, if there are n people in a room, then the probability that nobody has the same birthday is (365/365 * 364/365 * ... * (365-n+2)/365 * (365-n+1)/365)
We can plug in values for n. For n=22, we get that the probability that nobody has the same birthday is 0.524, and thus the probabilty that at least two people have the same birthday is (1.0 - 0.524) = 0.476 = 47.6%.
Then for n=23, we get that the probability that nobody has the same birthday is 0.493, and thus the probabilty that at least two people have the same birthday is 1.0 - 0.493) = 0.507 = 50.7%. Thus, once we get to 23 people we have reached the 50% threshold.
You have two lengths of rope. Each rope has the property that if you light it on fire at one end, it will take exactly 60 minutes to burn to the other end. Note that the ropes will not burn at a consistent speed the entire time (for example, it's possible that the first 90% of a rope will burn in 1 minute, and the last 10% will take the additional 59 minutes to burn).
Given these two ropes and a matchbook, can you find a way to measure out exactly 45 minutes?
The key observation here is that if you light a rope from both ends at the same time, it will burn in 1/2 the time it would have burned in if you had lit it on just one end.
Using this insight, you would light both ends of one rope, and one end of the other rope, all at the same time. The rope you lit at both ends will finish burning in 30 minutes. Once this happens, light the second end of the second rope. It will burn for another 15 minutes (since it would have burned for 30 more minutes without lighting the second end), completing the 45 minutes.