Open Side Menu Go to the Top
Register
Math puzzle for those who enjoy them... Math puzzle for those who enjoy them...

07-15-2020 , 09:43 PM
Quote:
Originally Posted by masque de Z
https://en.wikipedia.org/wiki/Permutation

not an answer just a clarification question

Do the prisoners have to perform all their 50 moves right away or one can enter make a move to check a couple things then exit and have another get in to do the same then another etc until all before anyone passes 50 have reached to their number? If you find your number in a box does this box now become open or remains closed? Establish a sequence of switches that converge to solution so by all working to use their one move switches they eventually converge to all being back in the same place they started like 45 is in 45 33 in 33 etc. You can have one enter and check 1 see 16 then go to 16 and see 1 great you switch. If not you change order to have the lower being in 1 now. Next player does this on 2 then other on 3 etc...to be continued.
No need for this in a spoiler, this is just a rule clarification.

No - each prisoner goes in, opens up to 50 boxes, and closes them again. The prisoner cannot switch or remove numbers. He cannot leave the room and come back later. If/when a prisoner finds his own number, he has "won" his turn and he leaves the room, leaving it in the exact state he found it. That prisoner then essentially disappears from the game. If any prisoner fails to find his own number after trying 50 boxes, the game is lost for everyone.

The exception is the captain, who goes in first, examines all the boxes, and is allowed to make one switch if he so chooses. After his turn, the captain essentially disappears from the game.

There are no tricks like leaving boxes open or hidden communication during the game in the solution. It is a purely mathematical solution.
Math puzzle for those who enjoy them... Quote
07-15-2020 , 10:06 PM
Communication can take place in other ways too without talking or leaving other signals. If its your turn to go in and you refuse to do so within 30 seconds it means your box is ok. Sure it can pass as i am lazy now who knows why you are not going in? Is that allowed?

Are the contents equivalent to a number or only you know your contents so another would have no idea if your box is your own and is intact right now once they open it?

So what is the idea you get in do 50 moves and you are done? You have to do them all at once and then you never go back in to try the rest of your moves?

Does the person that open the box know the contents are the correct for that box or only the owner recognizes that? Are the contents equivalent to a universal number recognized by all? Like if i am 5 and i open box 5 and i see its number 7 there i do not need to open 7. But do i know its 7 or just not 5?

Last edited by masque de Z; 07-15-2020 at 10:12 PM.
Math puzzle for those who enjoy them... Quote
07-15-2020 , 10:11 PM
Quote:
Originally Posted by masque de Z
Communication can take place in other ways too without talking or leaving other signals. If its your turn to go in and you refuse to do so within 30 seconds it means your box is ok. Sure it can pass as i am lazy now who knows why you are not going in? Is that allowed?

Are the contents equivalent to a number or only you know your contents so another would have no idea if your box is your own and is intact right now once they open it?
You have to go in when it's your turn. You're overthinking it. Let's say they can't see/hear each other, whatever. It's just not relevant to the strategy.

I'm not sure what you mean by "your box is OK". You have a number, say 56. You go in a room with 100 boxes, in which are the numbers 1-100 at random. Your job is to find the number 56 in 50 attempts. You don't know anything about which one is your box before you go in and start opening boxes. As soon as one prisoner fails to find his own box, any communication is irrelevant, it's off to the guillotine for all of them.

The room is in an identical initial state for every prisoner who goes in after the captain has made his switch (if he chose to do so).

Last edited by d2_e4; 07-15-2020 at 10:17 PM.
Math puzzle for those who enjoy them... Quote
07-16-2020 , 01:29 AM
You still didnt answer if the person opening a box can only detect that their box hasnt their things in it or can also find out what box's things it has in it. Ie you open 56 and find contents of the 67 guy so you know that or do you only know the contents are not yours. If you know 67 is there on say 45 then you know 67 has 45 in it for example if you can identify whose things are there besides the fact its not yours.

I mean i number the boxes 1-2-3-4-5-100 and assume the original state was 1 in 1 2 in 2 3 in3 etc and all the captain guy did is to switch some of them or all once each. Now it is 1 in 17 17 in 1 and 67 on 45 and 45 on 67 57 on 57 still etc.

Do the guys know it starts in a well defined order that is then permuted? Or do they not even know what the starting order is?

If they know nothing and they do not know what guy's objects they find in whatever they open then its impossible. So they must at least know if they open something that the content is not theirs but it also is number 67th's for example. If they only know its not theirs then they cant solve anything. The first one in dies with some probability.

