Four buttons on a tableColor the Table16 Buttons, Turn them all Red or Green?Table tennis tournamentFour cups...

I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?

It beats the alternative

School performs periodic password audits. Is my password compromised?

Why won't the strings command stop?

How do you say "powers of ten"?

Are paired adjectives bad style?

Should we avoid writing fiction about historical events without extensive research?

What is this waxed root vegetable?

Sometimes a banana is just a banana

Borrowing Characters

Six real numbers so that product of any five is the sixth one

The need of reserving one's ability in job interviews

I can't die. Who am I?

How can I handle a player who pre-plans arguments about my rulings on RAW?

Pure Functions: Does "No Side Effects" Imply "Always Same Output, Given Same Input"?

How to substitute values from a list into a function?

How to kill a localhost:8080

What type of investment is best suited for a 1-year investment on a down payment?

What are the issues with an additional (limited) concentration slot instead of Bladesong?

What is a term for a function that when called repeatedly, has the same effect as calling once?

Where is the line between being obedient and getting bullied by a boss?

Is divide-by-zero a security vulnerability?

Why can't we make a perpetual motion machine by using a magnet to pull up a piece of metal, then letting it fall back down?

Misplaced tyre lever - alternatives?



Four buttons on a table


Color the Table16 Buttons, Turn them all Red or Green?Table tennis tournamentFour cups on a tableFour-by-four table with equal row and column productsRed cells in a 4x4 tableA Strange Box of ButtonsA line in Connect FourThe round tableFour coins on the corner of a rotating rectangular table













4












$begingroup$


I was asked lately (in an interview) to solve this puzzle, which is similar to the 4 cups on table puzzle.



In a certain room there is a rotating round table, with 4 symmetrically located indistinguishable buttons. Each button can be either ”on” or ”off”, however one cannot
tell its the current state by its appearance. The room is lighted if and only if all the buttons are all ”on”, and there is nobody inside.



• A person is (repeatedly) allowed to enter the room, and press whichever buttons
she likes. After she steps out, she is told whether she succeeded to put the light
on. At the same time, a table rotates in an unknown manner.



The goal is:
to design a deterministic strategy to put the light on, no matter what is the initial state of the buttons.



As a bonus I was given:
The same above but with: $$n = 2^k$$ symmetrically (with respect to rotation) located buttons.










share|improve this question







New contributor




Jay Mar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$












  • $begingroup$
    You don't know if the state is "on" or "off" but can you feel the difference between the two positions? Like a lever that could be on the right or on the left (you don't know if "right=on" or "right=off" but you can surely make a difference between right and left)?
    $endgroup$
    – Arnaud Mortier
    1 hour ago










  • $begingroup$
    @ArnaudMortier I think that not being able to feel "on" and "off" is the essential difference between this and the four cups on a table puzzle. Otherwise, they're the same, right?
    $endgroup$
    – hexomino
    1 hour ago










  • $begingroup$
    @hexomino I don't know, in the version I know you can touch only two cups per turn.
    $endgroup$
    – Arnaud Mortier
    55 mins ago












  • $begingroup$
    @ArnaudMortier Ah yes, I forgot that part.
    $endgroup$
    – hexomino
    52 mins ago
















4












$begingroup$


I was asked lately (in an interview) to solve this puzzle, which is similar to the 4 cups on table puzzle.



In a certain room there is a rotating round table, with 4 symmetrically located indistinguishable buttons. Each button can be either ”on” or ”off”, however one cannot
tell its the current state by its appearance. The room is lighted if and only if all the buttons are all ”on”, and there is nobody inside.



• A person is (repeatedly) allowed to enter the room, and press whichever buttons
she likes. After she steps out, she is told whether she succeeded to put the light
on. At the same time, a table rotates in an unknown manner.



The goal is:
to design a deterministic strategy to put the light on, no matter what is the initial state of the buttons.



As a bonus I was given:
The same above but with: $$n = 2^k$$ symmetrically (with respect to rotation) located buttons.










share|improve this question







New contributor




