Jump to content
BrainDen.com - Brain Teasers

harey

Members
  • Posts

    219
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by harey

  1. I had this solution in mind, unfortunately, it fails because of repeated situations.

    Starting situation: 6 lanterns, only lantern 6 is lit.

    First round:
    lantern 1: no action
    lantern 2: devil turns it on
    remaining lanterns: angel does not do anything (If the devil turns a lantern on before the angel has turned any off, then the angel should just do nothing on that circuit. )

    Situation: Lanterns 2 and 6 are lit

    2nd round:
    lantern 1: no action
    lantern 2: angel turns it off (on each circuit, turn off all lit lanterns until the devil turns an unlit lantern on)

    Now, only the lantern 6 is lit: the game ends if the lanterns return to a previously encountered state

    What am I missing?

  2. Here's an example from my code's 6 lantern output:

    111110 <one lit lantern (interpret 0 as "on" and 1 as "off")
    111101 <one lit lantern

    You suppose the devil turns the lantern 5 on. But what if he turns the lantern 4 and not 5 on?

    111110 <one lit lantern (interpret 0 as "on" and 1 as "off")
    111010 your turn

     

    P.S. I am not touchy (did not even think it could be interpreted this way), but I think things over. In the last time, I wrote a lot of nonsense, i.e. my first answer.

  3. @EventHorizonMy post is unrelated to yours.

    The number of lamps is not important, just a little bit more that those I quote.

    "Let's start with one lantern lit, i.e. 33.":

    This is not a binary number, it is the 33rd lantern assuming the starting position is the 1st lantern (conveniently chosen), following the lantern 32 and followed by the lantern 34.

  4. Spoiler

    As I am a nice guy, I let you the role of the angel.

    Let's start with one lantern lit, i.e. 33.

    Situation 1: 33
    Before you turn 33 off, I have to light a lantern:

    Situation 2: 13 33 (we are in 13)
    As I shall not light more lanterns, you have to turn off:
    a) 13 in next turn -> situation 1
    b) 33 in this turn or the next one

    Situation 3: 13 (we are in 33)
    Before you turn 13 off, I have to light a lantern:

    Situation 4: 13 43 (we are in 43)
    You have to turn off:
    a) 43 the in next turn -> situation 3
    b) 13 in the next turn

    Situation 5: 43 (we are in 13)
    I light 33.

    Situation 6: 33 43 (we are in 33)
    a) If you turn of 43, in the next turn, I light 13-> Situation 2
    b) You must wait; I light 13.

    Situation 7: 13 33 43 (we are in 13)
    You turn off:
    a) 13-> Situation 6
    b) 33-> Situation 4
    c) 43-> Situation 2

    Two lanterns:
    I let you switch of one lantern and we are in the case of one lantern. Recursion...

     

  5. Spoiler

    I assume that if they make a turn without changing the state of any lantern. a "previously encountered state" occurs (otherwise, they could walk around endlessly).

    Strategy for the devil: turn on the lanterns the angel switched off.

    The angel must turn off a subset of the set of the lit lanterns (and not all subsets are suitable). As the possibilities are finite, the angel cannot avoid a repetition.

    In some rare cases, the angel wins, i.e.: (off) on on on.

     

  6. Spoiler

    You can optimize by grouping the prime factors. One price (at least) will have the factor 5*5 and the same for 2*2.

    79 may not be multiplied by a large number, but it did not bring me very far, so I consulted internet:

    https://groups.google.com/g/rec.puzzles/c/Sfeu4Ge3xVc

    (Ctrl-F) "79 must be multiplied by 4" is a starting point, but why not by 3?

    "This leaves only a few combinations" would need some more clarification, too.

     

    &EventHorizon

  7. Spoiler

    If you bet 10 USD in the first round, your expectancy is 20 USD. Consequently, in each round, you should bet all you money.

    However, I would never bet on even 10 tails in a row.

    Whatever your strategy is, there always is a chance you get bankrupt.

    There is a similar problem: a coin is tossed and as long as heads come out, 2 USD are added to the bank. When tails are tossed, the game ends and you cash the bank. How much would you pay to play this game? (Remember that you might win an infinite amount of USD.)

     

  8. OK, so here the solution.

    Spoiler

    If you have the highest number, you will not exchange it. Recursively, we can restart the game without the highest number. You will not agree to exchange as long as you do not have the lowest number.

    As I have the second lowest number, my only hope is that you have 2. However, I spoiled my last chance because in this case, you trade.

    So I will 100% do the dishes.

    Should you have problems with the recursivity:
    if you have the 2nd highest number, you will not exchange because you will not receive the highest number
    if you have the 3rd highest number, we have seen that higher numbers will not be exchanged
    ...

     

  9. To decide who will do the dishes, we put in a jar tickets with prime numbers up to 111. The one who draws the ticket with a larger number wins.

    I look at my ticket: 3. Maybe you have a low number like 11... So I offer to exchange our tickets before showing them.

    What is the probability I will do the dishes?

  10. I get 13.

    Take one coin of each chest.

    a) You get two Gold, one Silver:
    Silver is identified, remains to distinguish all_Gold and Gold_Silver.
    Take 10 more coins from the first G:
      - if they are all gold, you identified all_Gold, the remaining is Gold_Silver
      - if you get a silver coin, you identified Gold_Silver, the remaining is all_Gold

    b) You get one Gold, two Silver:
    Same proceeding, permute Gold/Silver.

    • Like 1
  11. There is a strip of N (N>13) squares. In the middle is the SILVER DOLLAR.
    Two players alternatively place a penny on an empty square.

    Then, at each turn, a player must:
    - move one coin one or more squares to the left, observing:
      - the coin cannot move out of the strip
      - the coin cannot jump on another coin
      - the coin cannot jump over another coin
                      - or -
    - pocket the leftmost coin

    Best strategy?

  12. @Plasmid I translated your notation into mine, as far as we are gone, we have same results (excepted some doublets).

     

    Spoiler

    Round 1, Person N
    ...

    (new)      L M N
    L = 2M     2 1 3
    M = 2L     1 2 3
    L = 3M/2   3 2 5 (a)
    L = 3M     3 1 4 (b)
    M = 3L/2   2 3 5
    M = 3L     1 3 4
    M = L/3    3 1 4 (b)
    M = 2L/3   3 2 5 (a)
    M = 4L/3   3 4 7
    M = 5L/3   3 5 8

     

     

    I thought about interpolation, too, but I did not go this way estimating there is not enough data.

  13. I fear there is no solution.

    Spoiler

    Round 1, A:
        A knows his number if he sees (1,2). As the difference (1) is already used, he must have the sum.
        1Aa: (3,1,2)
        1Ab: (3,2,1)

       (And multiples.)

        In all other cases, A must pass.

    Round 1, B:
        The same way:
        1Ba: (1,3,2)
        1Bb: (2,3,1)

        B reads A's thoughts, useful in following cases:
        from 1Aa: (3,!2,1) -> 1Bc: (3,4,1)
        from 1Ab: (3,!1,2) -> 1Bd: (3,5,2)

        In all other cases, B must pass.

    Round 1, C:
        As previously:
        1Ca: (1,2,3)
        1Cb: (2,1,3)

        Let's assume C sees (3,4,?).
        If the solution is (3,4,1), B would have announced it. So he has 7.

        In general:
        from 1Aa: (3,1,!2) -> 1Cc: (3,1,4)
        from 1Ab: (3,2,!1) -> 1Cd: (3,2,5)
        from 1Ba: (1,3,!2) -> 1Ce: (1,3,4)
        from 1Bb: (2,3,!1) -> 1Cf: (2,3,5)
        from 1Bc: (3,4,!1) -> 1Cg: (3,4,7)
        from 1Bd: (3,5,!2) -> 1Ch: (3,5,8)

        In all other cases, C must pass.

    Round 2, A:
        from 1Ba: (!1,3,2) -> 2Aa: (5,3,2)
        from 1Bb: (!2,3,1) -> 2Ab: (4,3,1)
        from 1Bc: (!3,4,1) -> 2Ac: (5,4,1)
        from 1Bd: (!3,5,2) -> 2Ad: (7,5,2)
        from 1Ca: (!1,2,3) -> 2Ae: (5,2,3)
        from 1Cb: (!2,1,3) -> 2Af: (4,1,3)
        from 1Cc: (!3,1,4) -> 2Ag: (5,1,4)
        from 1Cd: (!3,2,5) -> 2Ah: (7,2,5)
        from 1Ce: (!1,3,4) -> 2Ai: (7,3,4)
        from 1Cf: (!2,3,5) -> 2Aj: (8,3,5)
        from 1Cg: (!3,4,7) -> 2Ak: (11,4,7)
        from 1Ch: (!3,5,8) -> 2Al: (13,5,8)

    Here, I give up. Python:

    Spoiler

    def A(new,old):
      for l in Z:
        if l[0]==old: Z.append([new,old,l[3]+l[4],l[3],l[4],'',l[2],l[3],l[4]])
      #for l in Z: print(*l)

    def B(new,old):
      for l in Z:
        if l[0]==old: Z.append([new,old,l[2],l[2]+l[4],l[4],'',l[2],l[3],l[4]])

    def C(new,old):
      for l in Z:
        if l[0]==old: Z.append([new,old,l[2],l[3],l[2]+l[3],'',l[2],l[3],l[4]])
    #-------------------------------------------------------------------------#
    Z=[ ['A1','  ',3,1,2], ['B1','  ',1,3,2], ['C1','  ',1,2,3],
        ['A1','  ',3,2,1], ['B1','  ',2,3,1], ['C1','  ',2,1,3]]


    B('B1','A1')
    C('C1','A1')
    C('C1','B1')
    A('A2','B1')
    A('A2','C1')
    B('B2','A2')
    B('B2','C1')
    C('C2','A2')
    C('C2','B2')

    for l in Z:
      print(l[0],end=' ')
      print('{:3d}'.format(l[2]),end=' ')
      print('{:3d}'.format(l[3]),end=' ')
      print('{:3d}'.format(l[4]),end=' ')
      if len(l)>5:
        print('  from',l[1],end=' ')
        print('{:3d}'.format(l[6]),end=' ')
        print('{:3d}'.format(l[7]),end=' ')
        print('{:3d}'.format(l[8]),end='')
      print()

    bingo=[]
    for l in Z:
      if l[0]=='C2' and not l[4] in bingo: bingo.append(l[4])
    bingo.sort()
    print('\nPossible bingos for C2:',*bingo)

     

    Result:

    A1   3   1   2 
    B1   1   3   2 
    C1   1   2   3 
    A1   3   2   1 
    B1   2   3   1 
    C1   2   1   3 
    B1   3   5   2   from A1   3   1   2
    B1   3   4   1   from A1   3   2   1
    C1   3   1   4   from A1   3   1   2
    C1   3   2   5   from A1   3   2   1
    C1   1   3   4   from B1   1   3   2
    C1   2   3   5   from B1   2   3   1
    C1   3   5   8   from B1   3   5   2
    C1   3   4   7   from B1   3   4   1
    A2   5   3   2   from B1   1   3   2
    A2   4   3   1   from B1   2   3   1
    A2   7   5   2   from B1   3   5   2
    A2   5   4   1   from B1   3   4   1
    A2   5   2   3   from C1   1   2   3
    A2   4   1   3   from C1   2   1   3
    A2   5   1   4   from C1   3   1   4
    A2   7   2   5   from C1   3   2   5
    A2   7   3   4   from C1   1   3   4
    A2   8   3   5   from C1   2   3   5
    A2  13   5   8   from C1   3   5   8
    A2  11   4   7   from C1   3   4   7
    B2   5   7   2   from A2   5   3   2
    B2   4   5   1   from A2   4   3   1
    B2   7   9   2   from A2   7   5   2
    B2   5   6   1   from A2   5   4   1
    B2   5   8   3   from A2   5   2   3
    B2   4   7   3   from A2   4   1   3
    B2   5   9   4   from A2   5   1   4
    B2   7  12   5   from A2   7   2   5
    B2   7  11   4   from A2   7   3   4
    B2   8  13   5   from A2   8   3   5
    B2  13  21   8   from A2  13   5   8
    B2  11  18   7   from A2  11   4   7
    B2   1   4   3   from C1   1   2   3
    B2   2   5   3   from C1   2   1   3
    B2   3   7   4   from C1   3   1   4
    B2   3   8   5   from C1   3   2   5
    B2   1   5   4   from C1   1   3   4
    B2   2   7   5   from C1   2   3   5
    B2   3  11   8   from C1   3   5   8
    B2   3  10   7   from C1   3   4   7
    C2   5   3   8   from A2   5   3   2
    C2   4   3   7   from A2   4   3   1
    C2   7   5  12   from A2   7   5   2
    C2   5   4   9   from A2   5   4   1
    C2   5   2   7   from A2   5   2   3
    C2   4   1   5   from A2   4   1   3
    C2   5   1   6   from A2   5   1   4
    C2   7   2   9   from A2   7   2   5
    C2   7   3  10   from A2   7   3   4
    C2   8   3  11   from A2   8   3   5
    C2  13   5  18   from A2  13   5   8
    C2  11   4  15   from A2  11   4   7
    C2   5   7  12   from B2   5   7   2
    C2   4   5   9   from B2   4   5   1
    C2   7   9  16   from B2   7   9   2
    C2   5   6  11   from B2   5   6   1
    C2   5   8  13   from B2   5   8   3
    C2   4   7  11   from B2   4   7   3
    C2   5   9  14   from B2   5   9   4
    C2   7  12  19   from B2   7  12   5
    C2   7  11  18   from B2   7  11   4
    C2   8  13  21   from B2   8  13   5
    C2  13  21  34   from B2  13  21   8
    C2  11  18  29   from B2  11  18   7
    C2   1   4   5   from B2   1   4   3
    C2   2   5   7   from B2   2   5   3
    C2   3   7  10   from B2   3   7   4
    C2   3   8  11   from B2   3   8   5
    C2   1   5   6   from B2   1   5   4
    C2   2   7   9   from B2   2   7   5
    C2   3  11  14   from B2   3  11   8
    C2   3  10  13   from B2   3  10   7

    Possible bingos for C2: 5 6 7 8 9 10 11 12 13 14 15 16 18 19 21 29 34
     

    None of these numbers divides 148.

    Notice that it is always the prisoner with the highest number who can know, so there is no solution in the form [a*148,b*148,148].

     

    Please comment, especially if you found it correct ;)

     

  14. Same as rocdocmac

    Spoiler

    Before reaching 20 (n) stairs, you can either:
    - go up 1 stair  and apply the solution for 19 (n-1) stairs -- or --
    - go up 2 stairs and apply the solution for 18 (n-2) stairs.

    This gives the formula: f(n)=f(n-1)+f(n-2). (Looks like Fibonacci...)

    For 1 stair,  there is 1 possibility.
    For 2 stairs, there is 2 possibilities. => Fibonacci

    Combinatorics:

    Spoiler

    Maximum number of double stair steps is given by the integer division of number of stairs by 2.
    Complete sigle stair steps.
    Take all permutations with repetitions:

    Spoiler

    from math import factorial as MF

    FIBO_1,FIBO_2=1,1

    # staircase will take the values 1,2,3,...20 (yes, 20)
    for staircase in range(1,21):
      FIBO_1,FIBO_2=FIBO_2,FIBO_1+FIBO_2
      combi=0
      doubles=staircase//2

      # double will take values 0,1,2...doubles (see staircase)
      for double in range(0,doubles+1):
        single=staircase-double*2
        combi=combi+MF(single+double)//MF(double)//MF(single)
      # remove # in the next line for intermediate results
      # print(staircase,single,double,combi)

      print('stairs =',staircase,'combinations =',combi,'Fibonacci =',FIBO_1)
     

    Output:

    Spoiler

    stairs = 1 combinations = 1 Fibonacci = 1
    stairs = 2 combinations = 2 Fibonacci = 2
    stairs = 3 combinations = 3 Fibonacci = 3
    stairs = 4 combinations = 5 Fibonacci = 5
    stairs = 5 combinations = 8 Fibonacci = 8
    stairs = 6 combinations = 13 Fibonacci = 13
    stairs = 7 combinations = 21 Fibonacci = 21
    stairs = 8 combinations = 34 Fibonacci = 34
    stairs = 9 combinations = 55 Fibonacci = 55
    stairs = 10 combinations = 89 Fibonacci = 89
    stairs = 11 combinations = 144 Fibonacci = 144
    stairs = 12 combinations = 233 Fibonacci = 233
    stairs = 13 combinations = 377 Fibonacci = 377
    stairs = 14 combinations = 610 Fibonacci = 610
    stairs = 15 combinations = 987 Fibonacci = 987
    stairs = 16 combinations = 1597 Fibonacci = 1597
    stairs = 17 combinations = 2584 Fibonacci = 2584
    stairs = 18 combinations = 4181 Fibonacci = 4181
    stairs = 19 combinations = 6765 Fibonacci = 6765
    stairs = 20 combinations = 10946 Fibonacci = 10946

     

     

  15. 16 hours ago, plasmid said:

    Comment on your answer

      Hide contents

    04 [2] B: "C is more than 18 years old."
    05 [A] E: "C is less than 18 years old."           => (b1) E=!B

    That's not necessarily true... you could have E=B if C is exactly 18 years old, which is what I had in my answer. And the overall solution runs into a problem: A (liar) is 19 years old, but B (truthful) said C (truthful) is >18. (I'm assuming the OP doesn't want you to invoke finer granularity than integer ages and say that C's birthday is earlier than A's so they can both be 19 but with different truthiness.)

     

     

    17 hours ago, plasmid said:

    Comment on your answer

      Hide contents

    04 [2] B: "C is more than 18 years old."
    05 [A] E: "C is less than 18 years old."           => (b1) E=!B

    That's not necessarily true... you could have E=B if C is exactly 18 years old, which is what I had in my answer. And the overall solution runs into a problem: A (liar) is 19 years old, but B (truthful) said C (truthful) is >18. (I'm assuming the OP doesn't want you to invoke finer granularity than integer ages and say that C's birthday is earlier than A's so they can both be 19 but with different truthiness.)

     

    Thanks for finding the problem. I was so sure that if X contradicts Y, they must be in different categories - it did not occur to me that can be both liars.

  16. Do not worry, on my first attempt, I did not manage it to write it clearly enough that I myself could read and understand it. When you asked your question, I checked my solution written about a year ago and wondered whether it would not be easier to start from the beginning. I have rewritten it and found a kind of notation:

     

    Spoiler

    My idea was to separate them in two groups of same of same confidence and then assume one group are liars and the other tell true. It worked only partly, but it worked:

    01 [5] E: "A is more than 21 years old."
    02 [8] C: "A is 19 years old."                     => (a1) E=!C

    04 [2] B: "C is more than 18 years old."
    05 [A] E: "C is less than 18 years old."           => (b1) E=!B
    06
    07 Assume (c1) E=true:
    08        (d1) B=!E=liar
    09        (e1) C=!E=liar

    11        Reverse what B states:
    12        [2] B: "C<=18" => C=true     (The younger is true,
    13        [7] B: "E>20"  => E=liar      the older is false.)
    14        Contradicts both assumption and e1, so:

    16 (c2) E=false
    17 (d2) B=!E=true
    18 (e2) C=!E=true

    20 Rewriting as true statements:
    21 [ 2] B: "C>18"
    22 [ 3] C: "D<22"
    23 [!5] E: "A<=21"
    24 [ 7] B: "E<20"
    25 [ 8] C: "A=19"
    26 [!A] E: "C>=18"

    28 (L1): [7] and (c2): L<20

    30 [1] A: "B>20" translates B=liar, contradicts (L1) => A=liar
    31 [9] D: "B=20" translates B=liar, contradicts (L1) => D=liar

    33 [L1] [8]: L<20 and L>=19 -> L=19.

    35 A=liar, 19 [8]
    36 B=true, B<=L
    37 C=true, C=L [2], [A]
    38 D=liar, L<D<22 [3]
    39 E=liar, L=19 [8]

    We both excluded the possibility E being true, but considered different implications.

    You will certainly get the best answer. but maybe you are wanting to rewrite it using my notation (and possibly improve it). I thought about a chart, but too much work.

     

    P.S. Can someone change in the title ONE in ONCE?

    Thanks in advance.

  17. On an island, every statement is true if the islander is aged less than L and false if he is at least L years old. Find their ages.

    [1] A: "B is more than 20 years old."
    [2] B: "C is more than 18 years old."
    [3] C: "D is less than 22 years old."
    [4] D: "E is not 17 years old."
    [5] E: "A is more than 21 years old."
    [6] A: "D is more than 16 years old."
    [7] B: "E is less than 20 years old."
    [8] C: "A is 19 years old."
    [9] D: "B is 20 years old."
    [A] E: "C is less than 18 years old."

  18. I did some research...

    At first, the drawing Nick made is somewhat confusing. What he calls "forward force" should be "thrust" and what he calls "thrust" should be "drag". Just google "drag thrust weight lift".

    If thrust=drag and lift=weight, the plane will fly at constant speed at constant height (plenty of pages).

    Now, the question is how much thrust we need to generate lift=weight (or a little better).

    On the end of the article https://en.wikipedia.org/wiki/Lift-to-drag_ratio, there is a table: latest air-crafts have a coefficient over 19.

  19. I fear there are multiple solutions.

    Babysnoot is correct, just the only reason to proclaim Jester truthteller is that there is no further contradiction in the system.

    For Bear=truthteller, Drummer=liar, others=mix (it does not matter whether what they say is true or false), there is no contradiction in the system, neither.

    Does someone agree?

  20. A table with English words by the set of all combinations (with repetition) of 7 letters. However, even with some tricks like sorting the letters, I do not think my computer would give me the answer overnight.

     

    Remains the Monte-Carlo method. However, I am pretty sure it is not the expected answer.

     

    A hint?

  21. 3 hours ago, harey said:
      Hide contents

     

    Assume that passengers 2-98 ask (if necessary) the forgetful passenger to leave his seat and THIS passenger then choses a seat at random.

     

    When the last passenger boards, 98 are correctly seated. The forgetful passenger occupies either his own seat or that of the 100th passenger.

     

    So p=50%.

     

     

     

    Read "passenger 2-99" instead of "2-98".

×
×
  • Create New...