This logic puzzle stumped ChatGPT. Can you solve it?

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 มิ.ย. 2024
  • The world's best AI cannot solve this simple question! Can you figure it out? Four glasses are in a row face up. What's the minimum number of moves to make them down, if you have to invert 3 glasses at a time? What if you have n glasses and you have to invert n - 1 glasses at a time? Special thanks this month to: Mike Robertson, Daniel Lewis, Kyle, Lee Redden. Thanks to all supporters on Patreon! / mindyourdecisions
    0:00 problems
    1:23 solution
    6:08 general 1
    10:49 general 2
    UKMT
    / 1698954285327712365
    Puzzling StackExchange solution by Caleb Stanford
    puzzling.stackexchange.com/qu...
    Subscribe: th-cam.com/users/MindYour...
    Send me suggestions by email (address at end of many videos). I may not reply but I do consider all ideas!
    If you purchase through these links, I may be compensated for purchases made on Amazon. As an Amazon Associate I earn from qualifying purchases. This does not affect the price you pay.
    If you purchase through these links, I may be compensated for purchases made on Amazon. As an Amazon Associate I earn from qualifying purchases. This does not affect the price you pay.
    Book ratings are from January 2023.
    My Books (worldwide links)
    mindyourdecisions.com/blog/my...
    My Books (US links)
    Mind Your Decisions: Five Book Compilation
    amzn.to/2pbJ4wR
    A collection of 5 books:
    "The Joy of Game Theory" rated 4.3/5 stars on 290 reviews
    amzn.to/1uQvA20
    "The Irrationality Illusion: How To Make Smart Decisions And Overcome Bias" rated 4.1/5 stars on 33 reviews
    amzn.to/1o3FaAg
    "40 Paradoxes in Logic, Probability, and Game Theory" rated 4.2/5 stars on 54 reviews
    amzn.to/1LOCI4U
    "The Best Mental Math Tricks" rated 4.3/5 stars on 116 reviews
    amzn.to/18maAdo
    "Multiply Numbers By Drawing Lines" rated 4.4/5 stars on 37 reviews
    amzn.to/XRm7M4
    Mind Your Puzzles: Collection Of Volumes 1 To 3
    amzn.to/2mMdrJr
    A collection of 3 books:
    "Math Puzzles Volume 1" rated 4.4/5 stars on 112 reviews
    amzn.to/1GhUUSH
    "Math Puzzles Volume 2" rated 4.2/5 stars on 33 reviews
    amzn.to/1NKbyCs
    "Math Puzzles Volume 3" rated 4.2/5 stars on 29 reviews
    amzn.to/1NKbGlp
    2017 Shorty Awards Nominee. Mind Your Decisions was nominated in the STEM category (Science, Technology, Engineering, and Math) along with eventual winner Bill Nye; finalists Adam Savage, Dr. Sandra Lee, Simone Giertz, Tim Peake, Unbox Therapy; and other nominees Elon Musk, Gizmoslip, Hope Jahren, Life Noggin, and Nerdwriter.
    My Blog
    mindyourdecisions.com/blog/
    Twitter
    / preshtalwalkar
    Instagram
    / preshtalwalkar
    Merch
    teespring.com/stores/mind-you...
    Patreon
    / mindyourdecisions
    Press
    mindyourdecisions.com/blog/press
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 760

  • @mihailghinea
    @mihailghinea 3 หลายเดือนก่อน +1439

    There is a solution that works for any number of glasses and requires only 0 inverting steps... you take all the glasses and carefully, without reverting any of them, travel to the exact opposite point of the Earth's surface. DISCLAIMER: doesn't work for flat earthers.

    • @harshguruji5562
      @harshguruji5562 3 หลายเดือนก่อน +15

      😅

    • @shaurryabaheti
      @shaurryabaheti 3 หลายเดือนก่อน +90

      that's called thinking out of the box and i personally love the dig at flat earthers too, 10/10 comment

    • @MS-sv1tr
      @MS-sv1tr 3 หลายเดือนก่อน

      Gotta love how people who don't understand Flat Earth Theory mock it 😂. Same as it ever was, sadly

    • @SmoMo_
      @SmoMo_ 3 หลายเดือนก่อน +31

      Save the cost of the plane ticket and just wait 12 hours

    • @MrZoolook
      @MrZoolook 3 หลายเดือนก่อน +39

      @@MS-sv1tr You mean there are people that take Flat Earth Theory seriously?

  • @nohax3691
    @nohax3691 2 หลายเดือนก่อน +226

    move 0 (or just the starting position):0000
    move 1:1110
    move 2:1001
    move 3:0010
    move 4:1111
    0=up-right
    1=upsidedown

    • @Lightning4395
      @Lightning4395 28 วันที่ผ่านมา +29

      I got the exact same outcome in about a minute of thinking lol

    • @elianhg2144
      @elianhg2144 21 วันที่ผ่านมา +7

      same here, not really hard

    • @hisham_hm
      @hisham_hm 19 วันที่ผ่านมา +7

      and the general solution is:
      step 1) invert all but glass 1
      step 2) invert all but glass 2
      ...
      step n) invert all but glass n

    • @michael1
      @michael1 18 วันที่ผ่านมา +2

      yeah it's not even a puzzle really is it? I mean, the first move whichever 3 you turn over you end up equivalent to 0000 to 1110, 3 of them will be upside down one the right way up. This is the same as 0000 to 0111 or 0000 to 1011 and so on. There's no puzzling about move 1 it's a given.
      For your 2nd move. If you turn the same 3 back over, you'd just end up back at the start. So the only other choice is to turn 2 upside down back and the one you didn't touch on your first move upside down. So 1110 goes to 0011. So far we've done 2 moves and had no real choice over either of them.
      Now we're in a position with 2 upright and 2 upside down. The only 2 moves are, turn 2 of the upright and 1 upside down, or 2 upside down and 1 upright . One of which 0011 goes to 1110 which is going backwards to a previous state. So we must go from 0011 to 1000. I'd accept that this move requires a bit of thought.
      Our last move is now trivial. We just turn the 3 upright glasses upside down achieving our goal 1000 to 1111.
      So, it's puzzle insofar as you had to do a bit of analysis for move 3. The other moves are either just obvious or they're the only moves you can make.

    • @mateowoetam
      @mateowoetam 17 วันที่ผ่านมา +3

      I did this with my fingers, different moves, but same amount, nice.
      Edit: for those who want my moves
      1: fingers up, 0: fingers down
      1111 - start position
      0010 - move 1
      0101 - move 2
      1011 - move 3
      0000 - move 4 / final position

  • @creepx_hd1236
    @creepx_hd1236 3 หลายเดือนก่อน +214

    I got so excited when I solved it without looking at the video then immediately humbled when I saw the question was MUCH more complicated.

    • @dalepirofsky3851
      @dalepirofsky3851 25 วันที่ผ่านมา +2

      SAME :(

    • @yippee8570
      @yippee8570 15 วันที่ผ่านมา +3

      I'm just chuffed I could solve *something* on this channel

  • @user-zl3mu2wd1d
    @user-zl3mu2wd1d 3 หลายเดือนก่อน +338

    Equivalently you can think this way: the glasses are automatically inversed and each time you choose one glass not to get inversed. Remark that for a glass to get inversed, it needs to get inversed odd times. Therefore, if you choose one glasses at a time for four inversions, every glass gets inversed three times and gets inversed!

    • @ManFromThePits
      @ManFromThePits 3 หลายเดือนก่อน +5

      Brilliant!

    • @torinpena288
      @torinpena288 3 หลายเดือนก่อน +5

      I was typing up my own independent comment on this before looking at yours and realizing that yep, that's basically how I solved it.

    • @HaganeNoGijutsushi
      @HaganeNoGijutsushi 3 หลายเดือนก่อน +3

      Yeah, which I think means the problem can only be solved if n is even.

    • @Wildcard71
      @Wildcard71 3 หลายเดือนก่อน +4

      Example in detail (order doesn't actually matter)
      Starting uuuu
      invert all but the first uddd
      invert all but the second dduu
      invert all but the third uuud
      invert all but the forth dddd
      Generalizing: The number of glasses equals the number of moves.

    • @josefuher6117
      @josefuher6117 3 หลายเดือนก่อน

      alternatively you can think about it as invertin one glass then and inverting up and down. to invert all glasses you need to have inverted all glasess and have up and down in the same way as in the begining

  • @partycatplays
    @partycatplays หลายเดือนก่อน +170

    Saying this puzzle "stumps" ChatGPT or Google AI plays into the myth that these applications are capable of thought - they are not. They're using statistical modeling to choose words and phrases. Stop it.

    • @ralanham76
      @ralanham76 หลายเดือนก่อน +7

      Yes they are a different version of the same search engine we had from 90s

    • @partycatplays
      @partycatplays หลายเดือนก่อน +5

      @@ralanham76 they go back to an application called Niall from the Amiga era

    • @thefirstuwu8874
      @thefirstuwu8874 หลายเดือนก่อน +11

      How do you know *you* are capable of thought? What exactly is it? And how can you know that a logical "thought" process does not arise through the artificial neurons, just as it arises in our natural ones? No one knows that - both the brain and neural networks are black boxes.

    • @ralanham76
      @ralanham76 หลายเดือนก่อน

      @@thefirstuwu8874 👎

    • @Magst3r1
      @Magst3r1 หลายเดือนก่อน +5

      "Stop it."

  • @ceejay0137
    @ceejay0137 3 หลายเดือนก่อน +69

    It takes two moves to reach a position where two of the glasses are upside down. This is a symmetrical situation which could be reached from either the initial position or the desired final position. That means the minimum number of moves is four.

    • @DimkaTsv
      @DimkaTsv 2 หลายเดือนก่อน +5

      It is even simpler
      You have 4 glasses, but can only turn 3 of them each round.
      To turn everything you must turn total number of glasses equal to number that is simultaneously divisible by 3 and 4. Smallest such number is 12. Meaning you will turn total 12 glasses, aka 4 rounds of 3 glasses.
      If you turn 6 glasses you will get 6/4=1|2, aka 2 glasses in wrong position.

    • @MichaelDarrow-tr1mn
      @MichaelDarrow-tr1mn หลายเดือนก่อน

      ​@@DimkaTsvno. you can do 8 and 6 with 3 moves, turning over a total of 18.
      UUUUUUUU
      UUDDDDDD
      UDUUUUUD
      DDDDDDDD

    • @DimkaTsv
      @DimkaTsv หลายเดือนก่อน

      @@MichaelDarrow-tr1mn
      Ok, in THAT case it was much easier.
      In general rule is much more complicated and take in account unique combinations and even/odd nuances. Rule of smaller divisible will only work on unique combinations where difference between number of glasses and number of turning glasses is odd.
      In case when difference between numbers is even, number of steps will ALWAYS be 3 [unless allowed to turn number is less than third of total]. (for example 9 to 7 or 9 to 5 or 9 to 3)
      This task also will fail if number of total glasses is odd, but you can only turn even glasses at a time. Because even if you would be able to make difference in one or more glasses glass, you will always return them to upside glasses turn on each "odd" step, meaning you wouldn't be able to make it asymmetric. (for example 9 to 4, 9 to 6 and 9 to 8)

  • @mfavier
    @mfavier 3 หลายเดือนก่อน +74

    Every position is just a linear combination on Z/2Z of the 4 possible moves, since moves are commutative. The question is then "find the coefficients given the basis".

    • @minutenreis
      @minutenreis 3 หลายเดือนก่อน +2

      @@Horopter Z/2Z is the residual class ring to 2, so the natural numbers modulo 2; so all values are either 0 or 1 (normal or flipped); which glass you move first is irrelevant since you could just rearrange them
      the important part here is that inverting glasses is basically adding +1 in the Z/2Z so 0+1 = 1 and 1+1 = 2 = 0

    • @ExplosiveBrohoof
      @ExplosiveBrohoof 3 หลายเดือนก่อน +3

      It's not obvious that the four moves form a basis though.

  • @sirrjean1553
    @sirrjean1553 3 หลายเดือนก่อน +53

    The simples terms to think of this is, there is in each situation until the final move only one possible move that doesn’t recreate a previous situation

    • @Dustin314
      @Dustin314 3 หลายเดือนก่อน +10

      This is exactly how I thought of it. Aside from the first move, you always have two options in each move. One of those options makes you go backwards to the previous position, which obviously cannot be how you achieve the minimum number of moves.

  • @taigenraine
    @taigenraine หลายเดือนก่อน +12

    0, flip the paper upside down. Done.

  • @jennystrandqvist1568
    @jennystrandqvist1568 2 หลายเดือนก่อน +14

    Funny, we did this in 4th grade in the 1990's in a game called "Math castle" but it was light-switches instead of glasses.

  • @phasm42
    @phasm42 3 หลายเดือนก่อน +44

    Remember: LLMs being called intelligent is marketing hype. They're a superpowered autopredict, not intelligent.

    • @SmoMo_
      @SmoMo_ 3 หลายเดือนก่อน +3

      Curiously though, any human that could perform a similar task of superpowered pattern matching and prediction would be considered pretty damn intelligent.

    • @SmoMo_
      @SmoMo_ 3 หลายเดือนก่อน +1

      Just as, if you could do mental arithmetic, as fast and as accurately as a simple $1 calculator, you’d be considered a genius in mental arithmetic.

    • @SmoMo_
      @SmoMo_ 3 หลายเดือนก่อน +1

      So why are tasks that if I human did them they would be considered highly intelligent, are also evidence of a LLM not being intelligent when those same tasks are done by it?

    • @phasm42
      @phasm42 3 หลายเดือนก่อน +10

      @@SmoMo_ because we reason things out. LLMs literally just try to predict the next word over and over. If you ask it to explain how it arrived at an answer, the response will simply be, again, a series of words it's trained to predict as the most likely to be a response.
      It's why they're so prone to "lying" -- they have no concept of truth, they're just outputting the words that the model has been trained to predict as most likely to occur.
      Don't get me wrong, they're very impressive in their ability to fake intelligence. But they're not intelligent.

    • @carultch
      @carultch 2 หลายเดือนก่อน +9

      @@phasm42 Artificial intelligence doesn't actually have to be intelligent to ruin your life. It just needs to convince your boss that it is.

  • @walterengler5709
    @walterengler5709 3 หลายเดือนก่อน +16

    Since glass position does not matter only the Up or Down positioning, this is a simple state model where the initial state is 4U0D and you want to get to 0U4D by changing a total 3 U to D or D to U each round. Sideways and backward state changes to prior states are not allowed. So it goes 4U0D, 1U3D, 2U2D, 3U1D, 0U4D .. done, 4 is the minimum possible with not duplications of states.

    • @Dyucrane
      @Dyucrane 2 หลายเดือนก่อน +2

      This elegance can be seen better if you swap the U and D after each step, as in the case of 6 or more cups.
      Instead of - 6U0D, 1U5D, 4U2D, 3U3D, 2U4D, 5U1D, 0U6D
      It would be - 6U0D, 5D1U, 4U2D, 3D3U, 2U4D, 1D5U, 0U6D
      Using this, you can know the orientation of cups in any step for n cups.
      x move for y cups
      (y-x)DxU for all x that is odd
      (y-x)UxD for all x that is even
      ie.
      53rd move for 80 cups = 27D53U
      40th move for 90 cups = 50U40D

  • @theelk801
    @theelk801 3 หลายเดือนก่อน +20

    I thought about this in terms of boolean algebras and got to the solution pretty quickly

    • @sandyjr5225
      @sandyjr5225 3 หลายเดือนก่อน +1

      Me too!

    • @leif1075
      @leif1075 3 หลายเดือนก่อน +2

      Didn't you get the answer is n whether n is even or odd..that doesn't seem to.hold up that with odd there areno solutions

  • @SmoMo_
    @SmoMo_ 3 หลายเดือนก่อน +10

    I think the simplest solution for N glasses would be more like…
    Every two moves, the net number of glasses that have been flipped is either 0 or 2.
    So when N is even, it will take N/2 pairs of moves to flip N glasses, so N moves in total.
    It can’t be less than N if the number of moves is even, because the most the number of flipped glasses can increase each pair of moves is 2.
    If the number of moves is odd, and all glasses were flipped, then you could make one more move, and so have a set of paired moves where the total number of flips would need to be even, and that contradicts that you would have flipped the N glasses already . Therefore there can be no solution with an even number of moves.

  • @tyronorxy5646
    @tyronorxy5646 17 วันที่ผ่านมา +8

    I didn't watch the video yet, only saw the video thumbnail.
    I was able to do it in four steps:
    1. Flip 3 cups, that are in up position.
    2. Flip 1 cup that is in up position, and 2 cups that are in down position.
    3. Flip 1 cup that is in up position, and 2 cups that are in down position.
    4. Flip the three cups that are in up position.

    • @Doopen
      @Doopen 6 วันที่ผ่านมา

      I don't really understand this

    • @Ruskettle
      @Ruskettle ชั่วโมงที่ผ่านมา

      @@DoopenEvery time you flip you swap the left over cup for a cup that is the other way up.

    • @Doopen
      @Doopen ชั่วโมงที่ผ่านมา

      @@Ruskettle I got even more confused but I decided to just try the steps with actual water bottles, I was able to understand hooray!!!
      I was mostly confused because I thought we had 3 turns TOTAL that's why 😭 but yeah I get it now

  • @kaansonmez6598
    @kaansonmez6598 3 หลายเดือนก่อน +24

    It looks like a dynamic programming question. Good one!

    • @bigolbearthejammydodger6527
      @bigolbearthejammydodger6527 3 หลายเดือนก่อน +2

      copying my comment here for you as you are completely right!
      this is a really great puzzle
      I remember solving this when i was a teen - as part of comp sci A-lvl - its an example of heuristic hill climbing algorithm (an algorithm that looks ahead x steps to a better solution to find a final solution) - this sort of algorithm was used in early chess AI (and most modern AI pathing in modern video games)
      Seems Im getting old though (now 45) because I couldn't for the life of me solve it now - and had to watch the vid. (yes it was the proof bit i struggled with, not mentally flipping glasses).
      Interestingly its also the same problem(well very related) as the old board game 'mastermind' also the 'lights out' puzzle (a 2d version, rather than 1d) - something I used to happily solve in my head in fast time due to it being part of a puzzle in the video game Dungeons and dragons online as part of a raid.
      yep.. DEFINITELY getting old, my brain has slowed down so much.

    • @bigolbearthejammydodger6527
      @bigolbearthejammydodger6527 3 หลายเดือนก่อน +1

      you are completely right!
      I remember solving this when i was a teen - as part of comp sci A-lvl - its an example of heuristic hill climbing algorithm (an algorithm that looks ahead x steps to a better solution to find a final solution) - this sort of algorithm was used in early chess AI (and most modern AI pathing in modern video games)

    • @youtube_user4178
      @youtube_user4178 3 หลายเดือนก่อน +2

      Yes. N* (2**N) time complexity if we use dp, constant time complexity if we directly use odd even solution

    • @zeisah8087
      @zeisah8087 2 หลายเดือนก่อน +1

      Damn you are god damn right

  • @Faylasoofe-kaa
    @Faylasoofe-kaa 3 หลายเดือนก่อน +4

    He sounds so proud when he proves it. I meant this in most sincere way!

  • @ashraftaqikamani4365
    @ashraftaqikamani4365 3 หลายเดือนก่อน +52

    Just invert your face so all the glasses will be inverted by 0 moves

    • @gamingweek-mv4mr
      @gamingweek-mv4mr 2 หลายเดือนก่อน +2

      Your the god

    • @GomVorder78439
      @GomVorder78439 2 หลายเดือนก่อน +3

      Or flip your phone upsidedown

    • @a_Generic_User
      @a_Generic_User 2 หลายเดือนก่อน +3

      Tried that, but it still counted as a move.

    • @MrNikolidas
      @MrNikolidas หลายเดือนก่อน +3

      ​@@a_Generic_User It's not a move from the glass's perspective as you never moved any of the glasses. It's in Einstein's Theory of Glass Relativity.

  • @peter.galaxy.s22
    @peter.galaxy.s22 3 หลายเดือนก่อน +5

    a more general version of the original question: given m glasses, all upward initially, each time you choose n (n

  • @ExplosiveBrohoof
    @ExplosiveBrohoof 3 หลายเดือนก่อน +35

    I solved this using some advanced linear algebra:
    Firstly, note the isomorphism between the state of the glasses and the *F*_2-vector space *F*_2^n: for a vector (a_1, ..., a_n) in *F*_2^n, the term a_i = 0 if the glass is not inverted, and 1 if it is. Applying the move "invert all but the i-th glass" is equivalent to adding the vector e_i := (1, 1, ..., 1, 0, 1, ..., 1), where only the i-th term is 0. Since the initial state of the glasses is the zero vector (0, ..., 0), we wish to find nonnegative integers c_1, ..., c_n such that c_1 e_1 + ... + c_n e_n = (1, 1, ..., 1). Taking the c_i modulo 2, and noting that we are after the minimum of c_1 + ... + c_n, we can assume that each c_i is either 0 or 1, and then treat them as elements of *F*_2.
    Let v = e_1 + e_2 + ... + e_n, and notice that v = (n-1, n-1, ..., n-1) (mod 2). When n is even, v = (1,1, ..., 1). In this case, noting that v-e_i = (0,0, ...,0, 1, 0, ..., 0), we see that the standard basis vectors lie in the span of the set {e_1, ..., e_n}. This implies that {e_1, ..., e_n} forms a basis of *F*_2^n, and therefore (1,1, ..., 1) is uniquely expressed as the *F*_2-linear combination e_1 + ... + e_n. Thus the minimum is 1 + ... + 1 = n. When n=4, we have the initial case.
    On the other hand, if n is odd, then v = e_1 + e_2 + ... + e_n = (0,0, ..., 0), which implies that the e_i are not linearly independent. Hence the above argument no longer applies. For this case, let us consider the linear map T: *F*_2^n --> *F*_2 given by T(a_1, ..., a_n) = a_1 + ... + a_n. Notice that T(e_i) = 0 for each i (since n is odd), hence every e_i lies in ker(T). But T(1, 1, ..., 1) = 1. This implies that (1, 1, ..., 1) is not in ker(T), hence is not in the span of {e_1, ..., e_n}. Therefore when n is odd, it is impossible to reach a state where all glasses are inverted.

    • @PhaTs00p
      @PhaTs00p 3 หลายเดือนก่อน +14

      I like your funny words magic man.

    • @greatkiddo7194
      @greatkiddo7194 3 หลายเดือนก่อน +1

      Dang u actually solve the problem in the most complicated way I've seen

    • @verygooddeal4436
      @verygooddeal4436 3 หลายเดือนก่อน

      At the end: why does T(1,1,1,...,1)=1 not being in ker(T) mean that (1,1,...,1) is not in the span of (e1,e2,...,en)?

    • @martinrosol7719
      @martinrosol7719 3 หลายเดือนก่อน

      Nice, but why in such a complicated way?

    • @ExplosiveBrohoof
      @ExplosiveBrohoof 3 หลายเดือนก่อน

      @@verygooddeal4436 ker(T) is a subspace of *F*_2^n, since T is a linear map, and the kernel of a linear map between any two vector spaces is always a subspace of the domain. Because every e_i lies in ker(T), the span of the e_i must be a subset of ker(T), since span({e_i}) is by definition the smallest subspace containing the {e_i}.

  • @DulcetNuance
    @DulcetNuance 2 หลายเดือนก่อน +10

    Go figure language AI models aren't math AI tools. Who would have thunk it.

    • @Axcyantol
      @Axcyantol 6 วันที่ผ่านมา

      First time hearing “thunk” from a human being in genuine conversation

    • @EdwinMartin111
      @EdwinMartin111 6 วันที่ผ่านมา

      ​@@Axcyantol.😂

  • @_Vengeance_
    @_Vengeance_ 2 หลายเดือนก่อน +3

    This seemed suspiciously easy, so I was surprised to see it was actually correct: A sure-fire way to do is to just reverse the glasses in order, skipping back to the beginning when the end is reached. So first 1, 2 and 3. Then 4, 1 and 2, etcetera. That results in 4 moves. And that 4 is the correct answer can be easily checked mathematically: 4 glasses but you must move 3 at a time, that simply means you must find the lowest multiplication of 3 and 4 that are greater than 0 (unless all of them are already in the proper position, which isn't the case here) and are the same answer. In other words: 3 x 4 = 12 and vice-versa. Meaning that with 3 glasses each time, you need 4 moves.

  • @The_Commandblock
    @The_Commandblock 21 วันที่ผ่านมา +2

    In even number positions you always need as many moves as there are glasses: first move turn around all glasses except the most left one, next invert all glasses except the one right next to it, next turn around the glass right next to the last one and so on and so on. This way every glass will turn an odd number of times resilting in an inverted position.
    For an odd numbers of glasses i turned the glasses into zeroes and ones: 00000 is the starting position, 11111 the ending position. Since we have an odd number of glasses, we will have an even amount of moves so i will split the moves in pairs of 2. In the starting position we can see that the sum of all the zeroes is zero, an even number. The sum of the ending position will be an odd number (in the example from earlier: 5).
    Now we will look at what happens when we execute a pair of moves: There are generally 4 positions that can be made out of 2 glasses that have 2 states 00, 01, 10 and 11.
    Now we will look at the change of the sum if we invert these pairs: 00 -> 11 sum changed by 2,
    01 -> 10 and 10 -> 01 sum changed by 0,
    11 -> 00 sum changed by -2.
    Since we will change the sum by an even number, that means we can never reach an odd number as the sum.
    That was the most neat solution i came up with :) really enjoyed puzzling this stuff.

  • @vallabhagrawalla
    @vallabhagrawalla 3 หลายเดือนก่อน +4

    the little gray cells - best part of the vid

  • @FalseNoob777
    @FalseNoob777 3 หลายเดือนก่อน +2

    Great question and solution! 🔥💯

  • @phungcanhngo
    @phungcanhngo 3 หลายเดือนก่อน +1

    Awesome .Thank you professor.

  • @Dyynex
    @Dyynex 4 วันที่ผ่านมา +1

    i just took an induction proofs course last semester, it was absolute hell, past me would never believe that i watched and solved another one of these devilish problems for fun.

  • @NipkowDisk
    @NipkowDisk 3 หลายเดือนก่อน +19

    I can hear Jean-Luc Picard now... "There are FOUR glasses!"

  • @TheGhostOfHallownest
    @TheGhostOfHallownest 7 วันที่ผ่านมา +1

    I was like "wait this is easy"without clicking on the vid till i realized,inverting the glasses counts as a move

  • @Capiosus
    @Capiosus หลายเดือนก่อน +2

    1: lemme fiddle with this
    2: wait this might be impossible
    3: lemme check by thinking about possible states
    3.5: wait the state of the glasses only depends on the number of downs and ups
    4: ah wait its not impossible
    5: finds solution
    6: yippie *clicks video*

  • @michaelmetcalfe639
    @michaelmetcalfe639 3 หลายเดือนก่อน

    For the first question it is just the lights out game and the proof to that is nice. Then you gave the problem for N glasses flipping n-1 of them. That isn't the lights out problem but definitely similar. I liked the proof

  • @ChristianoMDSilva
    @ChristianoMDSilva 3 หลายเดือนก่อน

    Took me about 10 seconds from the thumbnail alone 😅
    I really like these kind of riddles/puzzles

  • @conclusionforeign8568
    @conclusionforeign8568 2 หลายเดือนก่อน +1

    if 1 is 'up'd and 0 is 'down', and the set of indistinguishable glasses is not ordered then:
    1. there are 4 equivalent 1st moves: 1111 -> 0001
    2. there are 3 equivalent 2nd moves: 0001 -> 0110; and one move that reverts the 1st move: 0001-> 1111
    3. there are two pairs of equivalent 3rd moves: flipping two 'up' and one 'down' glasses reverts the 2nd move, only option left is to flip any two 'down' and one 'up': 0110 -> 1011
    4. last move is trivial: 1011 -> 0000
    Either you perform at least one reverting move, or solve in 4 moves hence 4 moves is the minimum.

  • @MikkoRantalainen
    @MikkoRantalainen 5 วันที่ผ่านมา

    As a general rule, when mathematical explanation says "it can be easily shown" means a student can do it in a weekend. On the other hand, "it can be shown" means that a student may accomplish it in a couple of years of studies but sometimes it can refer to stuff like Fermat's Last Theorem where "it can be shown" took over 350 years of trial and error to finally accomplish the "can be shown" part.

  • @pizza8725
    @pizza8725 หลายเดือนก่อน +3

    Can't you just do lcm(3,4)÷3 to get 4?

  • @l.w.paradis2108
    @l.w.paradis2108 3 หลายเดือนก่อน +1

    First puzzle like this I got right away, including that n must be even, the minimum moves is n, and each glass must be turned exactly (n - 1) times after n moves. Since n - 1 is odd, each glass is now facing down. I didn't work out a proof that it's optimal in the general case. That was really elegant.
    I slept a lot last night.

  • @ramunasstulga8264
    @ramunasstulga8264 7 วันที่ผ่านมา +1

    "Hey this is press Chalker" ahh captions 😭😭😭🙏

  • @corvididaecorax2991
    @corvididaecorax2991 3 หลายเดือนก่อน +6

    The way I though about it is that for the glass to end upside down it needs to be inverted an odd number of times. Most likely the same number of times for each glass given the scenario. So the total inversions is going to be an odd multiple of the number of glasses. For an even number of glasses n-1 is odd, and the least common multiple is n(n-1) which will always be an odd multiple. For an odd number of glasses n-1 is even, so there will never be an odd multiple of n that matches with multiples of n-1.

    • @holgerchristiansen4003
      @holgerchristiansen4003 3 หลายเดือนก่อน +1

      I don't really understand your logic here. n(n-1) will NEVER be odd, no matter what n is, since either n or n-1 has to be even.

    • @corvididaecorax2991
      @corvididaecorax2991 3 หลายเดือนก่อน

      @@holgerchristiansen4003
      n(n-1) is even, but if n is even it is an odd multiple of n. That meaning it is n times an odd number.

  • @widggman
    @widggman 3 หลายเดือนก่อน +1

    I went with an inverted gray code where a link between two nodes exists if there's one glass in common. This gives a 4 dimensional cube and the shortest path between the starting point and the desired result can only be reached in 4 steps.

  • @Cappello_M
    @Cappello_M 3 หลายเดือนก่อน +4

    It's even simpler than that: for every move, you flip n-1 cups, which means it's n-1modn cups flipped. When it'll be 0, it'll be the answer, and since n-1modn=-1modn, to get 0 mod n, or -nmodn, you'd have to make n moves.

    • @cwldoc4958
      @cwldoc4958 2 หลายเดือนก่อน +1

      Then why doesn't that hold for odd values of n?

    • @Cappello_M
      @Cappello_M 2 หลายเดือนก่อน +1

      @@cwldoc4958 You're right! The reason why it doesn't hold is the fact that if you have an odd number of non inverted cups and you flip an even number of them at a time, no matter how many moves you'll make it won't work. Simply put 2nmod3≠0 4nmod5≠0 for every n because 2n, 4n, 6n, etc. are 2k, while 3,5,7, etc. are 2k+1

  • @rhoadster91
    @rhoadster91 10 วันที่ผ่านมา

    I solved this problem by breaking it down into two problems:
    Instead of thinking of inverting n-1 glasses, think of it as two steps to be performed at each turn:
    1. Invert only 1 glass in a turn
    2. At the end of the turn invert all glasses
    Forgetting about step 2 for now, if you can invert only one glass at a time it is obvious that you need a minimum of n moves to invert all n glasses, regardless of n being even or odd.
    Now for step 2:
    Inverting all glasses an even number of times is equivalent to not inverting anything at all. This explains why it works for n when n is even: effectively only one inversion takes place from step 1 and zero inversions from step 2.
    Inverting all glasses an odd number of times is equivalent to inverting all the glasses just once. So if n is odd, you will have two effective inversions: one from step 1 and one from step 2, so in the end you'll have returned to the initial state. You cannot perform step 1 even number of times because there is an odd number of glasses.

  • @Fgarber1
    @Fgarber1 2 หลายเดือนก่อน +1

    I was not as interested in the general case where for n glasses, move n-1 glasses. But I was interested in the AI answers. What mistake of logic did the AI make that it couldn't figure this out? Presh proved it in a brute force way: he considered all possible moves and discarded the ones that did not take him closer to the goal. What elegance caused the AI to "hallucinate."

  • @heldercomp
    @heldercomp 3 หลายเดือนก่อน +2

    Each glass must be inverted at least 3 times, since if one glass is inverted only once, the other three will be in an infinite loop, and 2 inversions don’t put a glass upside down.
    If each glass is inverted 3 times, the least number of moves must be 4.

  • @robinlindgren6429
    @robinlindgren6429 3 หลายเดือนก่อน

    for the purposes of notation, lets encode the glasses as a 1 if it is right side up and 0 if it is upside down, as such, the 4 glasses can be encoded as (1111)
    for the 4 glasses, for all 4 glasses to end up flipped that means every glass must be flipped an odd number of times, therefore the total number of times a glass is flipped must be some odd number multiplied by 4.
    we also know that in each move exactly 3 glasses are flipped, so for m moves we have 3m flips, and this must equal a (k+1)*4 total number of flips, therefore:
    3m=(2k+1)*4
    m=(2k+1)*4/3
    lets test inserting some small odd numbers into the (2k+1) part of this equation.
    k=0 : m=4/3 m needs to be a whole number so this isn't a solution.
    k=1 : m=4
    thus, the smallest number of moves we can make that theoretically could produce a solution is 4 moves. is there such a solution?
    yes, as such:
    1111
    flip all except the 1st
    1000
    flip all except the 2nd
    0011
    flip all except the 3rd
    1110
    flip all except the 4th
    0000
    done.
    thus we have proven a solution for 4 moves and we have shown that no shorter solution exists.
    now, how about the general case? we have n glasses and we flip n-1 glasses each time.
    obviously it's impossible for 1 glass, since each move flips 0 glasses, so the state of the board so to speak never changes.
    obviously it is possible for 2 glasses, since each move flips 1 glass, just flip each glass in it's own move.
    for 3 glasses it's slightly more tricky but still easy to see that we need to make, in total, an odd number of flips, but each move makes an even number of flips, so we can never get an odd total number of flips and it is therefore impossible. this logic can be extended to all odd number of glasses and they are therefore all impossible.
    for even numbers of glasses we can always trivially do it by making n moves: for each glass, make a move that flips all except for that glass. this strategy always solves for an even number of glasses because every glass gets flipped once for every other glass, and since there is an odd number of "other glasses", every glass gets flipped an odd number of times.
    but can we do better?
    lets explore what the minimum number of moves needs to be similarly to what we did for 4 glasses, our new and more general equation is (where 2n is our even number of glasses):
    (2n-1)*m = (2k+1)*2n
    m = (2k+1)*2n/(2n-1)
    2n/(2n-1) is an interesting fraction. by definition x and x-1 are co-prime, therefore 2n and 2n-1 are also co-prime, this tells us that the fraction 2n/(2n-1) is as simplified as it gets.
    therefore (2k+1)*2n/(2n-1) is only ever a whole number if (2k+1)/(2n-1) is a whole number. the smallest whole number that this can make is 1, when k=n-1, and what does that get us?
    substitute k=n-1
    m = (2(n-1)+1)*2n/(2n-1)
    m = (2n-2+1)*2n/(2n-1)
    m = (2n-1)*2n/(2n-1)
    m = 2n
    and since 2n was what we defined as our even number of glasses, we have now proven that the minimum number of moves is the same as the number of glasses, and we have already proposed a strategy for how to solve even-numbered glass puzzles with that number of moves, therefore we have completed the general puzzle.

  • @dustinbachstein3729
    @dustinbachstein3729 3 หลายเดือนก่อน +2

    Nice ltl problem. There's a simpler solution (for me at least) whicch can be done w/o paper:
    The game is equivalent to inverting all glasses and then re-inverting 1 glass, which together counts as one move. This, in return, is equivalent to the following game:
    - Just invert 1 glass per move.
    -The game can be won in 2 ways:
    (A) after an odd number of moves, all glasses are normal OR
    (b) after an even number of moves, all glasses are inverted.
    For parity reasons, (a) is impossible to achieve, while (b) is possible exactly if n is even, with n trivial moves to make.

    • @globglogabgalabyeast6611
      @globglogabgalabyeast6611 3 หลายเดือนก่อน +1

      I did it similarly. Once you know that (a) is impossible, you can consider (b) as a sequence of 2 moves. 2 moves either flip all the same glasses (and are consequently useless), or they differ by 1 glass, the net result being flipping 2 glasses. Knowing that you can flip 0 or 2 glasses with 2 moves pretty easily shows the minimum is n moves

  • @DeepFriedLiver
    @DeepFriedLiver 7 วันที่ผ่านมา

    I got to step 2 and realized it’s so easy with the right insight. Every turn inverts all but 1 glass. 3 inversions will result in an inverted cup. So do 4 turns with each glass excluded. Order doesn’t matter. Each glass will get inverted 3 times. Done!

  • @malmiteria
    @malmiteria หลายเดือนก่อน +1

    there's a much simpler solution: count glass flips.
    in total, you'd have a multiple of n-1 glass flips, because that's how many you flip at each moves, and you'd have a multiple of n, because there's n glasses.
    n and n - 1 being coprime, there's gonna be a minimum total of n(n-1) glass flips (the lowest common denominator or whatever it's called).
    since a move flips n-1 glasses, n move flips n(n-1) glasses, so n moves is the minimal amount.
    For numbers n that can or can't flip all glasses, count glass flips again.
    If there is a solution, then there is a solution that takes n(n--1) flips, we just proved that
    You can rearrange those flips in each moves as: flip all glasses, then "undo" one flip, to get your n-1 moves
    Now, a n move solution can be seen as flipping all glasses n times first, then dealing with the undoing of one flip.
    To get all glasses in the same up or down state, you have no choice but to spread those "undo" accross all glasses, meaning they all unflip once.
    Meaning in total, each glass flipped n-1 times.
    this means they're up if n-1 is even, so if n is odd, and down if n is even.
    so the solution actually only works when n is even.

    • @AndrijGhorbunov
      @AndrijGhorbunov 10 วันที่ผ่านมา

      this rests on the assumption that each glass will have the same number of flips in total (thus a multiple of n). But it doesn't exclude the option where one glass has 1 flip and another has 3, for example

  • @quocdainguyen9519
    @quocdainguyen9519 3 หลายเดือนก่อน +1

    For n is an even number: -> n-1 is an odd number.
    Each cup needs to be flipped an odd number of times (NBoT). You can only flip (n-1) cup at a time so there’s aways 1 cup unflipped.
    Each cup can only remain unflipped once otherwise you repeat a previous step ( which makes it not the fastest solution ).
    If number of step (s) < n then there are away 2 cups: cup A get flipped (s) times and cup B get flipped (s-1) times, which can’t be true since between two numbers (s) and (s-1) there’s an even number. Each cup can only be flipped an odd number of times so s must be = n (each cup gets flipped exactly n-1 times).

  • @konchady1
    @konchady1 3 หลายเดือนก่อน

    Nice question on parities and xors. If you encode glass up as a 0 and glass down as a 1, you are basically asking how to get 1111 from 0000 by xoring with only 0111,1110,1101 and 1011. Notice that there are only 4 and you need to use each one exactly once to get the result. If you use two sequences at any time, that would be a redundancy as they cancel. This can be generalized to any even n as well.

    • @user-kc4ic2qp8p
      @user-kc4ic2qp8p 2 หลายเดือนก่อน

      That's how I did it as well.

  • @danielreed5199
    @danielreed5199 3 หลายเดือนก่อน +2

    I did it in one move, I just wore 3 pairs of glasses upside down. Now everything is inverted.. please help!

  • @KingSyilver
    @KingSyilver 13 วันที่ผ่านมา

    Thanks for making me feel smart! That was refreshingly easy

  • @Doombacon
    @Doombacon 20 วันที่ผ่านมา

    there is a similar puzzle in the video game 'path of exile' to which the easy to remember answer is to 'click each pillar once' which translates in this case to avoid inverting any given glass each once

  • @nikolaimikuszeit3204
    @nikolaimikuszeit3204 3 หลายเดือนก่อน +1

    Isn't inverting three just the symmetry to inverting one ( + changing you point of view)?

  • @christophernguyen1750
    @christophernguyen1750 6 วันที่ผ่านมา

    The way I always saw this problem was like a least common multiple thing. There are four cups and three inversions per move. We know that we can’t flip all four cups in three inversions (one move) and if we tried to do it in two moves, we could flip the four but would be left with 2 remaining flips. So the problem is more finding out how many sets of 3 can fit into a number that’s also factorable by 4 cups. In other words, the number 12 is the least common multiple that shares the factors of 3 and 4. And it takes exactly 4 sets of three inversions to get to 12. Let’s prove it.
    Imagine instead of directly inverting the glasses after each move, we save up the inversions. It doesn’t matter the order we do them, as long as we keep track of how many moves and inversions we need to do.
    1st move = 3 inversions
    2nd move = 6 inversions
    3rd move = 9 inversions
    4th move = 12 inversions
    On the fourth move, we have 12 inversions we need to perform which is great because the 4 cups divide evenly into the 12 inversions. So we can flip the 4 cups down (getting rid of 4 inversions and having 8 left) flip all 4 up (getting rid of another 4 inversions and having 4 left to do) and flip all 4 down again (getting rid of the last 4 inversions out of the 12 we need to do and solving the problem)

  • @sionaa.5038
    @sionaa.5038 25 วันที่ผ่านมา +1

    This was easy. Just go from one glass to the next when inverting the triple. Go from one glass to the next when starting the triple.

  • @Hantaboy20
    @Hantaboy20 17 วันที่ผ่านมา

    Because of the flaws (and lacks) of the rules its possible to make it in 2 steps.
    The rules are not say you cannot move the glasses or replace their position with others. And the rules does not state what is meant to be "different". Therefore we can say "different" could be mean the original position of the glass in the step.
    So you move the first N-1 glasses in the first step, then move the move the next step comes the magic:
    V1 (swapping): N'th glass flipped, then swapped with position of N-1, then N-1 flipped, and swapped with N-2 and so on until you reach the desired all face down position.
    V2 (moving 1st glass to the end): N'th glass flipped, then the 1st position glass moved to the end. Than N-1 flipped, and 1st glass moved to the end, and so on...
    This solution make it possible to make the puzzle regardless of N is odd or even.
    If you say that is not allowed, than please show me where it was written in the rules :)

  • @cmilkau
    @cmilkau 2 หลายเดือนก่อน

    Define the following mapping:
    When the number of inverted glasses is even, replace each upright glass by 0 and each inverted glass by 1. If it is odd, replace each upright glass by 1 and each inverted glass by 0. Observe this mapping is bijective. Observe that inverting 3 glasses flips exactly the digit corresponding to the glass that was not inverted (we constructed it that way). Also, the initial configuration is 0000 and the final configuration is 1111. The minimum number of moves is their Hamming distance as each move flips exactly one digit. So the minimum number of moves is 4 and it is obtained by any sequence that omits each glass exactly once from inverting, so every glass is inverted exactly 3 times (corresponding to flipping each of the digits exactly once).
    Note that this works for any even n. For odd n, the task is actually impossible: every move then inverts an even number of glasses. But this means the number of inverted glasses always remains even.

  • @RaindropsBleeding
    @RaindropsBleeding 17 วันที่ผ่านมา

    This one looks complicated but is so simple and easy it's almost insulting. for any even number 'n' glasses, when inverting (n-1) glasses per move, the minimum number to invert all glasses is always 'n' moves. this is because inverting (n-1) glasses always leaves 1 glass un-inverted, so inverting (n-1) glasses optimally will leave 1 more glass each move un-inverted, therefore after (n-1) moves there will be (n-1) glasses left to invert, allowing the final nth move to invert the remaining glasses. There is no solution for odd number 'n' because optimal moves will result in an even number of inverted glasses after each move. inverting an odd number of glasses plus one of the opposite orientation will still result in an even number inverted because one of the larger group will cancel one from the smaller group.

  • @samuelhart7106
    @samuelhart7106 3 หลายเดือนก่อน +2

    Aside from giving the wrong answer, Google Bard’s base case makes no sense because for one glass you are allowed to invert 0 glasses each turn.

  • @GigaDavy91
    @GigaDavy91 9 วันที่ผ่านมา

    I did a statr diagram by rapresenting each state with two numbers (the number of up and down glasses) you can easily see that you have only 5 possible states (4-0, 1-3, 2-2, 3-1, 0-4) for 4 glasses turning 3 at the time, and the shortest path is 4 moves.
    I also solved it as others did by considering turning n-1 glasses the same as turning one glasses and then turning all glasses, it is impossible for 5 numbers because the number of times you turn all the glasses is always odd, so if you try to go towards the solution you will end up with the solution but with all glasses turned up an not down (aka the initial state).
    Also you can see by trying to draw the state diagram that starting with 5 glasses, being able of turning only 4 of them at the time you will get only 3 possible states (5-0, 1-4, 3-2) from 3-2 you can only go towards 1-4, and from 5-0 you can go only towards 1-4

  • @sleepib
    @sleepib 8 วันที่ผ่านมา

    Each move after the first you have the choice of undoing an earlier move, or picking a subset you haven't picked before. You pick one glass to stay the same each move, and when each glass has had one turn at that the puzzle is solved.
    Number of steps is N, and it works for even numbered of glasses, because odd numbers of glasses will result in the starting condition after each glass is flipped n-1 times.

  • @tristanmitchell1242
    @tristanmitchell1242 2 หลายเดือนก่อน +1

    Label the glasses, from left to right, with sequencial letters A through D. Describe each move as the letter of the glass that is NOT moved. Any solution that uses all four letters an equal number of odd times is thus correct, with the simplest solution being each letter used once.

  • @cwldoc4958
    @cwldoc4958 2 หลายเดือนก่อน

    The case of n wine glasses: Starting with n wine glasses upright, inverting (n - 1) at a time, is it possible to reach a state in which all the glasses are upside down, and if so, what is the minimum number of inversions necessary to reach that state?
    Each inversion consists of inverting all the glasses except for one. In each inversion, the glass that is not inverted is either among the upright glasses or the upside-down glasses. Let f denote the act of inverting all the glasses except for one which is upright, and let g denote the act of inverting all glasses except for one which is upside down.
    Mathematically, let f(k) = the number of glasses that are upright after applying f to a state where k glasses are upright, for 1

  • @sabinrawr
    @sabinrawr 3 หลายเดือนก่อน +1

    Waaay back in first grade, we were taught (and made to understand why) then when it comes to Odd and Even numbers, if you add two from any category, the answer is Even. When you add two from different categories, the answer is Odd. We could help remember this because odd means weird and different in non-math context, so if we want an Odd answer, we need two different types of numbers. But Even is balanced and same-like, so any two numbers from the same category (O+O or E+E = E). For this puzzle, it follows that you can't make an Odd number if your only operands are Even. Q.E.D. for the case n=Odd.
    For the n=Even case, I know that it CAN be done in any case. One possible solution that works for every Even n is that you flip all but the first glass, then invert all but the second, and on down the line. It is not hard to show that this always works, and will always succeed in n moves (each glass is omitted exactly once, so moves=glasses). It is intuitive for me to see that this is also the minimum solution, but I do not know how to prove it rigorously. I'm watching the rest of the video now.

  • @zombeebear30
    @zombeebear30 6 วันที่ผ่านมา

    Here’s my quick thought on it:
    In the four glass example, you start by flipping to 3 down and 1 up, then 2 down and 2 up, then finally, 1 down and 3 up so that you can flip the 3 remaining glasses. That would mean that the amount of moves you need is n (the amount of glasses)

  • @azai.mp4
    @azai.mp4 2 หลายเดือนก่อน

    And in the even more general case, if you have n glasses and every move flips exactly k of them, then (spoiler alert) it's possible to flip all the glasses if and only if k2 and U

  • @teambellavsteamalice
    @teambellavsteamalice 3 หลายเดือนก่อน +2

    It can be proven a bit quicker and simpler.
    First consider each step a combination of two transformations. One flips every glass, the other flips one glass.
    If there is an even number of glasses n, each step is an odd number of flips.
    Having all flipped (an even total number of flips) you need an even number of steps.
    If n is even the transformations of flipping all glasses cancel out, simplifying the problem to a transformation of a single flip
    So you need to flip n glasses, one at a time. Not flipping the same glass twice results in the minimum of n steps.
    For n is odd you have a problem.
    Using an even number of steps you have the same cancelling but can only flip an even number of glasses.
    Using an odd number of steps you have one flip all part that doesn't cancel out. In addition you have an odd number of flips and flips back so you can't make them cancel out.

  • @shubhamagarwal9459
    @shubhamagarwal9459 6 วันที่ผ่านมา

    happy i was actually able to solve this one

  • @Zicrus
    @Zicrus 2 หลายเดือนก่อน +1

    Step one can easily be checked, as the solution said:
    Without loss of generality, move one and two has to flip 1, 2, 3 and 2, 3, 4, respectively, to not end up in the starting position. After reaching this position, it is obviously not possible to have all glasses flipped after the third move.
    (This would be good enough for Olympiad standards, no need to tediously explain every possible move at every step)

  • @kingdunlap741
    @kingdunlap741 2 หลายเดือนก่อน

    Interesting thing about odds, if the amt of glasses that need to be moved is oddN -2.. is the solution always 3 moves?

  • @januszbogumil
    @januszbogumil หลายเดือนก่อน +1

    chatgpt can't do basic arithmetic without a chance of making errors so I wouldn't ask chatgpt for help with math or logic problems.
    and the reason for that is that chatgpt is it's basically an advanced text predictor. So when it appears to do math it's not actually doing any math but predicting text.

  • @xxghost_preyxx
    @xxghost_preyxx หลายเดือนก่อน

    The way I thought this through was if all but one gets inverted each time, you could think of it the same as only one getting inverted each time, so you just go in a line to invert each one, therefore minimum = n. Then you also have to remember that each one must be inverted an odd number of times so the answer only works for an even n.

  • @PitchWheel
    @PitchWheel 3 หลายเดือนก่อน +4

    This looks like incrementing numbers in mod 2 and would be interesting to see what it would happen for other modules

  • @LucianDevine
    @LucianDevine 24 วันที่ผ่านมา

    Posting before watching. After having done a few test examples, my guess is that the initial answer is 4. It can only be completed when N is an even number, and the minimum number of moves each time will be equal to N.

  • @simonegaratti2399
    @simonegaratti2399 3 หลายเดือนก่อน

    Nice!

  • @bigolbearthejammydodger6527
    @bigolbearthejammydodger6527 3 หลายเดือนก่อน

    this is a really great puzzle
    I remember solving this when i was a teen - as part of comp sci A-lvl - its an example of heuristic hill climbing algorithm (an algorithm that looks ahead x steps to a better solution to find a final solution) - this sort of algorithm was used in early chess AI (and most modern AI pathing in modern video games)
    Seems Im getting old though (now 45) because I couldn't for the life of me solve it now - and had to watch the vid. (yes it was the proof bit i struggled with, not mentally flipping glasses).
    Interestingly its also the same problem(well very related) as the old board game 'mastermind' also the 'lights out' puzzle (a 2d version, rather than 1d) - something I used to happily solve in my head in fast time due to it being part of a puzzle in the video game Dungeons and dragons online as part of a raid.
    yep.. DEFINITELY getting old, my brain has slowed down so much.

  • @Zenfyre1
    @Zenfyre1 2 หลายเดือนก่อน

    This problem is a binary problem where the cups are either up or down. You can only change the state of N-1 or basically all but 1 each time. You can easily infer that the final step of the problem will need 1 cup facing down and the other remaining N-1 cups facing up so that you flip exactly all cups that are facing up to down. Since you're flipping all but 1 cup each time, basically only all but one cup change state each move. In order to achieve the state just before the final move you need to basically flip all the cups N-1 times. So the amount of moves necessary to flip all the cups facing down is equal to N moves. This solution is impossible for the situation where there's only 1 cup, or N = 1, since you aren't allowed to flip any cups at all for that scenario.

  • @alexeisenhauer5874
    @alexeisenhauer5874 3 หลายเดือนก่อน

    polyrhythms in music made this pretty easy to figure out

  • @GamingForeverEpic
    @GamingForeverEpic 2 หลายเดือนก่อน +6

    Smash one of the glasses so there’s one less glass to worry about

  • @klh6729
    @klh6729 13 วันที่ผ่านมา

    Let me simplify this even further:
    Label each glass #1 thru #4
    Invert glass #1 only, then invert the image of the 4 glasses. It is essentially the same as inverting the other 3 glasses.
    Invert glass #2 only, then invert the image of the 4 glasses.
    Invert glass #3 only, then invert the image of the 4 glasses.
    Invert glass #4 only, then invert the image of the 4 glasses.

  • @mavriksc
    @mavriksc 3 หลายเดือนก่อน +1

    since 1 and n-1 are just opposites. you can select 1 cup to not flip. the sequence for solving is just selecting each cup in order from one end to the other to not be flipped. in the n is odd case. you can get everything but the last glass. and any other change is further away.

    • @sciphyskyguy4337
      @sciphyskyguy4337 3 หลายเดือนก่อน

      This was my technique as well.
      If the rule had been “flip one cup per move”, you would obviously just do that rule once for each cup.
      Based on parity, this is equivalent to your solution, basically “flip the complementary set of each cup”, which achieves the same end.

  • @cparks1000000
    @cparks1000000 13 วันที่ผ่านมา

    Proving there is no solution in the odd case is easy using modular arithmetic. To get the glasses flipped down, you must flip each glass 1 time modulo 2 (ie an odd number of flips). Since you must flip an odd number of glasses, the total number of flips is 1*1 = 1 modulo 2. On the other hand, each flip changes an even number of glasses. QED.

  • @MikkoRantalainen
    @MikkoRantalainen 5 วันที่ผ่านมา

    I thought that the generic case would have been "given n glasses, how many moves you need to invert all glasses when you have to invert exactly 3 separate glasses each move"? That's more interesting task than always inverting n-1 glasses.
    Another way to think about the task is to represent initial state with bit mask 0000 (in generic case n bits) and then repeatedly apply additional masks with XOR operation where every mask must have exactly k bits set to 1 and the task is to get final result 1111 (in generic case n bits).

  • @aaronmartens2903
    @aaronmartens2903 หลายเดือนก่อน

    Label the glasses 1,2,...,n. Label (1),(2),...,(n) the glass flips that flip all but 1,2,...,n, respectively. For example (2) would flip all glasses except for 2. Note that any glass flip applied twice results in no net action. Our objective is a sequence of flips that results in all glasses flipped. The insight is that the glasses get flipped once more if they're corresponding glass flip is not part of the sequence. For instance let n=5. The sequence of glass flips (1)(2)(3) flips glasses 1,2,3 twice and glasses 4 and 5 3 times. This implies the only possible solution is to apply all flips so everything is flipped the same number of times. When n is odd this solution flips everything an odd number of times resulting in the objective; when n is even this sequence gives us all glasses flipped the wrong way.

  • @Webberjo
    @Webberjo 7 วันที่ผ่านมา

    Would it be correct in saying that it takes as many moves as there are glasses?

  • @nelisvolschenk1774
    @nelisvolschenk1774 3 หลายเดือนก่อน

    A nice graphical way of solving this is to arrange the glasses in a circle and then flip n-1 glasses at a time, while shifting the group one spot each time. That way after n operations all the glasses get flipped n-1 times( which is odd) and thus all the glasses will be flipped over

  • @williamlennie
    @williamlennie 2 หลายเดือนก่อน

    It may be checked is a perfectly reasonable justification for the minimum. There’s only 3 cases to check: 1, 2, or 3 moves. 1 and 2 moves are trivial, so really only three moves needs checking.because the order of the glasses doesn’t matter there’s only about 4 sequences of flips that need checking.

  • @hrayrbarseghyan5453
    @hrayrbarseghyan5453 3 หลายเดือนก่อน +1

    I thought of it as if you are inverting 1 glass, and then keeping state of is everything inverted or not. So for even n-s solution is exactly steps, and for odd ones it does not exist.

  • @WarmWeatherGuy
    @WarmWeatherGuy 3 หลายเดือนก่อน

    This reminded me of puzzles in The 7th Guest.

  • @HarshColby
    @HarshColby 3 หลายเดือนก่อน

    I figured that on each move you're changing the arrangement by exactly one glass. You can ignore that the arrangement is flipped because every two moves will flip the arrangement twice. So if you have n glasses, it must take n moves, if it's possible at all.

  • @bishopoftheteagods7393
    @bishopoftheteagods7393 2 หลายเดือนก่อน

    Each glass has to be inverted an odd number of times. The total number of inversions must be a multiple of 3, since we must do 3 inversions per ‘turn’. The simplest way to get this result is 3+3+3+3=12. That means we hope to be able to do this in 4 ‘turns’. If we exclude one cup each time, each cup will be affected in 3 of the 4 turns, solving the puzzle.

  • @lecuradu
    @lecuradu 2 หลายเดือนก่อน

    You can simplify the problem as how many glasses turn every 2 moves and that is always true whatever glasses you choose.
    So for even numbers it is easy. You end up with 2 after 2 moves, 4 after 4 moves and n after n moves.
    For odd number you always turn even number of glasses. Which ensures alway an odd number of glasses remain up no matter what. Since 0 is even (you need to get to 0 glasses up) it is impossible to get there

  • @jort93z
    @jort93z 19 วันที่ผ่านมา

    Order doesn't matter, so i sorted them for convienence. Reaching a previous state isn't beneficial in any case, as you'd just be going in circles, so those options being discarded.
    So at the start you only have one option, make it 1000(0 being inverted). Then you again only have one move that doesn't return to the previous state, making it 1100. You again only have one option, reaching 1110. And the next move you win.

  • @escthedark3709
    @escthedark3709 หลายเดือนก่อน

    Inverting all but one glass is basically the same as inverting just one and then pretending to flip the whole setup upside down. If you make two moves, you've pretended to flip the whole thing upside down twice, so for even numbers of moves, you can just turn two glasses and it will be the same as having turned all but one twice.
    Therefore, for n glasses, where n is even, n moves is the minimum number of moves and each glass gets one turn where it's not flipped.

  • @SaltyMaud
    @SaltyMaud 7 วันที่ผ่านมา +1

    n if n is even, impossible if n is odd. Claude 3 gets there without help, but it takes a couple attempts to get it right.

  • @stevezagieboylo9172
    @stevezagieboylo9172 2 หลายเดือนก่อน

    For N where N is even, there's an easier way to show that N moves are required.
    Step 1: Show that the number of moves will always be an even number, using the same sort of parity argument used to show that an odd N is impossible.
    Step 2: Now that we know the number of moves will certainly be even, consider moves in pairs. A pair of moves can have only 2 outcomes. Either it leaves the pattern unchanged (because you did the same move twice, or exactly two glasses have been inverted, because all but two glasses were inverted and then inverted back. Obviously, to make two moves but leaving the pattern unchanged is just a waste of moves, so we need only consider the second choice.
    Step 3. In order to invert all the glasses, you need N/2 pairs of moves, or 2 * N/2 = N.

  • @icarus877
    @icarus877 28 วันที่ผ่านมา

    Solved the problem in 2 seconds flat, invert one glass three times in the first set and the final three in the second.

  • @McGeistly
    @McGeistly 16 วันที่ผ่านมา

    You can brute force this as well by continuing to alternate which glass you turn over each turn by moving over to the next glass to the right. On the last turn you will see which three to turn over. Brute force method takes 11 turns.

  • @miltonthecat2240
    @miltonthecat2240 3 หลายเดือนก่อน

    Define a "glass-flip" as flipping a single glass. To end up with all N glasses flipped, a total of N x J glass-flips are required, where J is an odd positive integer. We are constrained to always flip N-1 glasses with each move; we'll do this in K moves, where K is a positive integer. We have a solution when N x J = (N-1) x K. Now it's just a matter of solving the equations, no need to visualize permutations of flipping glasses anymore.

  • @lastnamefirstname8655
    @lastnamefirstname8655 หลายเดือนก่อน

    great proof!