Jay Mar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$












  • $begingroup$
    You don't know if the state is "on" or "off" but can you feel the difference between the two positions? Like a lever that could be on the right or on the left (you don't know if "right=on" or "right=off" but you can surely make a difference between right and left)?
    $endgroup$
    – Arnaud Mortier
    1 hour ago










  • $begingroup$
    @ArnaudMortier I think that not being able to feel "on" and "off" is the essential difference between this and the four cups on a table puzzle. Otherwise, they're the same, right?
    $endgroup$
    – hexomino
    1 hour ago










  • $begingroup$
    @hexomino I don't know, in the version I know you can touch only two cups per turn.
    $endgroup$
    – Arnaud Mortier
    55 mins ago












  • $begingroup$
    @ArnaudMortier Ah yes, I forgot that part.
    $endgroup$
    – hexomino
    52 mins ago














4












4








4





$begingroup$


I was asked lately (in an interview) to solve this puzzle, which is similar to the 4 cups on table puzzle.



In a certain room there is a rotating round table, with 4 symmetrically located indistinguishable buttons. Each button can be either ”on” or ”off”, however one cannot
tell its the current state by its appearance. The room is lighted if and only if all the buttons are all ”on”, and there is nobody inside.



• A person is (repeatedly) allowed to enter the room, and press whichever buttons
she likes. After she steps out, she is told whether she succeeded to put the light
on. At the same time, a table rotates in an unknown manner.



The goal is:
to design a deterministic strategy to put the light on, no matter what is the initial state of the buttons.



As a bonus I was given:
The same above but with: $$n = 2^k$$ symmetrically (with respect to rotation) located buttons.










share|improve this question







New contributor




Jay Mar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




I was asked lately (in an interview) to solve this puzzle, which is similar to the 4 cups on table puzzle.



In a certain room there is a rotating round table, with 4 symmetrically located indistinguishable buttons. Each button can be either ”on” or ”off”, however one cannot
tell its the current state by its appearance. The room is lighted if and only if all the buttons are all ”on”, and there is nobody inside.



• A person is (repeatedly) allowed to enter the room, and press whichever buttons
she likes. After she steps out, she is told whether she succeeded to put the light
on. At the same time, a table rotates in an unknown manner.



The goal is:
to design a deterministic strategy to put the light on, no matter what is the initial state of the buttons.



As a bonus I was given:
The same above but with: $$n = 2^k$$ symmetrically (with respect to rotation) located buttons.







logical-deduction combinatorics proof-without-words






share|improve this question







New contributor




Jay Mar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Jay Mar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Jay Mar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 hours ago









Jay MarJay Mar

1211




1211




New contributor




Jay Mar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Jay Mar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Jay Mar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • $begingroup$
    You don't know if the state is "on" or "off" but can you feel the difference between the two positions? Like a lever that could be on the right or on the left (you don't know if "right=on" or "right=off" but you can surely make a difference between right and left)?
    $endgroup$
    – Arnaud Mortier
    1 hour ago










  • $begingroup$
    @ArnaudMortier I think that not being able to feel "on" and "off" is the essential difference between this and the four cups on a table puzzle. Otherwise, they're the same, right?
    $endgroup$
    – hexomino
    1 hour ago










  • $begingroup$
    @hexomino I don't know, in the version I know you can touch only two cups per turn.
    $endgroup$
    – Arnaud Mortier
    55 mins ago












  • $begingroup$
    @ArnaudMortier Ah yes, I forgot that part.
    $endgroup$
    – hexomino
    52 mins ago


















  • $begingroup$
    You don't know if the state is "on" or "off" but can you feel the difference between the two positions? Like a lever that could be on the right or on the left (you don't know if "right=on" or "right=off" but you can surely make a difference between right and left)?
    $endgroup$
    – Arnaud Mortier
    1 hour ago










  • $begingroup$
    @ArnaudMortier I think that not being able to feel "on" and "off" is the essential difference between this and the four cups on a table puzzle. Otherwise, they're the same, right?
    $endgroup$
    – hexomino
    1 hour ago










  • $begingroup$
    @hexomino I don't know, in the version I know you can touch only two cups per turn.
    $endgroup$
    – Arnaud Mortier
    55 mins ago












  • $begingroup$
    @ArnaudMortier Ah yes, I forgot that part.
    $endgroup$
    – hexomino
    52 mins ago
















