If m is odd then it is 2 otherwise it is 1 21

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: is odd, then it is 2, otherwise it is 1. 21 Extending to the case : n=3 for any m Let Clever Prisoner Position(2,m) = i. What is Clever Prisoner Position(3,m) ? The solution lies in the following key idea : The clever prisoner should occupy that position such that after the execution of one (out of three) prisoner, his position becomes i 22 Extending to the case : n=3 for any m Let Clever Prisoner Position(2,m) = i. What should be Clever Prisoner Position(3,m) ? Based on the key idea of previous slide there are two cases : 1. Unlucky Position(3,m)>i : 2. Unlucky Position(3,m)<=i : ??? ??? 23 Extending to the case : n=3 for any m Let Clever Prisoner Position(2,m) = i. What should...
View Full Document

This note was uploaded on 02/17/2014 for the course CS 101 taught by Professor Smitamazumdar during the Spring '12 term at IIT Kanpur.

Ask a homework question - tutors are online