Question:
There are _ 1's _ 2's _ 3's _ 4's _ 5's _ 6's _ 7's _ 8's _ 9's and _ 0's in this sentence. Fill in the blanks with the correct digits to make the sentence true.
Answer:
There are 7 1's 3 2's 2 3's 1 4's 1 5's 1 6's 2 7's 1 8's 1 9's and 1 0's in this sentence. There are a few key pieces of insight that help solve the problem. First, there can only be 1 zero, because there aren't zero of any number. Next there can't be more than 1 nine. Then one can recognize that most of the larger numbers will have value of 1. The only except will be whatever number fills 1's slot. Trial and error can solve the rest quickly.
Mark wrote, "Here's an alternate answer, ?'There are 11 1's 2 2's 1 3's 1 4's 1 5's 1 6's 1 7's 1 8's 1 9's and 1 0's in this sentence'.
My original assumption that you possessed a ?'Hal' type brain has been proved true. That you should re-visit the answer is in its self-remarkable. To come up with an equally valid answer is, may I say outstanding.
"Oh, had to translate uncia from Latin to English. " All is fair in trick or treat. :wink:
This was compounded by this answer, "You want to be 20th in line.
Assuming 365 days, your probability of winning is about .03232.
Assuming 366 days (with 2/29 just as likely as any other), your probability of winning is about .03227. "
Whilst I had:
Suppose you are the Kth person in line. Then you win if and only if the K-1 people ahead all have distinct birtdays AND your birthday matches one of theirs. Let
A = event that your birthday matches one of the K-1 people ahead
B = event that those K-1 people all have different birthdays
Then
Prob(you win) = Prob(B) * Prob(A | B)
(Prob(A | B) is the conditional probability of A given that B occurred.)
Now let P(K) be the probability that the K-th person in line wins, Q(K) the probability that the first K people all have distinct birthdays (which occurs exactly when none of them wins). Then
P(1) + P(2) + ... + P(K-1) + P(K) = 1 - Q(K)
P(1) + P(2) + ... + P(K-1) = 1 - Q(K-1)
P(K) = Q(K-1) - Q(K) <--- this is what we want to maximize.
Now if the first K-1 all have distinct birthdays, then assuming uniform distribution of birthdays among D days of the year, the K-th person has K-1 chances out of D to match, and D-K+1 chances not to match (which would produce K distinct birthdays). So
Q(K) = Q(K-1)*(D-K+1)/D = Q(K-1) - Q(K-1)*(K-1)/D
Q(K-1) - Q(K) = Q(K-1)*(K-1)/D = Q(K)*(K-1)/(D-K+1)
Now we want to maximize P(K), which means we need the greatest K such that P(K) - P(K-1) > 0. (Actually, as just given, this only guarantees a local maximum, but in fact if we investigate a bit farther we'll find that P(K) has only one maximum.) For convenience in calculation let's set K = I + 1. Then
Q(I-1) - Q(I) = Q(I)*(I-1)/(D-I+1)
Q(I) - Q(I+1) = Q(I)*I/D
P(K) - P(K-1) = P(I+1) - P(I)
= (Q(I) - Q(I+1)) - (Q(K-2) - Q(K-1))
= Q(I)*(I/D - (I-1)/(D-I+1))
To find out where this is last positive (and next goes negative), solve
x/D - (x-1)/(D-x+1) = 0
Multiply by D*(D+1-x) both sides:
(D+1-x)*x - D*(x-1) = 0
Dx + x - x^2 - Dx + D = 0
x^2 - x - D = 0
x = (1 +/- sqrt(1 - 4*(-D)))/2 ... take the positive square root
= 0.5 + sqrt(D + 0.25)
Setting D=365 (finally deciding how many days in a year!),
desired I = x = 0.5 + sqrt(365.25) = 19.612 (approx).
The last integer I for which the new probability is greater then the old is therefore I=19, and so K = I+1 = 20.
You should try to be the 20th person in line.
Ouch! This hurt's.
You enter a town that has K killers and P pacifists. When a pacifist meets a pacifist, nothing happens. When a pacifist meets a killer, the pacifist is killed. When two killers meet, both die.
Regardless of whether you are a pacifist or a killer, you may disregard all events in which a pacifist other than yourself is involved and consider only events in which you are killed or a pair of killers other than yourself is killed.
Assume meetings always occur between exactly two persons and the pairs involved are completely random. What are your odds of survival