Did they initially had 1 number 1 2 number 2 etc? If you open 16 can you tell 3 is inside now? or only that its not or it is yours?
Math puzzle for those who enjoy them... Quote
07-16-2020 , 03:05 AM
Quote:
Originally Posted by masque de Z
You still didnt answer if the person opening a box can only detect that their box hasnt their things in it or can also find out what box's things it has in it. Ie you open 56 and find contents of the 67 guy so you know that or do you only know the contents are not yours. If you know 67 is there on say 45 then you know 67 has 45 in it for example if you can identify whose things are there besides the fact its not yours.

I mean i number the boxes 1-2-3-4-5-100 and assume the original state was 1 in 1 2 in 2 3 in3 etc and all the captain guy did is to switch some of them or all once each. Now it is 1 in 17 17 in 1 and 67 on 45 and 45 on 67 57 on 57 still etc.

Do the guys know it starts in a well defined order that is then permuted? Or do they not even know what the starting order is?

If they know nothing and they do not know what guy's objects they find in whatever they open then its impossible. So they must at least know if they open something that the content is not theirs but it also is number 67th's for example. If they only know its not theirs then they cant solve anything. The first one in dies with some probability.

Did they initially had 1 number 1 2 number 2 etc? If you open 16 can you tell 3 is inside now? or only that its not or it is yours?

I think you have the conditions a bit mixed up.

There is no starting order. There is a 10 * 10 array of lockers. In each locker is a piece of paper with a unique number 1-100 at random. The lockers are not pre-numbered per se.

Each prisoner is assigned a unique number 1-100, at random.

The prisoner goes in and does human stuff. He opens a locker, examines the paper, replaces the paper, closes the locker. Even if the number is his own, he replaces it and closes the locker.

If he finds his own number after opening a maximum of 50 boxes, he shouts "bingo", wins, and disappears from the game. If not, everyone loses.

The initial starting state of the room/lockers is identical for every prisoner who enters the room after the captain.

Does this clarify it?

Last edited by d2_e4; 07-16-2020 at 03:14 AM.
Math puzzle for those who enjoy them... Quote
07-16-2020 , 07:01 AM
I still need to understand better what is going on. The captain is able to swap the contents of two boxes as many times he wants at the start of the game? Like he can keep doing it at the start of the game until he has achieved whatever goal they all have in mind? Or only 2 of them (just one time) after examining everything?

The way it works when one eg the guy with number 50 opens the number 37 they can see inside is number 78 for example? All they see is a number ie 78 and they know their number is 50 and conclude its not a match?

Once a person finds their number does that box get removed from the search of others? If the person finds the box they exit and record they did or the game internally verifies they did find it? Can the players decide to search one box per min and so the others can know how long it took them to find their number when they exit ? Does the captain know the order the others will follow to enter the room before he is inside to make his thing?

Last edited by masque de Z; 07-16-2020 at 07:12 AM.
Math puzzle for those who enjoy them... Quote
07-16-2020 , 08:09 AM
The captain goes in first, he is able to make one and only one swap if he so chooses. After that the captain exits the game. Obviously if he could make as many swaps as he wants, he could just swap until it ran sequentially from e.g. 1 in the top left to 100 in the bottom right and there wouldn't be much of a game.

Your second paragraph is correct, although as I said, the lockers are not pre-numbered. Agreeing the numbering scheme for the lockers can be part of their strategy.

Nothing ever gets removed from the search, That is what I mean when I say that the initial state of the room is identical for every prisoner who enters. The game internally verifies that the prisoner found his own number.

The solution does not depend on the other prisoners knowing how many boxes someone opened. If a prisoner does not find his own number, the game is over and lost for everyone, so if the game continues the other prisoners know that the prisoner found his own box.

They can go in sequential or random order after the captain, the solution does not depend on him knowing the order, nor on them going in a specific order.
Math puzzle for those who enjoy them... Quote
07-16-2020 , 08:41 AM
The rules are basically a plain English reading of what I originally wrote. There are no "gotchas" or loopholes, it is a mathematical solution.
Math puzzle for those who enjoy them... Quote
07-16-2020 , 12:18 PM
Matt Parker (Stand-up Maths on YouTube) did the classic version of this puzzle. The added twist is fairly obvious once you understand the idea.

Spoiler:
The 10 x 10 arrangement is a red herring.
Math puzzle for those who enjoy them... Quote
07-16-2020 , 12:22 PM
Quote:
Originally Posted by Aaron W.
Matt Parker (Stand-up Maths on YouTube) did the classic version of this puzzle. The added twist is fairly obvious once you understand the idea.

Spoiler:
The 10 x 10 arrangement is a red herring.
He did, I was very pleased to see that video come up in my feed quite recently - it's one of my favourite puzzles of all time.

