Re: [algogeeks] Yahoo!!!! Puzzle

2010-09-15 Thread jaladhi dave
This looked like a variant of the socks problem :)

On Tue, Sep 14, 2010 at 5:20 PM, Sathaiah Dontula don.sat...@gmail.comwrote:

 How_to_Ace_the_Brainteaser_Interview.pdf

 find this book, this has good number of puzzles.

 Thanks,
 Sathaiah Dontula


 On Tue, Sep 14, 2010 at 3:01 PM, vishal raja vishal.ge...@gmail.comwrote:

 take out that one A pill that's there in the jar. take the half of all the
 four pills, that's how u'll make sure that u've had 1 of 'A' and 1 of 'B'
 pill.



 On Tue, Sep 14, 2010 at 2:52 PM, bittu shashank7andr...@gmail.comwrote:

 You are on a strict medical regimen that requires you to take two
 types of pills each day. You must take exactly one A pill and exactly
 one B pill at the same time. The pills are very expensive, and you
 don't want to waste any. So you open the bottle of A pills, and tap
 one out into your hand. Then you open the bottle of B pills and do the
 same thing -- but you make a mistake, and two B pills come out into
 your hand with the A pill. But the pills are all exactly identical.
 There is no way to tell A pills apart from B pills. How can you
 satisfy your regimen and take exactly one of each pill at the same
 time, without wasting any pills?


 Write  Algorithm to Solve dis Problem in  constant time..isn't it..???





 Regard's
 Shashank Mani Narayan  Don't Be Evil U Can Earn While U learn
 Computer Science  Engineering
 Birla Institute of  Technology,Mesra
 Cell No. +91-9166674831

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Yahoo!!!! Puzzle

2010-09-14 Thread bittu
You are on a strict medical regimen that requires you to take two
types of pills each day. You must take exactly one A pill and exactly
one B pill at the same time. The pills are very expensive, and you
don't want to waste any. So you open the bottle of A pills, and tap
one out into your hand. Then you open the bottle of B pills and do the
same thing -- but you make a mistake, and two B pills come out into
your hand with the A pill. But the pills are all exactly identical.
There is no way to tell A pills apart from B pills. How can you
satisfy your regimen and take exactly one of each pill at the same
time, without wasting any pills?


Write  Algorithm to Solve dis Problem in O(1)



Regard's
Shashank Mani Narayan  Don't Be Evil U Can Earn While U learn
Computer Science  Engineering
Birla Institute of  Technology,Mesra
Cell No. +91-9166674831

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Yahoo!!!! Puzzle

2010-09-14 Thread bittu
You are on a strict medical regimen that requires you to take two
types of pills each day. You must take exactly one A pill and exactly
one B pill at the same time. The pills are very expensive, and you
don't want to waste any. So you open the bottle of A pills, and tap
one out into your hand. Then you open the bottle of B pills and do the
same thing -- but you make a mistake, and two B pills come out into
your hand with the A pill. But the pills are all exactly identical.
There is no way to tell A pills apart from B pills. How can you
satisfy your regimen and take exactly one of each pill at the same
time, without wasting any pills?


Write  Algorithm to Solve dis Problem in  constant time..isn't it..???





Regard's
Shashank Mani Narayan  Don't Be Evil U Can Earn While U learn
Computer Science  Engineering
Birla Institute of  Technology,Mesra
Cell No. +91-9166674831

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Yahoo!!!! Puzzle

2010-09-14 Thread vishal raja
take out that one A pill that's there in the jar. take the half of all the
four pills, that's how u'll make sure that u've had 1 of 'A' and 1 of 'B'
pill.



On Tue, Sep 14, 2010 at 2:52 PM, bittu shashank7andr...@gmail.com wrote:

 You are on a strict medical regimen that requires you to take two
 types of pills each day. You must take exactly one A pill and exactly
 one B pill at the same time. The pills are very expensive, and you
 don't want to waste any. So you open the bottle of A pills, and tap
 one out into your hand. Then you open the bottle of B pills and do the
 same thing -- but you make a mistake, and two B pills come out into
 your hand with the A pill. But the pills are all exactly identical.
 There is no way to tell A pills apart from B pills. How can you
 satisfy your regimen and take exactly one of each pill at the same
 time, without wasting any pills?


 Write  Algorithm to Solve dis Problem in  constant time..isn't it..???





 Regard's
 Shashank Mani Narayan  Don't Be Evil U Can Earn While U learn
 Computer Science  Engineering
 Birla Institute of  Technology,Mesra
 Cell No. +91-9166674831

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Yahoo!!!! Puzzle

2010-09-14 Thread Terence

 No coding at all.
1) Take out another A pill from the bottle;
2) Split each of the 4 pills into two equal halves, and take one half of 
echo pill.

3) Collect the other half of the 4 pills for next time.

On 2010-9-14 17:22, bittu wrote:

You are on a strict medical regimen that requires you to take two
types of pills each day. You must take exactly one A pill and exactly
one B pill at the same time. The pills are very expensive, and you
don't want to waste any. So you open the bottle of A pills, and tap
one out into your hand. Then you open the bottle of B pills and do the
same thing -- but you make a mistake, and two B pills come out into
your hand with the A pill. But the pills are all exactly identical.
There is no way to tell A pills apart from B pills. How can you
satisfy your regimen and take exactly one of each pill at the same
time, without wasting any pills?


Write  Algorithm to Solve dis Problem in O(1)



Regard's
Shashank Mani Narayan  Don't Be Evil U Can Earn While U learn
Computer Science  Engineering
Birla Institute of  Technology,Mesra
Cell No. +91-9166674831



--
You received this message because you are subscribed to the Google Groups Algorithm 
Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Yahoo!!!! Puzzle

2010-09-14 Thread Sathaiah Dontula
How_to_Ace_the_Brainteaser_Interview.pdf

find this book, this has good number of puzzles.

Thanks,
Sathaiah Dontula

On Tue, Sep 14, 2010 at 3:01 PM, vishal raja vishal.ge...@gmail.com wrote:

 take out that one A pill that's there in the jar. take the half of all the
 four pills, that's how u'll make sure that u've had 1 of 'A' and 1 of 'B'
 pill.



 On Tue, Sep 14, 2010 at 2:52 PM, bittu shashank7andr...@gmail.com wrote:

 You are on a strict medical regimen that requires you to take two
 types of pills each day. You must take exactly one A pill and exactly
 one B pill at the same time. The pills are very expensive, and you
 don't want to waste any. So you open the bottle of A pills, and tap
 one out into your hand. Then you open the bottle of B pills and do the
 same thing -- but you make a mistake, and two B pills come out into
 your hand with the A pill. But the pills are all exactly identical.
 There is no way to tell A pills apart from B pills. How can you
 satisfy your regimen and take exactly one of each pill at the same
 time, without wasting any pills?


 Write  Algorithm to Solve dis Problem in  constant time..isn't it..???





 Regard's
 Shashank Mani Narayan  Don't Be Evil U Can Earn While U learn
 Computer Science  Engineering
 Birla Institute of  Technology,Mesra
 Cell No. +91-9166674831

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.