$begingroup$
You don't know if the state is "on" or "off" but can you feel the difference between the two positions? Like a lever that could be on the right or on the left (you don't know if "right=on" or "right=off" but you can surely make a difference between right and left)?
$endgroup$
– Arnaud Mortier
1 hour ago




$begingroup$
You don't know if the state is "on" or "off" but can you feel the difference between the two positions? Like a lever that could be on the right or on the left (you don't know if "right=on" or "right=off" but you can surely make a difference between right and left)?
$endgroup$
– Arnaud Mortier
1 hour ago












$begingroup$
@ArnaudMortier I think that not being able to feel "on" and "off" is the essential difference between this and the four cups on a table puzzle. Otherwise, they're the same, right?
$endgroup$
– hexomino
1 hour ago




$begingroup$
@ArnaudMortier I think that not being able to feel "on" and "off" is the essential difference between this and the four cups on a table puzzle. Otherwise, they're the same, right?
$endgroup$
– hexomino
1 hour ago












$begingroup$
@hexomino I don't know, in the version I know you can touch only two cups per turn.
$endgroup$
– Arnaud Mortier
55 mins ago






$begingroup$
@hexomino I don't know, in the version I know you can touch only two cups per turn.
$endgroup$
– Arnaud Mortier
55 mins ago














$begingroup$
@ArnaudMortier Ah yes, I forgot that part.
$endgroup$
– hexomino
52 mins ago




$begingroup$
@ArnaudMortier Ah yes, I forgot that part.
$endgroup$
– hexomino
52 mins ago










2 Answers
2






active

oldest

votes


















5












$begingroup$

4-button method




Step 1 - Do not press any buttons, step out
Step 2 - Press all buttons, step out.

If the light is not turned on in either case then we know we are neither in the situation where are buttons are "on" or all lights are "off".

Step 3 - Press any pair of diagonally-opposite buttons, step out.
Step 4 - Press all buttons, step out

If the light is not turned on in either case then we know we are not in a situation where just two diagonally opposite buttons are "on". So now there is either one button "on", two adjacent buttons "on" or three buttons "on".

Step 5 - Press any two adjacent buttons, step out.
Step 6 - Press all buttons, step out.

If we had been in the case of two adjacent buttons and the light is not turned on in either step, we will have changed to the case where two diagonally opposite buttons are "on".

Step 7 - Repeat Step 3
Step 8 - Repeat Step 4

If the light is not on after either step then we must either be in the case where one button is "on" or three buttons are "on".

Step 9 - Press any three buttons, step out
Step 10 - Press all buttons, step out.

If the light has not turned on in either step then we must have now pivoted into a case where two buttons are "on" and two buttons are "off", so we can revert to the strategy we had in that case.

Steps 11 - 16 - Repeat Steps 3 - 8

The light must be turned on at one of these steps.







share|improve this answer









