MathJax

Thursday, October 26, 2017

Escaping Prison

The Problem

Last Friday, The Riddler posed quite the challenging problem.  Here it is in my own words.  

You are in prison with 99 other inmates (there are 100 of you).  The warden presents you with a game. Prisoners are to be randomly selected with replacement and taken into Cell Zero.  Inside Cell Zero, there are two levers that could be in any of the following configurations: 


Each prisoner that is let into Cell Zero can either declare "All prisoners have now been in Cell Zero" or move exactly one lever (and they must move exactly one lever).  

If the prisoner declares and is wrong, all prisoners are executed. 

If the prisoner declares and is correct, all prisoners go free. 

Once the game has begun, there can be no communication between prisoners.  What strategy at the outset will ensure that all prisoners go free?  

Common Questions


Do the prisoners know the original configuration of the levers?  NO.

Do we know which prisoner will be selected first?  NO.

Can prisoners be selected multiple times before another prisoner has ever visited Cell Zero?  YES.


A Solution


I think I have a solution to this.  It may not be the best, but here goes.

Since I have strong leadership skills among all the prisoners, I declare myself "the counter." My job is to only move the left lever UP, and count each time I do it.  If it is already in the up position, I just move the right lever down or up, regardless of its orientation. 

All other prisoners' job is to move the left lever DOWN exactly twice.  Once they have moved the left lever from the UP position to the DOWN position twice, they forever will move only the right lever.  If the left lever is already in the down position, they leave it be and move only the right lever. 

Once I have counted to 198, I declare everyone has been in Cell Zero. 

So Why Twice? And why does this work?  


When I first visit Cell Zero and the left lever is down, I have no way of knowing whether it started that way or if another prisoner moved it down from the up position.  So, when I move it up, I don't know whether I'm starting at 0 or counting an actual prisoner.  

Therefore, once I count to 99, I'm in a state of uncertainty. Have I counted all prisoners, or am I perhaps missing one?  This uncertainty is just that, uncertainty. Since I cannot be certain, we should devise a different strategy.  

By having all the prisoners pull the left lever down exactly twice, then I will eventually lift the left lever up 198 times. There is still now an uncertain state, and that is whether all prisoners have pulled the left lever down twice (a prisoner visited Cell Zero the first time before me with the left lever up and pulled it down), or there is still one out there that hasn't pulled it down a second time yet (the left lever started in the down position).  But that gives us the level of certainty that we need: that all the prisoners have been in Cell Zero at least once.  

Tuesday, October 17, 2017

A Day Without an X

Not Breaking the Chain


Previously, in my blog post Homebrew Daily, I referred to the habit building technique that requires you to keep track of each day that you devote to building the habit.  This can be done by marking an X on the calendar, thereby building a chain of days which you psychologically do not want to break.  It is a great method.

Not stated in that blog post, but something I started on that same day, was learning Norwegian on Duolingo.  According to Duolingo, I'm on a 66 day streak today.  

However, I started this 67 days ago. I missed a day.  

I also missed a day of my Homebrew Daily ritual.  

The Day Without the X


On my last blog post, I wrote about choosing your suffering.  I wrote about how I chose to suffer through a 100 mile bike ride one Saturday.  What I didn't write about, was that on that same day, I couldn't mark an X on the calendar. I missed studying Norwegian. I missed learning anything about homebrewing. 

Somewhere between 20 and 30 miles into the bike ride, my phone died. Even using it in airplane mode, my phone went to the dark side.  Little did I know, it would be for good.  

Upon finishing the bike ride over an hour later than I thought I would (I took a wrong turn at one point that took me 5 miles out of my way), I was not going to make the 6 pm dinner that Erin and I had planned with friends Ed and Mary in Lawrence.  

I was able to shower at the facility where we started the ride, and get on my way.  However, my phone would not charge. Not only could I not contact Erin to let her know I was OK, but I couldn't ask for directions to Ed and Mary's place. Although I had been there twice, and could have probably got myself in the general vicinity, I didn't know exactly where it was. 

Using someone's phone at the first gas station I pulled into in Lawrence, I let them know everything was fine and got directions. 

There was much fun and wine drinking at the dinner party.  Eventually, it was determined that we should stay the night instead of driving back to Topeka.  

Up until that point, I had a plan of working from my iPad or desktop computer as soon as I had arrived back home to complete my daily habit ritual. I began thinking of alternatives. Maybe I could ask to borrow their computer for a little while?  

Or maybe I shouldn't worry about it.  Maybe I've built a great habit, and am going to stick with it, and don't need another X in a calendar day to do that. Maybe I should enjoy the moment that has been dealt to me.  

Perhaps we should allow ourselves a "Weekend Amulet" that can be used to put a temporary freeze on your streak of days.  You remember those days when you did a little extra work building your habit?  Maybe you were earning yourself "lingots" that can be used to purchase "Streak Freeze Amulets" for when they are needed.  

It is important to completely own a great new habit that you have built.  But it is probably just as important for that habit not to own you.