Jump to content
BrainDen.com - Brain Teasers

bubbled

Members
  • Posts

    93
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by bubbled

  1. Here is my best reasoning:

     

    I would pick C.

    Starting from top left to top right to bottom left

    Purple: I see the top purple dot moving clockwise 1, then clockwise 2 so guessing it will move 3. The bottom dot moves  clockwise 3 and then 4, so guess it will move 5.

    Red: I see the left dot move clockwise 2, then clockwise 3, so guess it will move 4. The right dot moves clockwise 0, then 1, so guess it will move 2. 

    Image C lines up with those guesses.

    • Upvote 1
  2. There is a well known gambling hustler from a time gone by name Titanic Thompson. He was a great golfer, but lived during a time when you could make more money hustling amateurs than playing on tour.

    One of his classic hustles was he'd go down to Florida during the winter and play for weeks with a group of players and play right-handed (he was a very good right-handed golfer). After beating them out of a fair amount of money, he'd offer to play them double or nothing left-handed. Of course, he was a natural lefty.

    Here's the hustle that will form my puzzle. He once bet a group of businessmen that he could hit a golfball a mile. He went to the Grand Canyon and simply hit the golf ball off the edge. He told them that he felt bad and then offered to bet double of nothing that he could hit a ball over 500 yards horizontally. They took the bet. This is a time when given the hickory clubs of the time, it was hard to hit a ball over 200 yards.

    How did he win? 

  3. I think this strategy is better

    Hidden Content

    Jasen, you are on the right track, but you can't move the boxes. Imagine that the boxes are wooden with a hinged lid. The boxes are nailed to the table in position. You can open the boxes and look in, but you can't touch the names inside and when you've finished looking in your 50 boxes, you have to close all the boxes. Also, for Rainman, the problem is definitely achievable. The best strategy is not on the order of 1 / 2*100

  4. what you mean  "they can open at most 50 boxes" ?
    total boxes they can open   or   each prisoner can open 50 boxes

    If each prisoner can open 50 boxes, I think, surviving probability is more than 50%

    The percentage bonanova is looking to get above 30% is the probability that the ENTIRE group of 100 prisoners will all find their names. Without a powerful group strategy, each prisoner will be exactly 1/2 to find their name, thus the chances the entire group will succeed would be 1 / (2^100). 

  5. Here's one where you only flip the coin once:

     

    The girl secretly writes one of the friend's names and H or T on a piece of paper. As long as she keeps this secret, the game is fair.

    Then the friends discuss who flips. As long as they don't know what is on the paper, the game is fair either way. After deciding, one of the friends flips the coin. If their name matches, the coin has to match. If their name doesn't match, the coin needs to not match for them to win.

    I admit that there are other factors besides the coin that decides their fate, but the coin is the deciding factor. 

  6. Based on this exacting 1000 time simulation of the best night of your high school life, you got very lucky!! BTW, this code works fine.

     

    from random import randint

    def he_gets_the_bottle():
        if randint(0,9) == 1:
            return True

    def it_points_to_uma():
        if randint(0, 9) == 1:
            return True

    def bonanova_gets_a_kiss():
        if he_gets_the_bottle() and it_points_to_uma():
            return True

    kisses = 0        

    for i in range(1000):
        if bonanova_gets_a_kiss():    
            kisses += 1
        
    print kisses

    • Upvote 1
  7. Just for giggles I ran a simulation for 1,000,000 games. Here's my output and Python code:

     

    As expected, the results are very close to 1/8 for each spot.

    {1: 125123, 2: 124812, 3: 125169, 4: 125239, 5: 125046, 6: 125019, 7: 125028, 8: 124564}

     

    from random import randint

    wins = {1 : 0, 2 : 0, 3 : 0, 4 : 0, 5 : 0, 6 : 0, 7 : 0, 8 : 0}

    def play_game():
        locations = [8, 7, 6, 5, 4, 3, 2, 1, 0, 8, 7, 6, 5, 4, 3, 2, 1]
        where = 8
        visited = [0]
        direction = [-1, 1]
        while len(visited) < 8:
            move = direction[randint(0, 1)]
            where = where + move        
            guest = locations[where]
            if guest not in visited:
                visited.append(guest)
        for i in range(9):
            if i not in visited:
                return i
    for i in range(1000000):
        winner = play_game()
        wins[winner] += 1
    print wins

     

  8. I believe I posted a very similar problem years ago involving a roulette wheel and a ball with paint on it. It can be solved with just logic. No math is needed:

     

    The seating position of the guests does not matter. All guests are equally likely to win.

    For a guest to win, exactly two things must happen:

    1. At some point the bottle must move to the location 1 to their right or 1 to their left.

    2. Then the bottle must travel completely around the circle, in the opposite direction, until it has arrived at that guest's location. There is a chance the bottle could do 1, move all the way around to the other side of the guest and then reverse directions again, but by then the game is decided, as all other guests have been visited and we are just waiting for that guest to eventually get the bottle.

    Here is an example of how 3 might win. 1, 2, 1, Host, 8, Host, 8, 7, 6, 7, 6, 5, 6, 5, 4, 3.  All wins will look something like this, or its opposite. 

    It's clear that for any guest, if 1 happens, there is a fixed percentage chance that 2 will happen, and that percentage is the same no matter where that guest sits. And if you think about how the game works, the probability that 1 will happen for any given guest is 100%. At some point, all guests will have the bottle one to their right or left before they get the bottle. Therefore, all guest are equally likely to win the game.

  9. A general solution:

     

    Let S = the starting number of heads face up, where S = any number from 1 to 9, inclusive. Move S coins into a separate pile and flip them all. Let H = the actual number of the coins in the side pile you created that happened to be heads. After the flip, you will have two piles with exactly h = S - H of the coins showing heads. No matter what S is, h could be as little as 0. h can never be more than 5, and is limited by 10 - S when S > 5.

     

     

  10. My guess:

     

    You up 2-love in sets, and you are in a tiebreaker and up 6-love. The set score doesn't really to matter, as once your powers are gone, you have about a 0% chance of winning a set from the start. This gives you 6 points to win the match with just one bad stroke from Fed. I'd rather this than up 5-love and 40-love, in a set. In that scenario, you only have 3 points to win directly. Once you get to deuce and your powers are gone, your win percentage will go down to about 0%.

    Against a decent amateur, even with this advantage, I'd love to bet on Fed.  

  11. OK. Here's my attempt at a formal inductive proof:

     

    I will show that for all N = r + b, where N = total number of cards, r = number of red cards and b = number of black cards, that no matter whether you stop immediately, or look at another card, expected chances of winning is P(win) = r / (r + b).

    Base case: Clearly, if N = 1, P(win) = r / (r + b). If the one card left is red, you are P(win) = 1 / (1 + 0) = 1 and if it's black, P(win) = 0 / (0 + 1) = 0. I'm a little uncomfortable limiting the base case to just 1 card, as you don't really have the option to stop or continue. So, let's include 2 cards into the base case. 

    If there are 2 red cards, P(win_stop) = 2 / (2 + 0) = 1. If you let a card turn over, P(win) = 1 / (1 + 0) = 1. If there are 2 black cards, P(win_stop) = 0 / (0 + 2) = 0. If you let a card turn over, P(win) = 0 / (0 + 1) = 0. If there is 1 red and 1 black, then P(win_stop) = 1 / (1 + 1) = .5. If you let a card turn over, P(win) = 0 * P(a red card shows) + 1 * P(a black card shows) = (0 / (0 + 1) )* (1 / (1 + 1)) + (1 /(1 + 0)) * (1 / (1 + 1)) = .5.

    Assumption: We assume that if r + b = N, then whether you stop or continue, P(win) = r / (r + b).

    Inductive Step: I will try to show that if r + b = N +1, whether you stop or continue, P(win) = r / (r + b). Clearly, if you stop, P(win_stop) = r / (r + b). If you let a card turn, P(win) = P(win if black card shows) * P(a black card shows) + P(win if red card shows) * P(a red card shows) = r / (r + b - 1) * b / (r + b) + ((r - 1) / (r + b -1)) * (r / (r + b )) = (r * (r + b -1)) / (r + b) * (r + b -1) = r / (r + b). 

    It's been a while since I've done an inductive proof, but I think this should hold up.

  12. Here's my answer:

     

    I think there is no strategy that can do better than 50%. There may be a way to do a formal inductive proof. But, in lieu of that here's my thinking.

    Let's say for some reason we have continued with the game until there are 2 cards. If there are two black cards or two red cards left, it doesn't matter what you do. If there 1 of each, you can say stop and be 50-50. Or, if you let the 51st card turn, you will either be 0% or 100% with total odds of 50%. No optimal strategy.

    Now, let's see what happens if there are 3 card left. Again, if there are 3 red or 3 black, it doesn't matter what you do. If there are 2 red and 1 black, you can stop and be 66%, or you can wait another card. 66% of the time you will be 50%, and 33% of the time, you will be 100%, which totals 66%. If you are down to 1 red and 2 black, you can stop and be 33%, or wait another card and 33% of the time you will be 0%, and 66% of the time you will be 50%. Again, that all adds up to total EV of 33%. Again, no optimal strategy.

    I'm sure I could build up from there to 4, 5, ..., 52 cards.

    But, let's look at your decision with 52 cards left. You could stop immediately, and be exactly 50%. But, if you let a card turn over, it is 50% to be red and 50% to be black. So, you'd be 50% to be 26/51 or 50% to be 25/51. Again, that adds up to 50% total EV.

    I'm totally open to the idea that there could be a strategy, but it appears to me, you never know what card will turn over next. Your odds of winning will change from card to card, but that change is random, and in the long run will result in a 50% win rate, no matter what you do.

  13. It appears that there's a general solution for how many barrels/bottles (B) of wine you can test given a number of soldiers (N) and a number of testing time periods (P).

    B = (P + 1)^N.

    If the poison killed in a day and you had 7 days and 3 soldiers, you could test 512 barrels. Cool.

     

  14. Ok I try again

    Hidden Content

    Beautifully done. I had never considered going with a base-3 approach. That now answers a question I couldn't figure out. Given N soldiers, why is the maximum number of barrels one can investigate in two time periods equal to exactly 3^N?

  15. from bubbled question, I need only 4 soldier !!

    Hidden Content

    If you read the question closely, you will see you can't use smaller slices of time than 24 hours. A person is guaranteed to die within 24 hours, but when they die, is unknown. I assure you, you will need all 5 soldiers.

  16. I think I posted this one before. But it's certainly similar to the OQ. 

    The king has 240 barrels of wine, one of which has been poisoned.  After drinking the poisoned wine, one dies within 24 hours.  The king has 5 soldiers whom he is willing to sacrifice in order to determine which barrel contains the poisoned wine.  How does he achieve this in 48 hours?

  17. Here's another approach:

     

    For a given number of bottles B, minimize M such that:

    B <= (M choose 0) + (M choose 1) + (M choose 2) + ... + (M choose M)

    You are assigning a unique combination of soldiers (both identity and number) to each bottle. Note it and see who dies. Then have a great party! 

    Gruesome and easy.

  18. My attempt...

    Hidden Content

     

     

    Well done k-man. The explanation I heard from the lecturer was very similar:

     

    Let's say you have a room with 30 pupils in it. You then figure out all the ways you can choose 10 students. For kicks, you also see how many ways you can choose 9 students. Now imagine the professor walks into the room, you now have 31 people in the room. If you were to add the professor to all the groupings of 9 students, combined with the earlier groupings of 30 choose 10, you have all the groupings of 31 choose 10.

  19. There is a conjecture for the probability p0(n) where n=2m for all n bullets to be annihilated. I do not have a proof. Now that there are two programs that are giving the answers for n=4 and n=10 that agree with p0(4) and with p0(10) obtained from the conjectured formula, I think I will give the formula.  It can be tested against simulations for other values of n, and its simple form may suggest a line of attack to derive it analytically.

    Hidden Content

     

    bonanova, it certainly looks like your formula is right. I wrote some new quicker code using suggestions from CaptainEd. I then simulated 100,000 trials for each even number from 4-100 bullets. I then compare the simulation to the result predicted by your formula. The results track the formula very well:

     

    Results for  4  bullets
    Total annihilation in simulation  0.3727
    Predicted annihilation rate  0.375
    Results for  6  bullets
    Total annihilation in simulation  0.31259
    Predicted annihilation rate  0.3125
    Results for  8  bullets
    Total annihilation in simulation  0.27502
    Predicted annihilation rate  0.2734375
    Results for  10  bullets
    Total annihilation in simulation  0.24536
    Predicted annihilation rate  0.24609375
    Results for  12  bullets
    Total annihilation in simulation  0.22711
    Predicted annihilation rate  0.2255859375
    Results for  14  bullets
    Total annihilation in simulation  0.20922
    Predicted annihilation rate  0.20947265625
    Results for  16  bullets
    Total annihilation in simulation  0.19769
    Predicted annihilation rate  0.196380615234
    Results for  18  bullets
    Total annihilation in simulation  0.18393
    Predicted annihilation rate  0.185470581055
    Results for  20  bullets
    Total annihilation in simulation  0.17622
    Predicted annihilation rate  0.176197052002
    Results for  22  bullets
    Total annihilation in simulation  0.16714
    Predicted annihilation rate  0.168188095093
    Results for  24  bullets
    Total annihilation in simulation  0.16207
    Predicted annihilation rate  0.161180257797
    Results for  26  bullets
    Total annihilation in simulation  0.15443
    Predicted annihilation rate  0.154981017113
    Results for  28  bullets
    Total annihilation in simulation  0.15071
    Predicted annihilation rate  0.149445980787
    Results for  30  bullets
    Total annihilation in simulation  0.1459
    Predicted annihilation rate  0.144464448094
    Results for  32  bullets
    Total annihilation in simulation  0.13952
    Predicted annihilation rate  0.139949934091
    Results for  34  bullets
    Total annihilation in simulation  0.13503
    Predicted annihilation rate  0.135833759559
    Results for  36  bullets
    Total annihilation in simulation  0.13288
    Predicted annihilation rate  0.132060599572
    Results for  38  bullets
    Total annihilation in simulation  0.12941
    Predicted annihilation rate  0.128585320635
    Results for  40  bullets
    Total annihilation in simulation  0.12712
    Predicted annihilation rate  0.12537068762
    Results for  42  bullets
    Total annihilation in simulation  0.12247
    Predicted annihilation rate  0.122385671248
    Results for  44  bullets
    Total annihilation in simulation  0.12085
    Predicted annihilation rate  0.119604178719
    Results for  46  bullets
    Total annihilation in simulation  0.11745
    Predicted annihilation rate  0.117004087878
    Results for  48  bullets
    Total annihilation in simulation  0.11474
    Predicted annihilation rate  0.114566502713
    Results for  50  bullets
    Total annihilation in simulation  0.11162
    Predicted annihilation rate  0.112275172659
    Results for  52  bullets
    Total annihilation in simulation  0.10913
    Predicted annihilation rate  0.110116034723
    Results for  54  bullets
    Total annihilation in simulation  0.10976
    Predicted annihilation rate  0.108076848895
    Results for  56  bullets
    Total annihilation in simulation  0.10705
    Predicted annihilation rate  0.106146905165
    Results for  58  bullets
    Total annihilation in simulation  0.10369
    Predicted annihilation rate  0.10431678611
    Results for  60  bullets
    Total annihilation in simulation  0.10212
    Predicted annihilation rate  0.102578173009
    Results for  62  bullets
    Total annihilation in simulation  0.10062
    Predicted annihilation rate  0.100923686347
    Results for  64  bullets
    Total annihilation in simulation  0.09913
    Predicted annihilation rate  0.099346753748
    Results for  66  bullets
    Total annihilation in simulation  0.098
    Predicted annihilation rate  0.0978414999033
    Results for  68  bullets
    Total annihilation in simulation  0.09683
    Predicted annihilation rate  0.0964026543165
    Results for  70  bullets
    Total annihilation in simulation  0.09548
    Predicted annihilation rate  0.0950254735405
    Results for  72  bullets
    Total annihilation in simulation  0.0936
    Predicted annihilation rate  0.0937056752969
    Results for  74  bullets
    Total annihilation in simulation  0.09156
    Predicted annihilation rate  0.0924393823875
    Results for  76  bullets
    Total annihilation in simulation  0.0905
    Predicted annihilation rate  0.0912230747245
    Results for  78  bullets
    Total annihilation in simulation  0.09127
    Predicted annihilation rate  0.0900535481255
    Results for  80  bullets
    Total annihilation in simulation  0.08921
    Predicted annihilation rate  0.0889278787739
    Results for  82  bullets
    Total annihilation in simulation  0.08814
    Predicted annihilation rate  0.0878433924474
    Results for  84  bullets
    Total annihilation in simulation  0.08683
    Predicted annihilation rate  0.0867976377754
    Results for  86  bullets
    Total annihilation in simulation  0.08456
    Predicted annihilation rate  0.0857883629175
    Results for  88  bullets
    Total annihilation in simulation  0.08574
    Predicted annihilation rate  0.0848134951571
    Results for  90  bullets
    Total annihilation in simulation  0.084
    Predicted annihilation rate  0.0838711229887
    Results for  92  bullets
    Total annihilation in simulation  0.0821
    Predicted annihilation rate  0.0829594803475
    Results for  94  bullets
    Total annihilation in simulation  0.0834
    Predicted annihilation rate  0.0820769326843
    Results for  96  bullets
    Total annihilation in simulation  0.08145
    Predicted annihilation rate  0.0812219646355
    Results for  98  bullets
    Total annihilation in simulation  0.08119
    Predicted annihilation rate  0.080393169078
    Results for  100  bullets
    Total annihilation in simulation  0.07821
    Predicted annihilation rate  0.0795892373872

  20. I agree with bubbled about Jasen's statement:

    Hidden Content

    Bubbled, I agree that you have to recognize that bullets disappear, but I disagree that you have to simulate each second; merely calculate collision timestamps

    Hidden Content

     

    I agree with bubbled about Jasen's statement:

    Hidden Content

    Bubbled, I agree that you have to recognize that bullets disappear, but I disagree that you have to simulate each second; merely calculate collision timestamps

    Hidden Content

    OK, I'm trying to wrap my head around you statement of calculating collision times, without simulating the the actual firing of the bullets. How would you calculate the result of this 4-bullet sequence. b_0 = v 0.9;  b_1 = v 0.1;  b_2 = v 0.2;  b_3 = v 0.99. Unless you account for the firing of the bullets and the timing thereof, it might appear that b_3 annihilates b_2 and b_0 and b_1 survive. But taking into account the firing phase, b_2 annihilates b_1, and later b_3 annihilates b_0. 

    I agree with bubbled about Jasen's statement:

    Hidden Content

    Bubbled, I agree that you have to recognize that bullets disappear, but I disagree that you have to simulate each second; merely calculate collision timestamps

    Hidden Content

    OK, I think I figured out what you meant.

    1. I create n bullets all at once.

    2. I store them in a list of the form [(n-1, V_n-1), (n-2, V_n-2),...,(0, V_0)]

    3. For each pair in order starting from the n-1 bullet, I calculate time of collision. Example for n-1 bullet and n-2 bullet: t = (((n -1) - (n -2)) * V_n-2) / (V_n-1 - V_n-2). The two velocities can't be equal (division by zero) which is very unlikely. In the example, the ((n-1) - (n-2)) term is obviously 1, but in later iterations it might be higher.

    4. If t < 0 ignore.

    5. If t > 0, then actual collision time is t + n-1.

    6. Find min of all actual collision times and remove those two bullets. Then repeat the process with remaining bullets until all bullets gone or there are no collisions left.

    I'd be afraid to try to optimize further. CaptainEd, do you have a way of removing all bullets will eventually collide in one pass?

×
×
  • Create New...