Jump to content
BrainDen.com - Brain Teasers

Izzy

Members
  • Posts

    3092
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Izzy

  1. Spoiler

    I did another case to convince myself. There let be six people. Say "green" if you see exactly 5, 4, or 3 people before you with green hats, and no one in front of you could also see 5, 4, or 3 green hats in front of them. Say "yellow" if you see exactly 5, 4, or 3 people before you with yellow hats, and no one in front of you could also see 5, 4, or 3 yellow hats in front of them.

    The possible colorings again break up into 1 + 6 + 15 + 20 + 15 + 6 + 1 (corresponding to ways to have all green hats, 1 green hat, 2 green hats, etc. respectively). We show we can save all except the middle 20 scenarios. 

    If all of the hats are green, the fourth person sees three green hats in front of him, and says "green". Then, no one else says anything. 

    If five of the hats are green, the person with the fourth green hat says "green", and no one else says anything. 

    The same thing happens for the all yellow and five yellow cases. So, we've already saved 14/64 cases. 

    Now, consider when four hats are green and two hats are yellow. None of the yellow people speak. The person with the fourth green hat says "green", and they all live. The same thing happens for the cases when all the hats are yellow. Thus, this saves an additional 15*2 = 30 cases. So, overall, we save 44/64 = 11/16 cases. 

    So, for an even number of people, I think we can always save (2^n-(n C n/2))^(2^n) people, by saying "green" if you see n-1, n-2, ..., or n/2+1 green hats in front of you, and no one else does, or same thing for yellow hats. (For six, this turns out to be (2^6 - (20))/2^6 = 11/16. For 100, this turns out to be about 90%, and in general the expression has limit 1.  

    If n is odd, we have to be a little bit careful in small cases. For example, for n=5, we get the color breakdown of 1 + 5 + 10 + 10 + 5 + 1, and 10 + 10 > 1 + 5 + 5 + 1, so this strategy is not optimal. However, for n large enough (starting at n=9, actually), this problem disappears. The n=5 and n=7 cases can be examined separately for an optimal strategy. 

     

  2. Spoiler

    First, we convince ourselves of the case with three people. When three hats are colored, the most common combination is that two hats are one color and the third hat is of the other. So, if one person sees two hats of the same color, he should guess the opposite color of those hats. 

    Let's see what happens in each of the cases. 

    green green green (everyone dies)

    green green yellow (everyone lives)

    green yellow green (everyone lives)

    yellow green green (everyone lives)

    yellow green green (everyone lives)

    green yellow green (everyone lives)

    green green yellow (everyone lives)

    yellow yellow yellow (everyone dies)

    Great, so people are saved 6/8 times. 

    Generalizing this is not too hard. For four people, there are 16 possible ways to color the hats. Let (AcB) denote "A choose B", and let this also be the ways we choose the green hats. So, all of our possible combinations are:

    (4c0) + (4c1) + (4c2) + (4c3) + (4c4) = 1 + 4 + 6 + 4 + 1. So, in 8/16 cases, there will be three hats of one color and one hat of the other. Okay, this only gives us 50/50. 

    Let's see what happens for five people. We get

    (5c0) + (5c1) + (5c2) + (5c3) + (5c4) + (5c5) = 1 + 5 + 10 + 10 + 5 + 1. Now, in 20/32 cases, the coloring will have three hats of one color and two of the other. 

    With six, the strategy is worse again, the corresponding numbers being 1+6+15+20+15+6+1 = 64. 

    Anyways, if you keep doing this, you see that with an odd number of prisoners, 2k+1, you get that the middle two entries (of Pascal's triangle) are both (2k+1 c k), so you have people 2(2k+1 c k)/2^(2k+1) of the time, which... has a limit that goes to 0 sadly. So, this doesn't work work well for lots of people, but does for small amounts of people. 

     

  3. Found the mistake! 

    13 hours ago, Izzy said:
      Hide contents

    Place A anywhere. Draw the diameter through A and the center. Rotate this so that the line goes through (0,0) and (0,-1) on the Cartesian plane. 

    Now, there is a 50% chance of placing B in the upper half of the circle, and a 50% chance of placing B in the lower half of the circle. 

    If B is placed in the lower half of the circle, (without loss of generality, place B in the third quadrant), and draw a diameter between B and the center. Now, the possible places for C lie between the positive y-axis and the diameter we just drew. This piece ranges from having an area of 0 to pi/4. (I am assuming all such areas between 0 and pi/4 would occur with equal probability...) Then, on average, this piece has size which is 1/8 of the circle. 

    If B is placed in the upper half of the circle, (without loss of generality, place B in the second quadrant), then again draw a diameter between B and the center. Now, the possible places for C lie between the positive y-axis and the diameter we just drew. (I am again assuming all such areas between 0 and pi/2 would occur with equal probability...). Then, on average, this piece has size which is 1/4  3/8 of the circle (because it takes on values between 1/4 and 1/2 of the circle uniformly, not values between 0 and 1/2, whoops.) 

    So, we get 1/2*1/8 + 1/2*1/4  3/8 = 1/4. 

     

     

  4. @bonanova

     

    Let everyone pick a partner, and number one of the partners 0 and the other 1.  Everyone agrees to say "green", unless they count the exact number of greens hats as their number. The possible colorings are:

    green, green (guy on left (0) lives)

    green, yellow (guy on right (1) lives)

    yellow, green (guy on right (1) lives)

    yellow, yellow (guy on left (0) lives)

    Since we can have 50 such groups, 50 people are guaranteed to live (and die!).

    Just calculated the groups of three case, and half the time two people are saved, and the other half one person is saved. So, you get the same expected value, but can't guarantee as many.

  5. Spoiler

    Place A anywhere. Draw the diameter through A and the center. Rotate this so that the line goes through (0,0) and (0,-1) on the Cartesian plane. 

    Now, there is a 50% chance of placing B in the upper half of the circle, and a 50% chance of placing B in the lower half of the circle. 

    If B is placed in the lower half of the circle, (without loss of generality, place B in the third quadrant), and draw a diameter between B and the center. Now, the possible places for C lie between the positive y-axis and the diameter we just drew. This piece ranges from having an area of 0 to pi/4. (I am assuming all such areas between 0 and pi/4 would occur with equal probability...) Then, on average, this piece has size which is 1/8 of the circle. 

    If B is placed in the upper half of the circle, (without loss of generality, place B in the second quadrant), then again draw a diameter between B and the center. Now, the possible places for C lie between the positive y-axis and the diameter we just drew. (I am again assuming all such areas between 0 and pi/2 would occur with equal probability...). Then, on average, this piece has size which is 1/4 of the circle. 

    So, we get 1/2*1/8 + 1/2*1/4 = 3/16, giving a 18.75% chance of drawing a triangle that passes through the center, slightly smaller than the 1/4 we got from eyeballing it. 

     

  6. @Molly Mae, that doesn't quite work. You can draw some counter examples. It did give me a good idea, though. 

     

    Spoiler

    Arbitrarily draw points A and B. Then, draw two diameter lines,  one through the center and A, and the other through the center and B. Now, the circle is divided into four pieces, with opposite pieces being equal. The only way to form a triangle that goes through the center is either for point C to be on one of these diameter lines in the opposite quadrants of points A and B, or to be in the opposite quadrant of the quadrant between A and B. So, to calculate the probability is to calculate the area of that quadrant. 

    I'm totally late to go teach my class, so I'll have to do that later. It does seem to be 1/4 though. 

     

  7. @bonanova, it should be the second post in the thread. Someone upvoted it, so it's no longer in chronological order.

    Thanks. :D Honestly, I was going to keep trying to come up with a better one, so thanks for putting me out of my misery. Is there a way to prove that there isn't a *better* solution?

  8. Spoiler

    So, the above answer can be generalized a bit. Let everyone pick a partner, and number the partners 0 and 1.  Everyone agrees to say "green", unless they count the exact number of greens hats as their number, The possible colorings are:

    green, green (guy on left lives)

    green, yellow (guy on right lives)

    yellow, green (guy on right lives)

    yellow, yellow (guy on left lives)

    Since we can have 50 such groups, 50 people are guaranteed to live (and die!).

     

  9. @Molly Mae, here is a demonstration that the answer can bestrictly greater than zero. 

    Spoiler

    I only have like ten minutes to type it out right now, so here's a smaller example. Suppose there are three people, number them 0 to 2. Let everyone say "green", unless they see exactly the same number of hats as their number. 

    The eight possible hat colors, people numbered left to right are:

    g, g, g (at least 0th person lives)

    g, g, y (at least 0th person lives)

    g, y, g (at least 0th person lives)

    y, g, g (at least 2nd person lives)

    g, y, y (at least 1st person lives)

    y, g, y (at least 1st person lives)

    y, y, g (at least 1st person lives)

    y, y, y (at least 0th person lives)

    Generalize this to 100 people. 

     

     

  10. Spoiler

    Okay, what about this. (Long shot. Does the warden assume the prisoners to be truthful? Probably not.) 

    The prisoners decide aloud, as MM mentioned, to each say the hat color that they see most frequently. (So, if they see 49-50, they say the color of the 50.)

    "Drats!" thinks the warden. "A majority of them will survive, which reflects poorly on my wardening ability. Unless! Hah. I will make the hats 50-50 and then they will all die and I'll get a raise." The warden of course believes the prisoners, because why would they lie to each other during their only opportunity to plan?

    Of course, the perfectly logical prisoners knew the warden would think of this solution. The hats are distributed 50-50, and everyone lives by saying the opposite color of the majority that they see. 

     

  11. 6 minutes ago, Molly Mae said:

     

      Reveal hidden contents

    It wouldn't be a hat puzzle without a clever answer, though, so I'm going to say the highest number I can guarantee is 0.

     

     

    Spoiler

    Pretty sure it wouldn't be a "toughie" if we can't save anyone. We definitely need to manipulate the warden. 

    @bonanova, is the warden perfectly logical? Are the prisoners perfectly logical? 

  12. I wonder if the prisoners have to effectively trick the warden into giving them a favorable scenario. For example, the prisoners say that they're all going to pair up with a predetermined partner, and say the opposite color of the hat that their partner has. The warden, thinking that he's clever, gives all pairs the same color hats. The prisoners all know this and say the same color hat as their partner. Or, the warden just doesn't let people partner up. This relies on the warden being way too stupid lol. 

  13.  

    First prisoner walks in the room. Second prisoner stands to the right him (unless they're not allowed to move again? Then, he stands  to the right still, but not too close.) The third prison can then see the colors of the hats of the first two prisoners. If the hats are different colors, the third prisoner stands between the first two prisoners. If the hats are the same color, the third prisoner stands to the right of the second prisoner. So, now the fourth prisoner does the same thing. If the hats are all the same color, he stands to the outside. If the hats are different colors, he stands between the two people who have opposite colored hats that are standing next to each other. Continue in this fashion. This sorts the prisoners into a long line, where all the red hats are together and all the blue hats are together. The monotonic groups are separated by the line between the only two people standing next to each other with opposite colored hats (unless all hats were the same color to begin with.) So, basically this line is between the last person and the 99th person, assuming at least one hat of each color. 

    Example, in case I explained that poorly. Numbers indicate the entrance of the prisoners

    1; 1 2; 1 2 3; 1 2 4 31 2  5 4 3 etc. 

  14. Hmm. The first thing we want to do is find the largest such rectangle that can be filled with 17 circles in such a way. We know that a square has maximum area out of rectangles with the same perimeter. So, to maximize the area, I want to try to arrange the circles as closely to a square as possible. 

    Consider the following pattern (without the weird double spacing that completely distorts it.) Without loss of generality, let the circles have radius 1. 

    O      O      O

    |O      O      O      O|

    |    O      O      O     |

    |O      O      O      O|

    |  _  O ___  O  _  O  |

     

    Draw the circles so that two adjacent circles on the same line have distance exactly 2 between them.  Also, let the distance between two circles that are above and below each other also be 2. Draw the rectangle so that each side is tangent to the outer circles. (I filled some of it in, you get the idea. ) Then, the area of this rectangle is 14 by 10 = 140 units^2. The area of each one of our circles is pi. If we could be perfectly efficient with our circles (we can't), it would take 140/pi = ~45 circles to cover our rectangle. Of course, this won't perfectly overlap our rectangle, but at least we have a lower bound. 

    I am not sure of the optimal way to cover a region with circles. If you start with the top corner being the edge of a circle (like this: https://i.stack.imgur.com/WCSIr.png ), it would take 8 circles to cover the first row  ( the ceiling of 14 / sqrt(2)) and 6 to cover the first column (the ceiling of 10/sqrt(2)), leading to 48 total circles, which is fairly close to the previous lower bound! 

  15. Hey

    @bonanova, I tried to PM you, but the forum says you can't receive messages. 

    It only took like ten years and some prodding, but I finally solved one of your riddles. :D 

    I've wondered recently, what is your mathematics background like? When I was a kid, I just assumed it was normal for adults to be really good at math, but now I suspect you've done a degree in math or at least CS? I actually just started doing a math PhD, and honestly part of the reason was probably because I always had so much fun doing your riddles. So, thanks for that! 

  16. 1 hour ago, bonanova said:

    I think it boils down to that, but how to justify doing it?

      Reveal hidden contents

    Maybe it helps to note that "The less-attended party" doesn't a priori attach to either Peter or Paul. If the question were to ask: "If Peter's were the less-attended party, what would its expected attendance be?" would the equations change? Or, once we see that the distribution is flat, (which really is the <surprising> crux of the puzzle) and we know the less-attended party would have fewer than 50 guests, it's simply asking for the expected value of a flat distribution of numbers less than 50.

     

     

    Ah, you're right. I was assuming that the lesser amount of guests were all at the same party, but never considered whose party. Since there are actually two different outcomes to consider, the expected total value should be (expected value of Peter's party, given that his is less-attended) + (expected value of Paul's party, given that his is less-attended) = ~25 guests. 

  17. @bonanova Intuitively, I just want to multiply my answer by 2, but I'm trying to figure out where I under counted. I am positive that to get n guests to attend your party (without considering all the possible ways to get n guests to attend, i.e. this counts how to get the first n people to all come to your party, or the last n people, etc.) is (100-n)!(n!)/(101!). The (100 choose n) would give me all the possible rearrangements of the n people coming to the party. Multiplying these gives the surprising 1/101, which *should* be the chances of getting exactly n people at your party, but this must be wrong? 

    Is it because this calculates the chance to get exactly n people at some party, but there are actually two parties, so we must multiply by 2? 

  18. Let's see if I remember some probability. 

    I assume a 14% chance of being born on any given day of the week. 

    1) The probability that exactly one person out of seven is born on a Friday is 7 * (.14) * .86^6 = 39.6%. 

    2) The probability that three out of five people are born on a Sunday is (5 choose 3) * .14^3 * .86^2 = 2%. 

  19.  

    It is not so hard to see that the probably that n guests attend the lesser party P(guests = n), for the n guests arriving in any order, is ((101-(n+1))!)(n!)/(101!). There are (100 choose n) possible rearrangements of these guests arriving, giving that P(guests = n) = ((101-(n+1))!)(n!)/(101!) * (100!)\[(100-n!)(n!)] = 1/101 (surprisingly). 

    Thus, the expected value is 1/101 * (1 + 2 + ... + 50) = 12.63 guests at the party with less guests.

     

×
×
  • Create New...