Btw, I came up with the twist myself after being introduced to the classic version of the problem, but I'm sure I'm not the only one. As you say, it's fairly obvious. If anyone is wondering, the twist Aaron is referring to makes the solution much easier.

Last edited by d2_e4; 07-16-2020 at 12:28 PM.
Math puzzle for those who enjoy them... Quote
07-16-2020 , 02:48 PM
I looked at the video.

Spoiler:

I was working along the lines of the idea in the video but I kept thinking that a path forward could turn into a loop in front of my starting box. But then that would require two pointers to the same box in front of me. So not possible. Loops can't have any hanging tails. I kept thinking loops were bad and I wanted a long path. I was confused. I had it backwards.

Since there can only be one loop longer than 50 the captain just needs to cut it into two shorter loops. Nice twist.



PairTheBoard
Math puzzle for those who enjoy them... Quote
07-16-2020 , 03:03 PM
Quote:
Originally Posted by PairTheBoard
I looked at the video.

Spoiler:

I was working along the lines of the idea in the video but I kept thinking that a path forward could turn into a loop in front of my starting box. But then that would require two pointers to the same box in front of me. So not possible. Loops can't have any hanging tails. I kept thinking loops were bad and I wanted a long path. I was confused. I had it backwards.

Since there can only be one loop longer than 50 the captain just needs to cut it into two shorter loops. Nice twist.



PairTheBoard
Thanks. More here if you're interested, including the rigorous maths behind the solution to the classic version.

Math puzzle for those who enjoy them... Quote
07-16-2020 , 08:11 PM
Spoiler:
I was wondering whether other cycles might also be relevant. Like e.g. for the relation n --> m if Box n contains the number 100 - m. Probably not.

A+ puzzle. B- red herring.
Math puzzle for those who enjoy them... Quote
07-16-2020 , 08:22 PM
Quote:
Originally Posted by lastcardcharlie
Spoiler:
I was wondering whether other cycles might also be relevant. Like e.g. for the relation n --> m if Box n contains the number 100 - m. Probably not.

A+ puzzle. B- red herring.
Posted in politics in response to a poster (one of your guys ) who got the right answer.

Spoiler:


------------------------------------------------------------------

Very good.

The classical version of this problem doesn't have the captain - that was my little flourish - and essentially reduces to the question of "what is the probability that for N consecutive integers there will be a cycle of length > N/2?" The answer turns out to approach ln(2) as N approaches infinity, so even for very large N they survive an amazing 30% of the time at a minimum.

I love how elegant the solution is, considering the naive approach has them surviving at a rate of 1:2^N, and with the twist the solution could basically be explained to a 10 year old.

More here if you're interested: https://en.wikipedia.org/wiki/100_prisoners_problem

As an aside, I'm a data warehouse dev, and cycle detection in parent-child relationships stored as a self-referencing foreign key has been the bane of my existence and the cause of crashes/timeouts in more than one of my CTEs, so it's somewhat close to my heart. Those cycles have tails.

Edit: just saw your edit, didn't pay that much attention to the exact method you suggested - obviously I knew you meant to split the cycle into 2 smaller cycles, which is trivial.

------------------------------------------------------------------

Aaron might (and should) pull me up on the rather loose statement that the convergence is absolute. The convergence, in the very technical sense of that term, only exists for N even (Aaron - is that right?)


Last edited by d2_e4; 07-16-2020 at 08:32 PM.
Math puzzle for those who enjoy them... Quote
07-17-2020 , 02:10 AM
On the 10x10 array

Spoiler:

The prisoners and captain need to settle on a common numbering scheme for the lockers ahead of time. While this might still be possible if the lockers were haphazardly scattered about the locker room, knowing it's a 10x10 or any such array makes it clear a common numbering scheme is easy for the prisoners to come up with. So not irrelevant.



PairTheBoard
Math puzzle for those who enjoy them... Quote
07-17-2020 , 03:12 AM
Quote:
Originally Posted by PairTheBoard
On the 10x10 array

Spoiler:

The prisoners and captain need to settle on a common numbering scheme for the lockers ahead of time. While this might still be possible if the lockers were haphazardly scattered about the locker room, knowing it's a 10x10 or any such array makes it clear a common numbering scheme is easy for the prisoners to come up with. So not irrelevant.



PairTheBoard
Oh, I see what you mean.

I mean, there are schemes possible. Assuming they are all boxes, we can go the same way as we evaluate girls - from bottom left, clockwise, no overlaps.
Math puzzle for those who enjoy them... Quote
07-17-2020 , 03:59 AM
That was a joke btw... obs it's not possible, we don't know the dimensions of the boxes. In the general case, there are loads of overlaps!
Math puzzle for those who enjoy them... Quote
07-17-2020 , 04:05 AM
Still havent looked at anything.