$endgroup$





















    1












    $begingroup$

    $n=2^k$ button method




    Represent the state of the buttons using an $n$-bit string. Then a sequence of moves is represented by a sequence of $n$-bit strings that we xor with the button states.


    Proceed by induction.


    If $k=0$, then one possible sequence is $(1)$.


    Suppose we have a sequence $(a_1,dots,a_m)$ for $n=2^k$ buttons.


    Let $(b_1,dots,b_m)$ be the sequence of $2n$-bit strings where $b_i$ is the result of adding a copy of each bit in $a_i$ after that bit (e.g., $01011rightarrow0011001111$).


    Let $(c_1,dots,c_m)$ be the sequence of $2n$-bit strings where $c_i$ is the result of adding a $0$ after each bit in $a_i$ (e.g., $01001rightarrow0010001010$).


    Then a sequence for $2n=2^{k+1}$ buttons is the $(m^2+2m)$-length sequence $$(b_1,dots,b_m,c_1,b_1,dots,b_m,c_2,dots,c_{m-1},b_1,dots,b_m,c_m,b_1,dots,b_m)$$ where $m+1$ copies of $(b_i)$ are interleaved with $(c_i)$.


    For example, if $(a_i)=(1)$ is a $1$-button sequence, then $(b_i)=(11)$, $(c_i)=(10)$, and $(11,10,11)$ is a $2$-button sequence, and similarly $$(1111,1100,1111,1010,1111,1100,1111,1000,1111,1100,1111,1010,1111,1100,1111)$$ is a $4$-button sequence.







    share|improve this answer









    $endgroup$













      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "559"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });






      Jay Mar is a new contributor. Be nice, and check out our Code of Conduct.










      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f80329%2ffour-buttons-on-a-table%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      5












      $begingroup$

      4-button method




      Step 1 - Do not press any buttons, step out
      Step 2 - Press all buttons, step out.

      If the light is not turned on in either case then we know we are neither in the situation where are buttons are "on" or all lights are "off".

      Step 3 - Press any pair of diagonally-opposite buttons, step out.
      Step 4 - Press all buttons, step out

      If the light is not turned on in either case then we know we are not in a situation where just two diagonally opposite buttons are "on". So now there is either one button "on", two adjacent buttons "on" or three buttons "on".

      Step 5 - Press any two adjacent buttons, step out.
      Step 6 - Press all buttons, step out.

      If we had been in the case of two adjacent buttons and the light is not turned on in either step, we will have changed to the case where two diagonally opposite buttons are "on".

      Step 7 - Repeat Step 3
      Step 8 - Repeat Step 4

      If the light is not on after either step then we must either be in the case where one button is "on" or three buttons are "on".

      Step 9 - Press any three buttons, step out
      Step 10 - Press all buttons, step out.

      If the light has not turned on in either step then we must have now pivoted into a case where two buttons are "on" and two buttons are "off", so we can revert to the strategy we had in that case.

      Steps 11 - 16 - Repeat Steps 3 - 8

      The light must be turned on at one of these steps.







      share|improve this answer









      $endgroup$


















        5












        $begingroup$

        4-button method




        Step 1 - Do not press any buttons, step out
        Step 2 - Press all buttons, step out.

        If the light is not turned on in either case then we know we are neither in the situation where are buttons are "on" or all lights are "off".

        Step 3 - Press any pair of diagonally-opposite buttons, step out.
        Step 4 - Press all buttons, step out

        If the light is not turned on in either case then we know we are not in a situation where just two diagonally opposite buttons are "on". So now there is either one button "on", two adjacent buttons "on" or three buttons "on".

        Step 5 - Press any two adjacent buttons, step out.
        Step 6 - Press all buttons, step out.

        If we had been in the case of two adjacent buttons and the light is not turned on in either step, we will have changed to the case where two diagonally opposite buttons are "on".

        Step 7 - Repeat Step 3
        Step 8 - Repeat Step 4

        If the light is not on after either step then we must either be in the case where one button is "on" or three buttons are "on".

        Step 9 - Press any three buttons, step out
        Step 10 - Press all buttons, step out.

        If the light has not turned on in either step then we must have now pivoted into a case where two buttons are "on" and two buttons are "off", so we can revert to the strategy we had in that case.

        Steps 11 - 16 - Repeat Steps 3 - 8

        The light must be turned on at one of these steps.







        share|improve this answer









        $endgroup$
















          5












          5








          5





          $begingroup$

          4-button method




          Step 1 - Do not press any buttons, step out
          Step 2 - Press all buttons, step out.

          If the light is not turned on in either case then we know we are neither in the situation where are buttons are "on" or all lights are "off".

          Step 3 - Press any pair of diagonally-opposite buttons, step out.
          Step 4 - Press all buttons, step out

          If the light is not turned on in either case then we know we are not in a situation where just two diagonally opposite buttons are "on". So now there is either one button "on", two adjacent buttons "on" or three buttons "on".

          Step 5 - Press any two adjacent buttons, step out.
          Step 6 - Press all buttons, step out.

          If we had been in the case of two adjacent buttons and the light is not turned on in either step, we will have changed to the case where two diagonally opposite buttons are "on".

          Step 7 - Repeat Step 3
          Step 8 - Repeat Step 4

          If the light is not on after either step then we must either be in the case where one button is "on" or three buttons are "on".

          Step 9 - Press any three buttons, step out
          Step 10 - Press all buttons, step out.

          If the light has not turned on in either step then we must have now pivoted into a case where two buttons are "on" and two buttons are "off", so we can revert to the strategy we had in that case.

          Steps 11 - 16 - Repeat Steps 3 - 8

          The light must be turned on at one of these steps.







          share|improve this answer









          $endgroup$



          4-button method




          Step 1 - Do not press any buttons, step out
          Step 2 - Press all buttons, step out.

          If the light is not turned on in either case then we know we are neither in the situation where are buttons are "on" or all lights are "off".

          Step 3 - Press any pair of diagonally-opposite buttons, step out.
          Step 4 - Press all buttons, step out

          If the light is not turned on in either case then we know we are not in a situation where just two diagonally opposite buttons are "on". So now there is either one button "on", two adjacent buttons "on" or three buttons "on".

          Step 5 - Press any two adjacent buttons, step out.
          Step 6 - Press all buttons, step out.

          If we had been in the case of two adjacent buttons and the light is not turned on in either step, we will have changed to the case where two diagonally opposite buttons are "on".

          Step 7 - Repeat Step 3
          Step 8 - Repeat Step 4

          If the light is not on after either step then we must either be in the case where one button is "on" or three buttons are "on".

          Step 9 - Press any three buttons, step out
          Step 10 - Press all buttons, step out.

          If the light has not turned on in either step then we must have now pivoted into a case where two buttons are "on" and two buttons are "off", so we can revert to the strategy we had in that case.

          Steps 11 - 16 - Repeat Steps 3 - 8

          The light must be turned on at one of these steps.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 1 hour ago









          hexominohexomino

          42.2k3127202




          42.2k3127202























              1












              $begingroup$

              $n=2^k$ button method




              Represent the state of the buttons using an $n$-bit string. Then a sequence of moves is represented by a sequence of $n$-bit strings that we xor with the button states.


              Proceed by induction.


              If $k=0$, then one possible sequence is $(1)$.


              Suppose we have a sequence $(a_1,dots,a_m)$ for $n=2^k$ buttons.


              Let $(b_1,dots,b_m)$ be the sequence of $2n$-bit strings where $b_i$ is the result of adding a copy of each bit in $a_i$ after that bit (e.g., $01011rightarrow0011001111$).


              Let $(c_1,dots,c_m)$ be the sequence of $2n$-bit strings where $c_i$ is the result of adding a $0$ after each bit in $a_i$ (e.g., $01001rightarrow0010001010$).


              Then a sequence for $2n=2^{k+1}$ buttons is the $(m^2+2m)$-length sequence $$(b_1,dots,b_m,c_1,b_1,dots,b_m,c_2,dots,c_{m-1},b_1,dots,b_m,c_m,b_1,dots,b_m)$$ where $m+1$ copies of $(b_i)$ are interleaved with $(c_i)$.


              For example, if $(a_i)=(1)$ is a $1$-button sequence, then $(b_i)=(11)$, $(c_i)=(10)$, and $(11,10,11)$ is a $2$-button sequence, and similarly $$(1111,1100,1111,1010,1111,1100,1111,1000,1111,1100,1111,1010,1111,1100,1111)$$ is a $4$-button sequence.







              share|improve this answer









              $endgroup$


















                1












                $begingroup$

                $n=2^k$ button method




                Represent the state of the buttons using an $n$-bit string. Then a sequence of moves is represented by a sequence of $n$-bit strings that we xor with the button states.


                Proceed by induction.


                If $k=0$, then one possible sequence is $(1)$.


                Suppose we have a sequence $(a_1,dots,a_m)$ for $n=2^k$ buttons.


                Let $(b_1,dots,b_m)$ be the sequence of $2n$-bit strings where $b_i$ is the result of adding a copy of each bit in $a_i$ after that bit (e.g., $01011rightarrow0011001111$).


                Let $(c_1,dots,c_m)$ be the sequence of $2n$-bit strings where $c_i$ is the result of adding a $0$ after each bit in $a_i$ (e.g., $01001rightarrow0010001010$).


                Then a sequence for $2n=2^{k+1}$ buttons is the $(m^2+2m)$-length sequence $$(b_1,dots,b_m,c_1,b_1,dots,b_m,c_2,dots,c_{m-1},b_1,dots,b_m,c_m,b_1,dots,b_m)$$ where $m+1$ copies of $(b_i)$ are interleaved with $(c_i)$.


                For example, if $(a_i)=(1)$ is a $1$-button sequence, then $(b_i)=(11)$, $(c_i)=(10)$, and $(11,10,11)$ is a $2$-button sequence, and similarly $$(1111,1100,1111,1010,1111,1100,1111,1000,1111,1100,1111,1010,1111,1100,1111)$$ is a $4$-button sequence.







                share|improve this answer









                $endgroup$
















                  1












                  1








                  1





                  $begingroup$

                  $n=2^k$ button method




                  Represent the state of the buttons using an $n$-bit string. Then a sequence of moves is represented by a sequence of $n$-bit strings that we xor with the button states.


                  Proceed by induction.


                  If $k=0$, then one possible sequence is $(1)$.


                  Suppose we have a sequence $(a_1,dots,a_m)$ for $n=2^k$ buttons.


                  Let $(b_1,dots,b_m)$ be the sequence of $2n$-bit strings where $b_i$ is the result of adding a copy of each bit in $a_i$ after that bit (e.g., $01011rightarrow0011001111$).


                  Let $(c_1,dots,c_m)$ be the sequence of $2n$-bit strings where $c_i$ is the result of adding a $0$ after each bit in $a_i$ (e.g., $01001rightarrow0010001010$).


                  Then a sequence for $2n=2^{k+1}$ buttons is the $(m^2+2m)$-length sequence $$(b_1,dots,b_m,c_1,b_1,dots,b_m,c_2,dots,c_{m-1},b_1,dots,b_m,c_m,b_1,dots,b_m)$$ where $m+1$ copies of $(b_i)$ are interleaved with $(c_i)$.


                  For example, if $(a_i)=(1)$ is a $1$-button sequence, then $(b_i)=(11)$, $(c_i)=(10)$, and $(11,10,11)$ is a $2$-button sequence, and similarly $$(1111,1100,1111,1010,1111,1100,1111,1000,1111,1100,1111,1010,1111,1100,1111)$$ is a $4$-button sequence.







                  share|improve this answer









                  $endgroup$



                  $n=2^k$ button method




                  Represent the state of the buttons using an $n$-bit string. Then a sequence of moves is represented by a sequence of $n$-bit strings that we xor with the button states.


                  Proceed by induction.


                  If $k=0$, then one possible sequence is $(1)$.


                  Suppose we have a sequence $(a_1,dots,a_m)$ for $n=2^k$ buttons.


                  Let $(b_1,dots,b_m)$ be the sequence of $2n$-bit strings where $b_i$ is the result of adding a copy of each bit in $a_i$ after that bit (e.g., $01011rightarrow0011001111$).


                  Let $(c_1,dots,c_m)$ be the sequence of $2n$-bit strings where $c_i$ is the result of adding a $0$ after each bit in $a_i$ (e.g., $01001rightarrow0010001010$).


                  Then a sequence for $2n=2^{k+1}$ buttons is the $(m^2+2m)$-length sequence $$(b_1,dots,b_m,c_1,b_1,dots,b_m,c_2,dots,c_{m-1},b_1,dots,b_m,c_m,b_1,dots,b_m)$$ where $m+1$ copies of $(b_i)$ are interleaved with $(c_i)$.


                  For example, if $(a_i)=(1)$ is a $1$-button sequence, then $(b_i)=(11)$, $(c_i)=(10)$, and $(11,10,11)$ is a $2$-button sequence, and similarly $$(1111,1100,1111,1010,1111,1100,1111,1000,1111,1100,1111,1010,1111,1100,1111)$$ is a $4$-button sequence.








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 23 mins ago









                  noednenoedne

                  6,42511956




                  6,42511956






















                      Jay Mar is a new contributor. Be nice, and check out our Code of Conduct.










                      draft saved

                      draft discarded


















                      Jay Mar is a new contributor. Be nice, and check out our Code of Conduct.













                      Jay Mar is a new contributor. Be nice, and check out our Code of Conduct.












                      Jay Mar is a new contributor. Be nice, and check out our Code of Conduct.
















                      Thanks for contributing an answer to Puzzling Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f80329%2ffour-buttons-on-a-table%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

                      Список ссавців Італії Природоохоронні статуси | Список |...

                      Українські прізвища Зміст Історичні відомості |...