The problem here is connected to derangements and permutations as i linked before.

https://en.wikipedia.org/wiki/Derangement

https://en.wikipedia.org/wiki/Permutation

Spoiler:
One can get lucky and have a few fixed points say k that distribute like e^-1/k! seen above. If people aim for their numbers and others avoid those it may help.

In a way you want to use the fact the one before made it to avoid going through the fixed points of the other guy if possible if he had any. So the other guy can look for their own fixed point possibility (that would have hurt the other guy if chosen) and you must avoid securing 100% going through their potential fixed points by not looking in the locker/box of the others as original option. To avoid fixed points of others you must follow a path that would not lead to a fixed point but how you can do that unless you develop a sequence of choices that are not random that avoids taking you to fixed points. The captain may try to help the first guy that then helps others too effectively. To be continued.
Math puzzle for those who enjoy them... Quote
07-17-2020 , 05:49 AM
Spoiler:
You could have 101 boxes and everyone could still do it in 50 goes. The array sucks.
Math puzzle for those who enjoy them... Quote
07-17-2020 , 08:58 AM
Quote:
Originally Posted by masque de Z
Still havent looked at anything.

The problem here is connected to derangements and permutations as i linked before.

https://en.wikipedia.org/wiki/Derangement

https://en.wikipedia.org/wiki/Permutation

Spoiler:
One can get lucky and have a few fixed points say k that distribute like e^-1/k! seen above. If people aim for their numbers and others avoid those it may help.

In a way you want to use the fact the one before made it to avoid going through the fixed points of the other guy if possible if he had any. So the other guy can look for their own fixed point possibility (that would have hurt the other guy if chosen) and you must avoid securing 100% going through their potential fixed points by not looking in the locker/box of the others as original option. To avoid fixed points of others you must follow a path that would not lead to a fixed point but how you can do that unless you develop a sequence of choices that are not random that avoids taking you to fixed points. The captain may try to help the first guy that then helps others too effectively. To be continued.
I assume you haven't looked at the solution. If you'd like a hint, there is one below.

Spoiler:
Linked list
Math puzzle for those who enjoy them... Quote
07-17-2020 , 10:21 AM
A Theoretical Hint
Spoiler:

Consider this specific permutation. Consider the finite group consisting of its powers. Consider the orbits of the elements of the set that group acts on ( numbers 1-100). Apply group theory.



PairTheBoard
Math puzzle for those who enjoy them... Quote
07-17-2020 , 10:27 AM
Pretty sure if I were struggling with this one, your hint would confuse me more than help, but I guess YMMV!
Math puzzle for those who enjoy them... Quote
07-17-2020 , 05:45 PM
The key to any solution is to arrive naturally at it otherwise it will look like any generic solution to this problem ie a copy. You have to reverse engineer the miracle you are suggesting takes place. So if one can deliver a more natural proof you will have advanced the problem for future students of the topic and others.

Spoiler:
For example the above reasoning i started has lead me to conclude that it may be useful to develop a sequence of checking boxes that is not random but planned to exploit good breaks like you need to avoid checking boxes that can be the fixed solutions of others but it helps to get lucky and check your possibility of fixed solution. So you need to check your box and then develop a process that doesnt take you to a fixed point of others that is a wasted move. Also others need to build on your sequence to avoid going through things that hurt all ie there must be a way that all help each other by the sequence they follow that exploits some natural analysis of the permutation like maybe see it as product of permutations etc some transformation back to where it started from or something that is very different than randomly opening boxes.
Math puzzle for those who enjoy them... Quote
07-17-2020 , 06:02 PM
Dude, are you on acid?
Math puzzle for those who enjoy them... Quote
07-17-2020 , 09:59 PM
Yes Trump is still alive and mfer repugnant senate still supporting his bs even if selling their mothers. Furthermore an entire class of losers that are indeed irredeemable degenerate incoherent deplorables still want to vote for him. At the same time psychotic hysterical social warriors on the left fail one more time to grab a good opportunity to deliver sensible social progress with responsible behavior that doesnt allow the prejudiced morons to remain deplorable and instead engage in occasional extreme garbage ideas that alienate the centrists.

I try to give you a natural way to get to solution for people that have not taken group theory or realize yet that a permutation of a set S is bijection from S to itself or that the collection of all permutations of a set form a group called the symmetric group of the set or familiar with Cauchy two line notation or understand what decomposition into disjoint cycles is. I propose some number theory challenge for fun and some traditional grumpy guy comes up with his any idiot can ask line. And you ask if on acid? I say this all proves a highly acidic environment of people that could use some base to neutralize the hell out of it.
Math puzzle for those who enjoy them... Quote

      
m