Re: [algogeeks] Re: puzzle

2012-08-12 Thread Amitesh Singh
Does the pattern comes in this way? HT,TH,TT or HT(X)TH(X)TT ??

Let me know.

-- 
Amitesh




On Sat, Aug 11, 2012 at 11:24 PM, Piyush pkjee2...@gmail.com wrote:

 How can I find the expected number of tosses , required to obtain a
 {HT,TH,TT} , by using random variables??

 On Friday, December 31, 2010 8:27:46 PM UTC+5:30, Dave wrote:

 @Anuj and Bittu: It is not necessary to know the bias. You can
 simulate the flip of an unbiased coin with multiple flips of a biased
 coin: Flip it twice. If the result is HT, consider it a Head. If the
 result is TH, consider it a Tail. If the result is HH or TT, repeat
 the process. It terminates with probability 1. Now use the resulting
 Head or Tail in the procecure for deciding with a biased coin.

 Dave

 On Dec 31, 7:07 am, Anuj Kumar anuj.bhambh...@gmail.com wrote:
  in case the coin is not biased, we can flip the coin twice and define
 the
  rules as if {H,H} comes then ignore it i.e. dont take it as a flip and
 the 3
  other events would be valid onces and could occur with equal
 probabilities.
 
  In case of a biased coin please specify the probability of getting
 heads and
  that of getting tails.
 
 
 
 
 
  On Fri, Dec 31, 2010 at 4:11 PM, bittu shashank7andr...@gmail.com
 wrote:
   At a restaurant, how can Veronica choose one out of three desserts
   with equal probability with the help of a coin? What if the coin is
   biased and the bias is unknown?
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algo...@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+...@**googlegroups.comalgogeeks%**
 2Bunsubscribe@googlegroups­.**com
   .
   For more options, visit this group at
  http://groups.google.com/**group/algogeeks?hl=enhttp://groups.google.com/group/algogeeks?hl=en.

 
  --
  Anuj Kumar
  Third Year Undergraduate,
  Dept. of Computer Science and Engineering
  NIT Durgapur- Hide quoted text -
 
  - Show quoted text -

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/DZdUcelMwtUJ.
 To post to this group, send email to algogeeks@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.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2012-08-12 Thread Amitesh Singh
if you meant to calculate the E[x] for [HT,TH,TT]. It can be solvable but
very lengthy/boring.

I shall give you an example which should help you.

Let E[X] = x be the expected no. of coin flips to get [HT]

1) if first flip is a tail, we have wasted one flip hence. E[X1] = 1/2*(1+x)
2) if first flip is a head, and second flip is a head, hence E[X2] =
1/4*(1+1+x)
3) if first flip is a head and second flip is a tail, we are done then.
hence E[X3] = 1/4*(1+1)
We have,

E[X] = E[X1] + E[X2] + E[X3]

Solve x here.

The same approach you can apply to solve the above problem. I really don't
have time to do that for you. Please help yourself.


Thanks
-- 
Amitesh Singh





On Sun, Aug 12, 2012 at 10:32 PM, Amitesh Singh singh.amit...@gmail.comwrote:

 Does the pattern comes in this way? HT,TH,TT or HT(X)TH(X)TT ??

 Let me know.

 --
 Amitesh




 On Sat, Aug 11, 2012 at 11:24 PM, Piyush pkjee2...@gmail.com wrote:

 How can I find the expected number of tosses , required to obtain a
 {HT,TH,TT} , by using random variables??

 On Friday, December 31, 2010 8:27:46 PM UTC+5:30, Dave wrote:

 @Anuj and Bittu: It is not necessary to know the bias. You can
 simulate the flip of an unbiased coin with multiple flips of a biased
 coin: Flip it twice. If the result is HT, consider it a Head. If the
 result is TH, consider it a Tail. If the result is HH or TT, repeat
 the process. It terminates with probability 1. Now use the resulting
 Head or Tail in the procecure for deciding with a biased coin.

 Dave

 On Dec 31, 7:07 am, Anuj Kumar anuj.bhambh...@gmail.com wrote:
  in case the coin is not biased, we can flip the coin twice and define
 the
  rules as if {H,H} comes then ignore it i.e. dont take it as a flip and
 the 3
  other events would be valid onces and could occur with equal
 probabilities.
 
  In case of a biased coin please specify the probability of getting
 heads and
  that of getting tails.
 
 
 
 
 
  On Fri, Dec 31, 2010 at 4:11 PM, bittu shashank7andr...@gmail.com
 wrote:
   At a restaurant, how can Veronica choose one out of three desserts
   with equal probability with the help of a coin? What if the coin is
   biased and the bias is unknown?
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algo...@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+...@**googlegroups.comalgogeeks%**
 2Bunsubscribe@googlegroups­.**com
   .
   For more options, visit this group at
  http://groups.google.com/**group/algogeeks?hl=enhttp://groups.google.com/group/algogeeks?hl=en.

 
  --
  Anuj Kumar
  Third Year Undergraduate,
  Dept. of Computer Science and Engineering
  NIT Durgapur- Hide quoted text -
 
  - Show quoted text -

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/DZdUcelMwtUJ.
 To post to this group, send email to algogeeks@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.




-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-10-06 Thread vaibhav shukla
4 boys , 3 girls  ..
7 children

b: no. of boys
g: no of girls
b-1=g (1st condition)
b=2(g-1) (2nd condition)   gives the answer

On Thu, Oct 6, 2011 at 3:42 PM, shady sinv...@gmail.com wrote:

 7, try thinking by yourself...
 if anyone has some different answer only then post

 On Oct 6, 3:05 pm, 9ight coder 9ightco...@gmail.com wrote:
  A family has several children. every boy has as many brothers as
  sisters. Every gal has twice as many brothers as sisters. How many
  childrens are there in family?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
  best wishes!!
Vaibhav

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-10-06 Thread KARTHIKEYAN V.B.
let no of boys be x and no of girls be y.

then,
x=y+1
2(y-1)=x

solving these we get x=4,y=3

so,x+y=7

there are 7 children.

am I right

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-09-24 Thread sukran dhawan
GP

2011/9/24 яαωαт Jee anuragrawat1...@gmail.com

 ^^ ans will be n*30 mins

 On Sep 24, 8:40 am, яαωαт Jee anuragrawat1...@gmail.com wrote:
  sum of GP..
  a=1
  common ratio=4
 
  sum is given=5.6 billion.. find n
  simple enough

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-08-26 Thread Himanshu Srivastava
lol :P


On Wed, Aug 10, 2011 at 11:35 PM, $hr! k@nth srithb...@gmail.com wrote:

 Tie the rope at the top of the tower
 Climb down with the help of the rope up to 100 mt peg possItion
 Tie the rope to that peg, Climb up to the top of the tower with that rope.
 Now release the rope at the top and hold it. It ll take you down.:P


 On Wed, Aug 10, 2011 at 7:49 PM, varun pahwa varunpahwa2...@gmail.comwrote:

 make two ropes 50m and 100 meter. make a loop kind of thing with that now
 you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in
 downward now cut the loop at 100 mtr you have 100 mtr rope then move down
 with the help of that. i hope i am clear.


 On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C sachindr...@gmail.comwrote:

 tie the rope to the peg and hold the rope at a little less than 100m
 point. Then jump.


 On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava 
 himanshusri...@gmail.com wrote:

 @Dave oh i thought some logical concept willl be applied in that
 case...it is ok!!!
 thanks:)


 On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote:

 @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
 of the tower. Then tie a sheepshank knot of a comfortable length in
 the rope and cut the middle strand inside the knot. Climb down the
 rope to the peg and tie the other end of the rope onto the peg. Then,
 while standing on or hanging from the peg, shake the upper rope to
 release the sheepshank knot. The upper end will fall down and you can
 climb the rest of the way down.

 Dave


 On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com
 wrote:
  suppose u tie the rope at 200mt height and now climb down to 100m
  heightthen u tie the rope at that point then how will you open
 the rope
  at point above 200mt where u have tied it earlier
 
 
 
  On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com
 wrote:
   can't we tie the rope where we are standing (at height of 200
 meter)?
 
   On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe 
   neeraja.marath...@gmail.com wrote:
 
   this was the puzzle asked to me in NVIDIA interview:
   you are standing on top of a tower of ht 200 mt. .At 100 mt. ht .
 from
   bottom of tower there is a peg where u can tie a rope. You have a
 rope
   of length 150 mt. with you and using this rope you have to get
 down
   the tower. you can not jump or there is nobody to help you. how
 will u
   get down the tower??
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   
   *MOHIT VERMA*
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Regards,
 Shachindra A C

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Varun Pahwa
 B.Tech (IT)
 7th Sem.
 Indian Institute of Information Technology Allahabad.
 Ph : 09793899112
 Official Email :: rit2008...@iiita.ac.in
 Another Email :: varunpahwa.ii...@gmail.com

 People who fail to plan are those who plan to fail.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Regards,

Re: [algogeeks] Re: puzzle

2011-08-26 Thread Naren s
varun: can u explain it little further..


On Wed, Aug 10, 2011 at 7:49 PM, varun pahwa varunpahwa2...@gmail.comwrote:

 make two ropes 50m and 100 meter. make a loop kind of thing with that now
 you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in
 downward now cut the loop at 100 mtr you have 100 mtr rope then move down
 with the help of that. i hope i am clear.


 On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C sachindr...@gmail.comwrote:

 tie the rope to the peg and hold the rope at a little less than 100m
 point. Then jump.


 On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava 
 himanshusri...@gmail.com wrote:

 @Dave oh i thought some logical concept willl be applied in that
 case...it is ok!!!
 thanks:)


 On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote:

 @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
 of the tower. Then tie a sheepshank knot of a comfortable length in
 the rope and cut the middle strand inside the knot. Climb down the
 rope to the peg and tie the other end of the rope onto the peg. Then,
 while standing on or hanging from the peg, shake the upper rope to
 release the sheepshank knot. The upper end will fall down and you can
 climb the rest of the way down.

 Dave


 On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com
 wrote:
  suppose u tie the rope at 200mt height and now climb down to 100m
  heightthen u tie the rope at that point then how will you open the
 rope
  at point above 200mt where u have tied it earlier
 
 
 
  On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com
 wrote:
   can't we tie the rope where we are standing (at height of 200
 meter)?
 
   On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe 
   neeraja.marath...@gmail.com wrote:
 
   this was the puzzle asked to me in NVIDIA interview:
   you are standing on top of a tower of ht 200 mt. .At 100 mt. ht .
 from
   bottom of tower there is a peg where u can tie a rope. You have a
 rope
   of length 150 mt. with you and using this rope you have to get down
   the tower. you can not jump or there is nobody to help you. how
 will u
   get down the tower??
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   
   *MOHIT VERMA*
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Regards,
 Shachindra A C

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Varun Pahwa
 B.Tech (IT)
 7th Sem.
 Indian Institute of Information Technology Allahabad.
 Ph : 09793899112
 Official Email :: rit2008...@iiita.ac.in
 Another Email :: varunpahwa.ii...@gmail.com

 People who fail to plan are those who plan to fail.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
*Narayanan S,*
B.E., C.S.E., (final year),
College Of Engineering Guindy,
Anna University,
Chennai-25.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, 

Re: [algogeeks] Re: puzzle

2011-08-26 Thread Piyush Grover
Cut the rope in 50mtrs and 100mtrs length.

Make a small loop(of negligible length at one end of the 50 mtrs rope)

Tie the other end of the rope at the top and from the loop end side pass the
100mtrs rope
such that you have both the ends of 100mtrs rope in your end.

now get down at 100mtrs peg point(~50 + 50 = 100 mtrs).

Pull the 100 mtrs rope and tie it at the peg at 100mtrs height.

Get down to the bottom.


On Fri, Aug 26, 2011 at 7:29 PM, Himanshu Srivastava 
himanshusri...@gmail.com wrote:

 lol :P


 On Wed, Aug 10, 2011 at 11:35 PM, $hr! k@nth srithb...@gmail.com wrote:

 Tie the rope at the top of the tower
 Climb down with the help of the rope up to 100 mt peg possItion
 Tie the rope to that peg, Climb up to the top of the tower with that rope.
 Now release the rope at the top and hold it. It ll take you down.:P


 On Wed, Aug 10, 2011 at 7:49 PM, varun pahwa varunpahwa2...@gmail.comwrote:

 make two ropes 50m and 100 meter. make a loop kind of thing with that now
 you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in
 downward now cut the loop at 100 mtr you have 100 mtr rope then move down
 with the help of that. i hope i am clear.


 On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C sachindr...@gmail.comwrote:

 tie the rope to the peg and hold the rope at a little less than 100m
 point. Then jump.


 On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava 
 himanshusri...@gmail.com wrote:

 @Dave oh i thought some logical concept willl be applied in that
 case...it is ok!!!
 thanks:)


 On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote:

 @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
 of the tower. Then tie a sheepshank knot of a comfortable length in
 the rope and cut the middle strand inside the knot. Climb down the
 rope to the peg and tie the other end of the rope onto the peg. Then,
 while standing on or hanging from the peg, shake the upper rope to
 release the sheepshank knot. The upper end will fall down and you can
 climb the rest of the way down.

 Dave


 On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com
 wrote:
  suppose u tie the rope at 200mt height and now climb down to 100m
  heightthen u tie the rope at that point then how will you open
 the rope
  at point above 200mt where u have tied it earlier
 
 
 
  On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com
 wrote:
   can't we tie the rope where we are standing (at height of 200
 meter)?
 
   On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe 
   neeraja.marath...@gmail.com wrote:
 
   this was the puzzle asked to me in NVIDIA interview:
   you are standing on top of a tower of ht 200 mt. .At 100 mt. ht .
 from
   bottom of tower there is a peg where u can tie a rope. You have a
 rope
   of length 150 mt. with you and using this rope you have to get
 down
   the tower. you can not jump or there is nobody to help you. how
 will u
   get down the tower??
 
   --
   You received this message because you are subscribed to the
 Google Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   
   *MOHIT VERMA*
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text
 -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Regards,
 Shachindra A C

  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Varun Pahwa
 B.Tech (IT)
 7th Sem.
 Indian Institute of Information Technology Allahabad.
 Ph : 

Re: [algogeeks] Re: puzzle

2011-08-26 Thread SuDhir mIsHra
i hope now it clear:


[image: Screenshot.png]

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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.

Screenshot.png

Re: [algogeeks] Re: puzzle

2011-08-26 Thread Anup Ghatage
Check this out:

Tie it at the 200th meter mark. Throw the 150mt rope down.

Climb down to the 100th meter pole. Tie the rope there from the middle, and
not the end.

So what you have is a 150 mt rope that is tied at 200 mt mark, 100 mt mark
and 50 mts of the rope from 100 mt marks is hanging.

Now pull up the hanging rope from the 100 mt mark, hold it and climb up the
rope towards the top as long as the hanging rope permits you.

You'll have to stop at a 50 mt mark ( As the hanging rope is of 50 mts and
it permits you to only go up 50 mts ), Hold the rope tightly and cut it at
that point.

You'll swing down and hang above 50 mts form the ground and you'll be
holding two ends of a 100 mt rope tied from its center.

Climb up, un-tie and re-tie the 100 mt rope and get down!

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-08-21 Thread Puneet Chawla
only M is married.

On Sat, Aug 20, 2011 at 7:53 PM, Arun Vishwanathan
aaron.nar...@gmail.comwrote:

 @DK:if L is married to M according to you finally , then what does the
 third if then statement according to you mean when it is given that if L is
 not married then M is married?


 On Fri, Aug 19, 2011 at 10:35 PM, Dave dave_and_da...@juno.com wrote:

 @DK: What in the statement of the problem led you to believe that
 these were if-then statements?

 Dave

 On Aug 19, 3:15 pm, DK divyekap...@gmail.com wrote:
  Note that in the answer above, the table given is of the form:
 
  If condition is truethen what predicate is true
  -----
  M - married   N - not married
  N - married   L - not married
  L - not married  M - married
 
  --
  DK
 
 
 http://gplus.to/divyekapoorhttp://twitter.com/divyekapoorhttp://www.divye.in

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
  People often say that motivation doesn't last. Well, neither does
 bathing - that's why we recommend it daily.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
With regards
  
Puneet Chawla
Computer Engineering Student
NIT Kurukshetra

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-08-21 Thread rahul aravind
consider the last two cases
N married  L not married
L not married M married
so now tak M and N
compare it with first case
M married N not married
therfore,only m married

On Sun, Aug 21, 2011 at 1:06 PM, Tushar Bindal tushicom...@gmail.comwrote:

 @arun

 if L is not married, then M must be married
 but if L is married then M can be married or not married,
 so if we say L is married to M, there is no problem in that


 On Sun, Aug 21, 2011 at 12:53 PM, Ravindra Singh Poonia 
 ravindrasinghpoo...@gmail.com wrote:

 only M is married


 On Sat, Aug 20, 2011 at 11:24 PM, Puneet Chawla 
 puneetchawla...@gmail.com wrote:

 only M is married.


 On Sat, Aug 20, 2011 at 7:53 PM, Arun Vishwanathan 
 aaron.nar...@gmail.com wrote:

 @DK:if L is married to M according to you finally , then what does the
 third if then statement according to you mean when it is given that if L is
 not married then M is married?


 On Fri, Aug 19, 2011 at 10:35 PM, Dave dave_and_da...@juno.com wrote:

 @DK: What in the statement of the problem led you to believe that
 these were if-then statements?

 Dave

 On Aug 19, 3:15 pm, DK divyekap...@gmail.com wrote:
  Note that in the answer above, the table given is of the form:
 
  If condition is truethen what predicate is true
  -----
  M - married   N - not married
  N - married   L - not married
  L - not married  M - married
 
  --
  DK
 
 
 http://gplus.to/divyekapoorhttp://twitter.com/divyekapoorhttp://www.divye.in

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
  People often say that motivation doesn't last. Well, neither does
 bathing - that's why we recommend it daily.

  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 With regards
   
 Puneet Chawla
 Computer Engineering Student
 NIT Kurukshetra

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Thanks  Regards,
 *Ravindra Singh* (RHCE)
 Mobile No. +91-9896949235
 Mail ID- ravindrasinghpoo...@gmail.com
 Computer Engg. Dept. NIT Kurukshetra Haryana (INDIA)

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob: +919818442705
 E-Mail : tushicom...@gmail.com
 Website: www.jugadengg.com

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-08-20 Thread Arun Vishwanathan
@DK:if L is married to M according to you finally , then what does the third
if then statement according to you mean when it is given that if L is not
married then M is married?

On Fri, Aug 19, 2011 at 10:35 PM, Dave dave_and_da...@juno.com wrote:

 @DK: What in the statement of the problem led you to believe that
 these were if-then statements?

 Dave

 On Aug 19, 3:15 pm, DK divyekap...@gmail.com wrote:
  Note that in the answer above, the table given is of the form:
 
  If condition is truethen what predicate is true
  -----
  M - married   N - not married
  N - married   L - not married
  L - not married  M - married
 
  --
  DK
 
 
 http://gplus.to/divyekapoorhttp://twitter.com/divyekapoorhttp://www.divye.in

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
 People often say that motivation doesn't last. Well, neither does bathing
- that's why we recommend it daily.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-08-10 Thread varun pahwa
make two ropes 50m and 100 meter. make a loop kind of thing with that now
you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in
downward now cut the loop at 100 mtr you have 100 mtr rope then move down
with the help of that. i hope i am clear.

On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C sachindr...@gmail.comwrote:

 tie the rope to the peg and hold the rope at a little less than 100m point.
 Then jump.


 On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava 
 himanshusri...@gmail.com wrote:

 @Dave oh i thought some logical concept willl be applied in that
 case...it is ok!!!
 thanks:)


 On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote:

 @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
 of the tower. Then tie a sheepshank knot of a comfortable length in
 the rope and cut the middle strand inside the knot. Climb down the
 rope to the peg and tie the other end of the rope onto the peg. Then,
 while standing on or hanging from the peg, shake the upper rope to
 release the sheepshank knot. The upper end will fall down and you can
 climb the rest of the way down.

 Dave


 On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com
 wrote:
  suppose u tie the rope at 200mt height and now climb down to 100m
  heightthen u tie the rope at that point then how will you open the
 rope
  at point above 200mt where u have tied it earlier
 
 
 
  On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com
 wrote:
   can't we tie the rope where we are standing (at height of 200 meter)?
 
   On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe 
   neeraja.marath...@gmail.com wrote:
 
   this was the puzzle asked to me in NVIDIA interview:
   you are standing on top of a tower of ht 200 mt. .At 100 mt. ht .
 from
   bottom of tower there is a peg where u can tie a rope. You have a
 rope
   of length 150 mt. with you and using this rope you have to get down
   the tower. you can not jump or there is nobody to help you. how will
 u
   get down the tower??
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   
   *MOHIT VERMA*
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Regards,
 Shachindra A C

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Varun Pahwa
B.Tech (IT)
7th Sem.
Indian Institute of Information Technology Allahabad.
Ph : 09793899112
Official Email :: rit2008...@iiita.ac.in
Another Email :: varunpahwa.ii...@gmail.com

People who fail to plan are those who plan to fail.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-08-10 Thread $hr! k@nth
Tie the rope at the top of the tower
Climb down with the help of the rope up to 100 mt peg possItion
Tie the rope to that peg, Climb up to the top of the tower with that rope.
Now release the rope at the top and hold it. It ll take you down.:P


On Wed, Aug 10, 2011 at 7:49 PM, varun pahwa varunpahwa2...@gmail.comwrote:

 make two ropes 50m and 100 meter. make a loop kind of thing with that now
 you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in
 downward now cut the loop at 100 mtr you have 100 mtr rope then move down
 with the help of that. i hope i am clear.


 On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C sachindr...@gmail.comwrote:

 tie the rope to the peg and hold the rope at a little less than 100m
 point. Then jump.


 On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava 
 himanshusri...@gmail.com wrote:

 @Dave oh i thought some logical concept willl be applied in that
 case...it is ok!!!
 thanks:)


 On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote:

 @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
 of the tower. Then tie a sheepshank knot of a comfortable length in
 the rope and cut the middle strand inside the knot. Climb down the
 rope to the peg and tie the other end of the rope onto the peg. Then,
 while standing on or hanging from the peg, shake the upper rope to
 release the sheepshank knot. The upper end will fall down and you can
 climb the rest of the way down.

 Dave


 On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com
 wrote:
  suppose u tie the rope at 200mt height and now climb down to 100m
  heightthen u tie the rope at that point then how will you open the
 rope
  at point above 200mt where u have tied it earlier
 
 
 
  On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com
 wrote:
   can't we tie the rope where we are standing (at height of 200
 meter)?
 
   On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe 
   neeraja.marath...@gmail.com wrote:
 
   this was the puzzle asked to me in NVIDIA interview:
   you are standing on top of a tower of ht 200 mt. .At 100 mt. ht .
 from
   bottom of tower there is a peg where u can tie a rope. You have a
 rope
   of length 150 mt. with you and using this rope you have to get down
   the tower. you can not jump or there is nobody to help you. how
 will u
   get down the tower??
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   
   *MOHIT VERMA*
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Regards,
 Shachindra A C

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Varun Pahwa
 B.Tech (IT)
 7th Sem.
 Indian Institute of Information Technology Allahabad.
 Ph : 09793899112
 Official Email :: rit2008...@iiita.ac.in
 Another Email :: varunpahwa.ii...@gmail.com

 People who fail to plan are those who plan to fail.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Regards,
$hr!k@nth

-- 
You received this message because you are subscribed to the Google Groups 

Re: [algogeeks] Re: puzzle

2011-08-08 Thread Himanshu Srivastava
@Dave oh i thought some logical concept willl be applied in that
case...it is ok!!!
thanks:)

On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote:

 @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
 of the tower. Then tie a sheepshank knot of a comfortable length in
 the rope and cut the middle strand inside the knot. Climb down the
 rope to the peg and tie the other end of the rope onto the peg. Then,
 while standing on or hanging from the peg, shake the upper rope to
 release the sheepshank knot. The upper end will fall down and you can
 climb the rest of the way down.

 Dave


 On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com
 wrote:
  suppose u tie the rope at 200mt height and now climb down to 100m
  heightthen u tie the rope at that point then how will you open the
 rope
  at point above 200mt where u have tied it earlier
 
 
 
  On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com
 wrote:
   can't we tie the rope where we are standing (at height of 200 meter)?
 
   On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe 
   neeraja.marath...@gmail.com wrote:
 
   this was the puzzle asked to me in NVIDIA interview:
   you are standing on top of a tower of ht 200 mt. .At 100 mt. ht . from
   bottom of tower there is a peg where u can tie a rope. You have a rope
   of length 150 mt. with you and using this rope you have to get down
   the tower. you can not jump or there is nobody to help you. how will u
   get down the tower??
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   
   *MOHIT VERMA*
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-08-08 Thread Shachindra A C
tie the rope to the peg and hold the rope at a little less than 100m point.
Then jump.

On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava 
himanshusri...@gmail.com wrote:

 @Dave oh i thought some logical concept willl be applied in that
 case...it is ok!!!
 thanks:)


 On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote:

 @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
 of the tower. Then tie a sheepshank knot of a comfortable length in
 the rope and cut the middle strand inside the knot. Climb down the
 rope to the peg and tie the other end of the rope onto the peg. Then,
 while standing on or hanging from the peg, shake the upper rope to
 release the sheepshank knot. The upper end will fall down and you can
 climb the rest of the way down.

 Dave


 On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com
 wrote:
  suppose u tie the rope at 200mt height and now climb down to 100m
  heightthen u tie the rope at that point then how will you open the
 rope
  at point above 200mt where u have tied it earlier
 
 
 
  On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com
 wrote:
   can't we tie the rope where we are standing (at height of 200 meter)?
 
   On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe 
   neeraja.marath...@gmail.com wrote:
 
   this was the puzzle asked to me in NVIDIA interview:
   you are standing on top of a tower of ht 200 mt. .At 100 mt. ht .
 from
   bottom of tower there is a peg where u can tie a rope. You have a
 rope
   of length 150 mt. with you and using this rope you have to get down
   the tower. you can not jump or there is nobody to help you. how will
 u
   get down the tower??
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   
   *MOHIT VERMA*
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Regards,
Shachindra A C

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-08-05 Thread Arun Vishwanathan
I guess anubhav soln seems ok

On Thu, Aug 4, 2011 at 8:50 PM, ankit sambyal ankitsamb...@gmail.comwrote:

 @aditi:Thats a non uniform rope. The 1st half may burn faster than 2nd
 half.
 btw Priyanka's solution is correct.

 --
  You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-08-05 Thread Tushar Bindal
of this double, half is kept inside the well, and the other half is used as
input to the 2nd well

half mean 1/2 or 50%
how can we assume it to be 100???
if we take it to be 1/2, the question goes wrong, so ur concept is valid but
then question should have been framed correctly

On Fri, Aug 5, 2011 at 7:55 PM, Lakshmi Prasad
prasadlakshmi...@gmail.comwrote:

 I didn't understand it fully plese explain

 On Aug 4, 2:48 pm, sagar pareek sagarpar...@gmail.com wrote:
  double 87.5 gives you 175
  100 will be used by 1st well and 75 will be used by second
  now second well will double the 75 and will give you 150
  100 will be used by second and remainder 50 will forwarded to third
  now third one use 50 and will double it to 100
 
  no remainder left
  i think its clear now  :) :)
 
  On Fri, Aug 5, 2011 at 12:14 AM, Himanshu Srivastava 
 
 
 
 
 
 
 
 
 
  himanshusri...@gmail.com wrote:
   i mean @sagar:how did you get 87.5%??
 
   On Fri, Aug 5, 2011 at 12:13 AM, Himanshu Srivastava 
   himanshusri...@gmail.com wrote:
 
   @nikhil:how did you get 87.5%??
 
   On Thu, Aug 4, 2011 at 11:59 PM, sagar pareek sagarpar...@gmail.com
 wrote:
 
   87.5 %
 
   On Thu, Aug 4, 2011 at 10:39 PM, Nikhil Gupta 
 nikhilgupta2...@gmail.com
wrote:
 
   There are 3 magical wells. Any input quantity of water we provide
 the
   1st well is returned double (of this double, half is kept inside the
 well,
   and the other half is used as input to the 2nd well).
   The 2nd well also returns double the quantity of its input (of which
   half is kept inside the well, and the other half is used as input to
 the 3rd
   well). Same goes with the 3rd, but its half output is the remainder
 (other
   half being kept inside the well). Now what input should we provide
 in the
   1st well, so that the remainder at the end comes out to be zero?
 
   (Asked in classroom coaching of T.I.M.E.)
   --
   Nikhil Gupta
   Senior Co-ordinator, Publicity
   CSI, NSIT Students' Branch
   NSIT, New Delhi, India
 
--
   You received this message because you are subscribed to the Google
   Groups Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   **Regards
   SAGAR PAREEK
   COMPUTER SCIENCE AND ENGINEERING
   NIT ALLAHABAD
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
  --
  **Regards
  SAGAR PAREEK
  COMPUTER SCIENCE AND ENGINEERING
  NIT ALLAHABAD

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Tushar Bindal
Computer Engineering
Delhi College of Engineering
Mob: +919818442705
E-Mail : tushicom...@gmail.com
Website: www.jugadengg.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-08-04 Thread aditi garg
@dave...im not burning half of the rope or anything...my idea is jst to
increase the rate of burning..by folding it in the middle and then lighting
it from both ends...im burning the entire rope wid 4 times the rate of
burning...shud take 15 mins

On Thu, Aug 4, 2011 at 9:52 PM, Dave dave_and_da...@juno.com wrote:

 @Aditi: The ropes burn at non-uniform rates. So for your solution, you
 would have to fold it in half according to time, not according to
 length. But you don't know where the half-hour point is unless you
 light one end of the second rope at the same time you light both ends
 of the first rope. When the first rope burns out, you will know where
 the half-hour point is on the second rope.

 Dave

 On Aug 4, 7:47 am, aditi garg aditi.garg.6...@gmail.com wrote:
  Well acc to me the solution should be light the frst one on both
 ends(half
  an hr)After rope one is completely burnt, fr the second one fold the rope
 in
  the middle and then light it from both ends.it will take 15
 minstotal 45
  mins...please let me know if thr is any flaw in this
 
  On Thu, Aug 4, 2011 at 5:18 PM, Abhinav Arora abhinavdgr8b...@gmail.com
 wrote:
 
   @Nikhil : This question was asked to 2 people during Adobe interview on
   Tuesdaythe above solutions are perfectly alright.
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To view this discussion on the web visit
  https://groups.google.com/d/msg/algogeeks/-/Bx9FHS_7aRMJ.
 
   To post to this group, send email to algogeeks@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.
 
  --
  Aditi Garg
  Undergraduate Student
  Electronics  Communication Divison
  NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
  Sector 3, Dwarka
  New Delhi

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Aditi Garg
Undergraduate Student
Electronics  Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-08-04 Thread ankit sambyal
@aditi:Thats a non uniform rope. The 1st half may burn faster than 2nd half.
btw Priyanka's solution is correct.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle and solution

2011-07-22 Thread Rajeev Kumar
Please check this : http://www.techinterview.org/post/526313890/bad-king

On Tue, Jul 19, 2011 at 8:43 PM, sagar pareek sagarpar...@gmail.com wrote:

 hey guys pls tell any other better solution ...


 On Tue, Jul 19, 2011 at 6:41 PM, sagar pareek sagarpar...@gmail.comwrote:

 Question :-



 Once upon a time in ancient times there was a king who was very fond of
 wines.  He had a huge cellar, which had 1000 different varieties of wine
 all in different caskets (1000 caskets in all).  In the adjoining kingdom
 there was a queen who was envious of the king’s huge wine collection.  After
 some time when she could not bear it any more she conspired to kill her by
 poisoning all his wine caskets.  So she one sentry to poison all the
 caskets, but no sooner had the sentry poisoned only one wine casket that he
 was caught and killed by the Royal guards.  Now the king had a major
 problem in his hand so as to identify the right casket, which he gave to the
 Minister.  Now the position had two peculiar qualities



  Anyone who takes even one drop of poison will die.

  But, he will die only after one month.



  The king also gave the Minister 10 prisoners who could be used
 as tasters, cause there lives was of no consequence to the king of kingdom
 for that matter, and the Minister was given one month to find the poisoned
 casket.  Is it possible for the Minister to find out in one month?  If so
 how? If not then how many months are required?





 My solution :-

 This can be done in one month

 Think the solution in binary

 ok first i wanna ask u a question :- how many bits are needed to represent
 the number 1000 ?
 yeah u r right - 10 bits

 so here is the solution
 let if any prisoner alive it mean it doesnt die and it will be represented
 by 1 else if he dies then he will be represented by 0
 number the prisoners from 0-9 with 0 the right most (LSB)
 now what will be binary representation of 0 ? 00
 so if 0th bottle is poisoned then all prisoners must die so taste the
 0th(actually 1st) wine to all the prisoners.
 what is binary representation of 1? 01
 so taste the 1st(actually 2nd) wine to all except the 0th prisoner.
 for 2nd, all except 1st (considering 0th as lowest bit) one

 and so on.
 so at the end if suppose 6th and 2nd prisoner(consider 0 min and 9 max)
 left alive then answer will be :- 1*2^5+1*2^1 +1  (note:- here ^= power)


 if anyone have more general solution pls let me know

 *I hope this is useful  :) :)*



 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Thank You
Rajeev Kumar

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle and solution

2011-07-22 Thread sagar pareek
thanks
its almost same  :)
i was hoping for a diff answer (if exists)

On Fri, Jul 22, 2011 at 4:25 PM, Rajeev Kumar rajeevprasa...@gmail.comwrote:

 Please check this : http://www.techinterview.org/post/526313890/bad-king

 On Tue, Jul 19, 2011 at 8:43 PM, sagar pareek sagarpar...@gmail.comwrote:

 hey guys pls tell any other better solution ...


 On Tue, Jul 19, 2011 at 6:41 PM, sagar pareek sagarpar...@gmail.comwrote:

 Question :-



 Once upon a time in ancient times there was a king who was very fond of
 wines.  He had a huge cellar, which had 1000 different varieties of wine
 all in different caskets (1000 caskets in all).  In the adjoining
 kingdom there was a queen who was envious of the king’s huge wine
 collection.  After some time when she could not bear it any more she
 conspired to kill her by poisoning all his wine caskets.  So she one
 sentry to poison all the caskets, but no sooner had the sentry poisoned only
 one wine casket that he was caught and killed by the Royal guards.  Now
 the king had a major problem in his hand so as to identify the right casket,
 which he gave to the Minister.  Now the position had two peculiar
 qualities



  Anyone who takes even one drop of poison will die.

  But, he will die only after one month.



  The king also gave the Minister 10 prisoners who could be used
 as tasters, cause there lives was of no consequence to the king of kingdom
 for that matter, and the Minister was given one month to find the poisoned
 casket.  Is it possible for the Minister to find out in one month?  If
 so how? If not then how many months are required?





 My solution :-

 This can be done in one month

 Think the solution in binary

 ok first i wanna ask u a question :- how many bits are needed to
 represent the number 1000 ?
 yeah u r right - 10 bits

 so here is the solution
 let if any prisoner alive it mean it doesnt die and it will be
 represented by 1 else if he dies then he will be represented by 0
 number the prisoners from 0-9 with 0 the right most (LSB)
 now what will be binary representation of 0 ? 00
 so if 0th bottle is poisoned then all prisoners must die so taste the
 0th(actually 1st) wine to all the prisoners.
 what is binary representation of 1? 01
 so taste the 1st(actually 2nd) wine to all except the 0th prisoner.
 for 2nd, all except 1st (considering 0th as lowest bit) one

 and so on.
 so at the end if suppose 6th and 2nd prisoner(consider 0 min and 9 max)
 left alive then answer will be :- 1*2^5+1*2^1 +1  (note:- here ^= power)


 if anyone have more general solution pls let me know

 *I hope this is useful  :) :)*



 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Thank You
 Rajeev Kumar

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-07-17 Thread Tushar Bindal
thanks sagar for this wonderful shortcut

but can you please explain it better. in what cases can we use this
approach?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-07-17 Thread sagar pareek
Well you can find it in WILLIAM STALLINGS's book of cryptography.
or foundation of cryptography by wenbo mao   :) :)

On Sun, Jul 17, 2011 at 9:02 PM, Tushar Bindal tushicom...@gmail.comwrote:

 thanks sagar for this wonderful shortcut

 but can you please explain it better. in what cases can we use this
 approach?

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-07-17 Thread Tushar Bindal
thankyou :)

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-07-12 Thread sagar pareek
@Tushar Bindal
No need of long calculations :)
here is a shortcut, actually in O(1) time :)
for calculating chances of any two entities to collide in given different
species is just take underoot of it.
here underoot of 365 is approx 19.he he enjoy the solution.
For more details just go through cryptographic mathematics :)

On Thu, Jul 7, 2011 at 11:47 PM, Tushar Bindal tushicom...@gmail.comwrote:

 Sory once again for that incomplete answer.
 The complete one is here.

 probability that i win standing at second position: 1/365
 probability that i win standing at third position : 364/365*2/365 =
 1/365)*(628/365)
 probability that i win standing at fourth position : 364/365*363/365*3/365
 probability that i win standing at 4th position :
 364/365*363/365*362/365*4/365

 probability that i win standing at (n+1)th position:
 (365-1)*(365-2)*(365-3)*(365-
 4)*(365-5).*(365-(n-2))*(365-(n-1))*(n)*(1/365)^n

 there is a pattern in the probabilities
 let probability of winning standing at nth position be x
 probability of winning standing at (n+1)th position = x * {(365 - n
 +1)*(n)} / {365*(n-1)}

 maximum probability is at nth position if at (n+1)th position,
 {(365 - n +1)*(n)} / {365*(n-1)}  =  1

 This is true for n=20

 For n=19,
 {(365 - n +1)*(n)} / {365*(n-1)}1

 So max probability is when *n=19*
 i.e., n+1 = 20, which is my position.

 So standing at 20th position gives me maximum chance of winning


 Just hope I haven't got anything wrong here.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-07-09 Thread Decipher
This question was asked by ST micro for hiring intern in my college . Here's 
the solution :
Let the bottles of alcohol named 0 to 5 then - 

No.Binary Value
00 0 0
10 0 1
20 1 0
30 1 1
41 0 0
51 0 1

Mice - a b c

Now make the mice drink alcohol from bottle having 1 at corresponding 
position like *a* has drunk from bottle 4 and 5 ; and so on ... 

IF mice a and c died then poison is in bottle no. 5 
IF b and c died then bottle - 3
and so on ... 

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/31hmybxB0mUJ.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-07-07 Thread swetha rahul
Got it...Thanks..

On Wed, Jul 6, 2011 at 11:31 PM, shiv narayan narayan.shiv...@gmail.comwrote:

 speed of river=(distance traveled by object in it) / total time it
 took to travel

 here hat has traveled a distance of 1 KM
 and it has taken =5mn+5 min=10 min=10min/60=1/6 hrs;
 so speed = 1/(1/6)=6km/hr

 On Jul 6, 9:28 pm, Tushar Bindal tushicom...@gmail.com wrote:
  Let speed of boat be x miles/hr
  Let speed of river be s miles/hr
 
  First Method:
  Hat comes down 1 mile in 10 minutes.
  Hat comes with flow of river only. So its speed is equal to speed of
 river.
  In 60 minutes, it will travel 6 miles.
  thus, s = 6 miles/hr
 
  Second Method:
  Distance travelled upward by boat = 1 + (5/60)*(x-s) miles
  Distance travelled downward by boat = (5/60)*(x+s) miles
  Both are same, so
  1 + (5/60)*(x-s) = (5/60)*(x+s)
  x gets cancelled, and we have
  s/6 = 1
  s = 6 miles/hr
 
  Second method is just one possible method which nobody would like to
 follow.
  First one is easier and faster - win-win situation
  For a change the easier method is faster as well
  --
  Tushar Bindal
  Computer Engineering
  Delhi College of Engineering
  Mob: +919818442705
  E-Mail : tushicom...@gmail.com
  Website:www.jugadengg.com

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-07-07 Thread Tushar Bindal
probability that i win standing at second position: 1/365
third position : 364/365*2/365 = 1/365)*(628/365)
fourth position : 364/365*363/365*3/365
4th : 364/365*363/365*362/365*4/365

nth position:
(365-1)*(365-2)*(365-3)*(365-4)*(365-5).*(365-(n-2))*(365-(n-1))*(n)*(1/365)^n

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-07-07 Thread Tushar Bindal
Sorry for the previous post
the last line was incorrect
it should have been (n+1)th position

I was just writing roughly and pressed send instead of save.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-07-07 Thread Tushar Bindal
probability that i win standing at second position: 1/365
probability that i win standing at third position : 364/365*2/365 =
1/365)*(628/365)
probability that i win standing at fourth position : 364/365*363/365*3/365
probability that i win standing at 4th position :
364/365*363/365*362/365*4/365

probability that i win standing at (n+1)th position:
(365-1)*(365-2)*(365-3)*(365-4)*(365-5).*(365-(n-2))*(365-(n-1))*(n)*(1/365)^n

there is a pattern in the probabilities
let probability of winning standing at nth position be x
probability of winning standing at (n+1)th position = x * {(365 - n +1)*(n)}
/ {365*(n-1)}

maximum probability is at nth position if at (n+1)th position,
{(365 - n +1)*(n)} / {365*(n-1)}



-- 
Tushar Bindal
Computer Engineering
Delhi College of Engineering
Mob: +919818442705
E-Mail : tushicom...@gmail.com
Website: www.jugadengg.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-07-07 Thread Tushar Bindal
Sory once again for that incomplete answer.
The complete one is here.
probability that i win standing at second position: 1/365
probability that i win standing at third position : 364/365*2/365 =
1/365)*(628/365)
probability that i win standing at fourth position : 364/365*363/365*3/365
probability that i win standing at 4th position :
364/365*363/365*362/365*4/365

probability that i win standing at (n+1)th position:
(365-1)*(365-2)*(365-3)*(365-
4)*(365-5).*(365-(n-2))*(365-(n-1))*(n)*(1/365)^n

there is a pattern in the probabilities
let probability of winning standing at nth position be x
probability of winning standing at (n+1)th position = x * {(365 - n +1)*(n)}
/ {365*(n-1)}

maximum probability is at nth position if at (n+1)th position,
{(365 - n +1)*(n)} / {365*(n-1)}  =  1

This is true for n=20

For n=19,
{(365 - n +1)*(n)} / {365*(n-1)}1

So max probability is when *n=19*
i.e., n+1 = 20, which is my position.

So standing at 20th position gives me maximum chance of winning


Just hope I haven't got anything wrong here.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-07-07 Thread Sumit chauhan
Ans :- 3
let bottles be1,2,3,4,5,6
and mice be a,b,c.
separate bottle 6
make pairs P(1,2,3) ; Q(2,4) ; R(3,4,5) and given to mice a,b,c resp.
if poison is inbottle  mice who dies
   1 a
   2 a,b
   3 a,c
   4 b,c
   5 c
   6 no mice
hence we have saved any mice to die in 6 case.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-07-06 Thread Tushar Bindal
the solution is given
herehttp://www.thecareerplus.com/?page=resourcescat=150subCat=10qNo=2
but can anyone lease explain it better
please give a original solution

and stop making rude comments about answers posted genuinely.
If you have an original solution, please post it.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-07-06 Thread Aakash Johari
And what about binary search?

On Wed, Jul 6, 2011 at 12:26 PM, 991 guruprakash...@gmail.com wrote:

 Sorry abt the previous post ( and this one ) if it ended up as a spam.
 I just saw the question and left the place. When I finished posting,
 ppl hav already given replies...

 On Jul 7, 12:12 am, 991 guruprakash...@gmail.com wrote:
  Approach 1:
 
  Start from storey 1 and go up. keep dropping one of the eggs. As soon
  at it breaks, return the storey you are in now. No. of drops in the
  worst case: 99
 
  Approach 2:
 
  Split the building into 10 '10 storeyed' parts.
 
  Start Dropping eggs at 10,20,30,...th storey.
  If it breaks at say 40th, use the other egg from 31st storey till 39th
  and return the ans.
 
  No. of drops in worst case: approx. 20
 
  Approach 3:
 
  Why should v divide the building into equal storeyed segments?  Have
  more storeys in lower part of the building and let it come down as we
  go up. How does it help? Well by the nature of our method, if it
  breaks at some 80+ storey (say), we want use the second egg lesser
  number of times that it was when it is in 20th storey or something.
 
  The first egg can be used in this order: 14,27,39,50,60... ( I am
  about to sleep now and I have no energy to find out the exact starting
  number. But I hope that u get the idea.)
 
  Now the same approach can be used once the first egg breaks.
 
  No. of drops in worst case: Approx. 14
 
  More on this problem:  Find an algo for any general number of eggs and
  any general number storeys...
 
  Dont look at the hint below before giving it  a try.
 
  Hint:  DP
 
  On Jul 6, 10:05 pm, shiv narayan narayan.shiv...@gmail.com wrote:
 
 
 
 
 
 
 
   * You are given 2 eggs.
   * You have access to a 100-storey building.
   * Eggs can be very hard or very fragile means it may break if dropped
   from the first
   floor or may not even break if dropped from 100 th floor.Both eggs are
   identical.
 
   * You need to figure out the highest floor of a 100-storey building an
   egg can be
   dropped without breaking.
   * Now the question is how many drops you need to make. You are allowed
   to break 2
   eggs in the process

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
-Aakash Johari
(IIIT Allahabad)

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-07-06 Thread saurabh singh
We have two eggs,so have only two chances of missing.SO its about a
combination of binary and linear search.

On Thu, Jul 7, 2011 at 9:09 AM, Aakash Johari aakashj@gmail.com wrote:

 And what about binary search?

 On Wed, Jul 6, 2011 at 12:26 PM, 991 guruprakash...@gmail.com wrote:

 Sorry abt the previous post ( and this one ) if it ended up as a spam.
 I just saw the question and left the place. When I finished posting,
 ppl hav already given replies...

 On Jul 7, 12:12 am, 991 guruprakash...@gmail.com wrote:
  Approach 1:
 
  Start from storey 1 and go up. keep dropping one of the eggs. As soon
  at it breaks, return the storey you are in now. No. of drops in the
  worst case: 99
 
  Approach 2:
 
  Split the building into 10 '10 storeyed' parts.
 
  Start Dropping eggs at 10,20,30,...th storey.
  If it breaks at say 40th, use the other egg from 31st storey till 39th
  and return the ans.
 
  No. of drops in worst case: approx. 20
 
  Approach 3:
 
  Why should v divide the building into equal storeyed segments?  Have
  more storeys in lower part of the building and let it come down as we
  go up. How does it help? Well by the nature of our method, if it
  breaks at some 80+ storey (say), we want use the second egg lesser
  number of times that it was when it is in 20th storey or something.
 
  The first egg can be used in this order: 14,27,39,50,60... ( I am
  about to sleep now and I have no energy to find out the exact starting
  number. But I hope that u get the idea.)
 
  Now the same approach can be used once the first egg breaks.
 
  No. of drops in worst case: Approx. 14
 
  More on this problem:  Find an algo for any general number of eggs and
  any general number storeys...
 
  Dont look at the hint below before giving it  a try.
 
  Hint:  DP
 
  On Jul 6, 10:05 pm, shiv narayan narayan.shiv...@gmail.com wrote:
 
 
 
 
 
 
 
   * You are given 2 eggs.
   * You have access to a 100-storey building.
   * Eggs can be very hard or very fragile means it may break if dropped
   from the first
   floor or may not even break if dropped from 100 th floor.Both eggs are
   identical.
 
   * You need to figure out the highest floor of a 100-storey building an
   egg can be
   dropped without breaking.
   * Now the question is how many drops you need to make. You are allowed
   to break 2
   eggs in the process

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 -Aakash Johari
 (IIIT Allahabad)





  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-07-06 Thread Aakash Johari
How AP(ans=14) solution is satisfying the constraints?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-27 Thread Bhavesh agrawal
only ONE mouse ...consume each sample of bottles of bear with a difference
of one hour

and calculate time..


sry if is thr any stupidity in this answer..but i think it may be right

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-27 Thread sunny agrawal
@Bhavesh

NO there is No stupity
just a mistake in reading the question

mice die within 14 hrs.Not exactly 14 hours :)

3 is correct answer.

On Mon, Jun 27, 2011 at 10:51 PM, Bhavesh agrawal agr.bhav...@gmail.comwrote:

 only ONE mouse ...consume each sample of bottles of bear with a difference
 of one hour

 and calculate time..


 sry if is thr any stupidity in this answer..but i think it may be right

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Sunny Aggrawal
B-Tech IV year,CSI
Indian Institute Of Technology,Roorkee

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-27 Thread Bhavesh agrawal
ok , yeah 3 is the correct answer ..

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread Arpit Sood
4
@amit what's the answer ?

On Mon, Jun 27, 2011 at 12:40 AM, shiv narayan narayan.shiv...@gmail.comwrote:

 can u please explain how is it 3?

 On Jun 26, 11:18 pm, D.N.Vishwakarma@IITR  deok...@gmail.com
 wrote:
  3 mice .
 
  On Sun, Jun 26, 2011 at 6:13 PM, ArPiT BhAtNaGaR 
 
 
 
 
 
 
 
 
 
  arpitbhatnagarm...@gmail.com wrote:
   3
 
   On Mon, Jun 27, 2011 at 2:10 AM, amit the cool 
 amitthecoo...@gmail.comwrote:
 
   There are 6 beer bottle nd one is poisoned. we have mice who will die
   within 14 hrs after drinkin poisned beer. In 24 hrs we have to find
   poisoned beer bottle. How many no of mice we require to find out
   poisoned bottle.
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   Thanks  Regards
 
   Arpit Bhatnagar
   (Computer Engineering)
   (MNIT JAIPUR)
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
  --
  **With Regards
  Deoki Nandan Vishwakarma
  IITR MCA
  *
  *

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Regards,
Arpit Sood

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread Ankit Agarwal
3

think in binary.. :)


On Mon, Jun 27, 2011 at 12:56 AM, Arpit Sood soodfi...@gmail.com wrote:

 4
 @amit what's the answer ?


 On Mon, Jun 27, 2011 at 12:40 AM, shiv narayan 
 narayan.shiv...@gmail.comwrote:

 can u please explain how is it 3?

 On Jun 26, 11:18 pm, D.N.Vishwakarma@IITR  deok...@gmail.com
 wrote:
  3 mice .
 
  On Sun, Jun 26, 2011 at 6:13 PM, ArPiT BhAtNaGaR 
 
 
 
 
 
 
 
 
 
  arpitbhatnagarm...@gmail.com wrote:
   3
 
   On Mon, Jun 27, 2011 at 2:10 AM, amit the cool 
 amitthecoo...@gmail.comwrote:
 
   There are 6 beer bottle nd one is poisoned. we have mice who will die
   within 14 hrs after drinkin poisned beer. In 24 hrs we have to find
   poisoned beer bottle. How many no of mice we require to find out
   poisoned bottle.
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   Thanks  Regards
 
   Arpit Bhatnagar
   (Computer Engineering)
   (MNIT JAIPUR)
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
  --
  **With Regards
  Deoki Nandan Vishwakarma
  IITR MCA
  *
  *

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Regards,
 Arpit Sood

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Ankit Agarwal
B.Tech. Senior Year
Computer Science  Engineering
IIT Rajasthan

*Be the change that you want to see in the world... :)*
*- Gandhiji*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread D.N.Vishwakarma@IITR
first make two group of 3 bottle each
one mice for each group
make mixture of 3 bottle and put for mice .
do same for other group
only one mice will die
. then select group of dead mice .
beak it into three group
one bottle each
now we can use old mice which is not dead and one more for two bottle
and which is going to die
if no one then rest bottle out of three will be poisoned beer bottle

On Mon, Jun 27, 2011 at 12:56 AM, Arpit Sood soodfi...@gmail.com wrote:

 4
 @amit what's the answer ?


 On Mon, Jun 27, 2011 at 12:40 AM, shiv narayan 
 narayan.shiv...@gmail.comwrote:

 can u please explain how is it 3?

 On Jun 26, 11:18 pm, D.N.Vishwakarma@IITR  deok...@gmail.com
 wrote:
  3 mice .
 
  On Sun, Jun 26, 2011 at 6:13 PM, ArPiT BhAtNaGaR 
 
 
 
 
 
 
 
 
 
  arpitbhatnagarm...@gmail.com wrote:
   3
 
   On Mon, Jun 27, 2011 at 2:10 AM, amit the cool 
 amitthecoo...@gmail.comwrote:
 
   There are 6 beer bottle nd one is poisoned. we have mice who will die
   within 14 hrs after drinkin poisned beer. In 24 hrs we have to find
   poisoned beer bottle. How many no of mice we require to find out
   poisoned bottle.
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   Thanks  Regards
 
   Arpit Bhatnagar
   (Computer Engineering)
   (MNIT JAIPUR)
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
  --
  **With Regards
  Deoki Nandan Vishwakarma
  IITR MCA
  *
  *

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Regards,
 Arpit Sood

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
**With Regards
Deoki Nandan Vishwakarma
IITR MCA
*
*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread Arpit Sood
you cant use the old mouse again because time he has mentioned is 14
hours... so you will have to wait for another 14 hours which exceeds the
given time limit of 24 hours... so it is 4.

On Mon, Jun 27, 2011 at 1:00 AM, D.N.Vishwakarma@IITR deok...@gmail.comwrote:

 first make two group of 3 bottle each
 one mice for each group
 make mixture of 3 bottle and put for mice .
 do same for other group
 only one mice will die
 . then select group of dead mice .
 beak it into three group
 one bottle each
 now we can use old mice which is not dead and one more for two bottle
 and which is going to die
 if no one then rest bottle out of three will be poisoned beer bottle

 On Mon, Jun 27, 2011 at 12:56 AM, Arpit Sood soodfi...@gmail.com wrote:

 4
 @amit what's the answer ?


 On Mon, Jun 27, 2011 at 12:40 AM, shiv narayan narayan.shiv...@gmail.com
  wrote:

 can u please explain how is it 3?

 On Jun 26, 11:18 pm, D.N.Vishwakarma@IITR  deok...@gmail.com
 wrote:
  3 mice .
 
  On Sun, Jun 26, 2011 at 6:13 PM, ArPiT BhAtNaGaR 
 
 
 
 
 
 
 
 
 
  arpitbhatnagarm...@gmail.com wrote:
   3
 
   On Mon, Jun 27, 2011 at 2:10 AM, amit the cool 
 amitthecoo...@gmail.comwrote:
 
   There are 6 beer bottle nd one is poisoned. we have mice who will
 die
   within 14 hrs after drinkin poisned beer. In 24 hrs we have to find
   poisoned beer bottle. How many no of mice we require to find out
   poisoned bottle.
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
   --
   Thanks  Regards
 
   Arpit Bhatnagar
   (Computer Engineering)
   (MNIT JAIPUR)
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.
 
  --
  **With Regards
  Deoki Nandan Vishwakarma
  IITR MCA
  *
  *

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Regards,
 Arpit Sood

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 **With Regards
 Deoki Nandan Vishwakarma
 IITR MCA
 *
 *

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Regards,
Arpit Sood

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread Arpit Sood
thanks dave.

On Mon, Jun 27, 2011 at 1:07 AM, Dave dave_and_da...@juno.com wrote:

 3 Mice: Call them mouse #1, mouse #2, and mouse #4 (think binary
 code).
 Give mouse #1 a mixture of bottles 1, 3, and 5.
 Give mouse #2 a mixture of bottles 2, 3, and 6.
 Give mouse #4 a mixture of bottles 4, 5, and 6.
 Add up the numbers of the mice that die to get the number of the
 poisoned beer bottle.

 Dave

 On Jun 26, 1:10 pm, amit the cool amitthecoo...@gmail.com wrote:
  There are 6 beer bottle nd one is poisoned. we have mice who will die
  within 14 hrs after drinkin poisned beer. In 24 hrs we have to find
  poisoned beer bottle. How many no of mice we require to find out
  poisoned bottle.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Regards,
Arpit Sood

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread harshit pahuja
hw u r gettin  3
i m gettin 4

mine is make 4 grups

1,2,6  no 1
 2,3,5 no 2
1,3,4  no 3
4,5,6no 4


nw out of 4 2 mice will die,and in their corresponding groups common bottle
will give you the answer.

correct me if i am wrong

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread udit sharma
@Harshit: Check dave's solution... U'll get ur ans :)

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread harshit pahuja
i got it :)

nice @dev!!

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread hary rathor
5 mice:
result time complete
bottle to mice1: 14 hour
after 2.5 hour to mice2 : 16.5 hour
after 2.5 hour to mice3 : 19 hour
after 2.5 hour to mice4 : 21.5 hour
after 2.5 hour to mice5 : 24 hour


one of these 5 mice will die within 24 hour
otherwise definitely 6th bottle  is Poisson .

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: puzzle

2011-06-26 Thread amit kumar
hey harry.what r u upto?
guys have already shown that answer is three

On Mon, Jun 27, 2011 at 4:45 AM, hary rathor harry.rat...@gmail.com wrote:

 5 mice:
 result time complete
 bottle to mice1: 14 hour
 after 2.5 hour to mice2 : 16.5 hour
 after 2.5 hour to mice3 : 19 hour
 after 2.5 hour to mice4 : 21.5 hour
 after 2.5 hour to mice5 : 24 hour


 one of these 5 mice will die within 24 hour
 otherwise definitely 6th bottle  is Poisson .

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-06-10 Thread Kunal Patil
@ross: seems logically correct..nice solution..

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-05-27 Thread Rishabh Maurya
No , you are wrong  ..  problem statement says how many matches should a
teams win to ensure its qualification , their no word like minimum or
maximum  ...
8 gets wrong if following situation arises

1 - 9
2 - 9
3 - 9
4 - 9
5 - 8
6 - 6
7 - 4
8 - 2

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-05-27 Thread Arpit Mittal
@rishabh :

in your solution u have taken scores of last 4 teams as 6 4 2 0. what if i
take 2 2 2 2 then the ans would be 56-(2+2+2+2)/4 = 12...!!!

and i can also take the scores of last 4 teams as 6 4 4 2 then the ans would
be
56-(6+4+4+2)/4 = 10!!!

so how you can say it would be 11?



On Fri, May 27, 2011 at 6:52 AM, Rishabh Maurya poofiefoo...@gmail.comwrote:

 No , you are wrong  ..  problem statement says how many matches should a
 teams win to ensure its qualification , their no word like minimum or
 maximum  ...
 8 gets wrong if following situation arises

 1 - 9
 2 - 9
 3 - 9
 4 - 9
 5 - 8
 6 - 6
 7 - 4
 8 - 2


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
-Arpit Mittal
6th Semester,
Indian Institute of Information Technology,Allahabad
Email : arpitmittal.ii...@gmail.com
   rit2008...@iiita.ac.in
Contact : +91-8853049787

Let every man be respected as an individual and no man idolized.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-05-27 Thread Arpit Mittal
@rishabh : now i understand it better... thanks :)


On Fri, May 27, 2011 at 7:22 AM, Rishabh Maurya poofiefoo...@gmail.comwrote:

 because we want upper 4 teams to win maximum matches altogether    so
 to satisfy this criteria  ..  last team should win 0 , and team 7 must have
 lost all its matches except from team 8  , so it wins 2 and similarly team 6
 wins 4 and team 5 wins 6 .

 don't forget to watch   MI vs RCB .. :)

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
-Arpit Mittal
6th Semester,
Indian Institute of Information Technology,Allahabad
Email : arpitmittal.ii...@gmail.com
   rit2008...@iiita.ac.in
Contact : +91-8853049787

Let every man be respected as an individual and no man idolized.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-05-27 Thread Arpit Mittal
@Vishwakarma

it is now ok that 11 should be the answer, but why any 4 teams cannot win 12
matches in total...

for that they have to score 12*4 = 48 points out of 56. then wats the
problem.

i know how it is coming 11 now, but i am replying back for the doubt i have
in a line u just mentioned in your post... :)


On Fri, May 27, 2011 at 7:23 AM, vishwakarma vishwakarma.ii...@gmail.comwrote:

 @Arpit 

 Any four team cannot win 12 matches in total.
 ...Rishabh is wid right answer that is (  11  ).

 Hence any team winning its any 11 out of 14 matches ensures its entry
 to semis.
 But not below 11 its entry to semi will depend on other team
 performance.


 On May 27, 7:11 pm, Arpit Mittal mrmittalro...@gmail.com wrote:
  @rishabh :
 
  in your solution u have taken scores of last 4 teams as 6 4 2 0. what if
 i
  take 2 2 2 2 then the ans would be 56-(2+2+2+2)/4 = 12...!!!
 
  and i can also take the scores of last 4 teams as 6 4 4 2 then the ans
 would
  be
  56-(6+4+4+2)/4 = 10!!!
 
  so how you can say it would be 11?
 
  On Fri, May 27, 2011 at 6:52 AM, Rishabh Maurya poofiefoo...@gmail.com
 wrote:
 
 
 
 
 
 
 
 
 
   No , you are wrong  ..  problem statement says how many matches should
 a
   teams win to ensure its qualification , their no word like minimum or
   maximum  ...
   8 gets wrong if following situation arises
 
   1 - 9
   2 - 9
   3 - 9
   4 - 9
   5 - 8
   6 - 6
   7 - 4
   8 - 2
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group. To post to this group, send email
 toalgoge...@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.
 
  --
  -Arpit Mittal
  6th Semester,
  Indian Institute of Information Technology,Allahabad
  Email : arpitmittal.ii...@gmail.com
 rit2008...@iiita.ac.in
  Contact : +91-8853049787
 
  Let every man be respected as an individual and no man idolized.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
-Arpit Mittal
6th Semester,
Indian Institute of Information Technology,Allahabad
Email : arpitmittal.ii...@gmail.com
   rit2008...@iiita.ac.in
Contact : +91-8853049787

Let every man be respected as an individual and no man idolized.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-05-27 Thread Arpit Mittal
@vishwakarma

thanks for rectifying me...
its clear... 12 is not posible, i was in another way :)

On Fri, May 27, 2011 at 7:46 AM, vishwakarma vishwakarma.ii...@gmail.comwrote:

 correction---it was typo mistake ...
 Team  C loses to(one to A and one to B)

 On May 27, 7:44 pm, vishwakarma vishwakarma.ii...@gmail.com wrote:
  so here we go 
 
  Let A loses two of its matches to (one to B and one to C).
  Let B loses two of its matches to(one to A and one to C)
  Then C loses two of its matches to(one to A and one to C).
  Now.
  team D, if it ever plays with (A,B,C) will loses..hence minimum number
  o matches it is going to loses is 6.
 
  Hence, D could only won 8 matches...
  A--12
  B--12
  C--12
  D--8
  The same thing goes to if the above team instead of loosing its two
  matches to two different team loses to a same team.
  Hence (12,12,12,12) cannot be feasible !!!
 
  I hope it is clear.
 
  On May 27, 7:27 pm, Arpit Mittal mrmittalro...@gmail.com wrote:
 
 
 
 
 
 
 
   @Vishwakarma
 
   it is now ok that 11 should be the answer, but why any 4 teams cannot
 win 12
   matches in total...
 
   for that they have to score 12*4 = 48 points out of 56. then wats the
   problem.
 
   i know how it is coming 11 now, but i am replying back for the doubt i
 have
   in a line u just mentioned in your post... :)
 
   On Fri, May 27, 2011 at 7:23 AM, vishwakarma 
 vishwakarma.ii...@gmail.comwrote:
 
@Arpit 
 
Any four team cannot win 12 matches in total.
...Rishabh is wid right answer that is (  11  ).
 
Hence any team winning its any 11 out of 14 matches ensures its entry
to semis.
But not below 11 its entry to semi will depend on other team
performance.
 
On May 27, 7:11 pm, Arpit Mittal mrmittalro...@gmail.com wrote:
 @rishabh :
 
 in your solution u have taken scores of last 4 teams as 6 4 2 0.
 what if
i
 take 2 2 2 2 then the ans would be 56-(2+2+2+2)/4 = 12...!!!
 
 and i can also take the scores of last 4 teams as 6 4 4 2 then the
 ans
would
 be
 56-(6+4+4+2)/4 = 10!!!
 
 so how you can say it would be 11?
 
 On Fri, May 27, 2011 at 6:52 AM, Rishabh Maurya 
 poofiefoo...@gmail.com
wrote:
 
  No , you are wrong  ..  problem statement says how many matches
 should
a
  teams win to ensure its qualification , their no word like
 minimum or
  maximum  ...
  8 gets wrong if following situation arises
 
  1 - 9
  2 - 9
  3 - 9
  4 - 9
  5 - 8
  6 - 6
  7 - 4
  8 - 2
 
   --
  You received this message because you are subscribed to the
 Google
GroupsAlgorithm Geeks group. To post to this group, send
 emailtoalgoge...@googlegroups.com.To unsubscribe from this group,
 send email toalgogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.
 
 --
 -Arpit Mittal
 6th Semester,
 Indian Institute of Information Technology,Allahabad
 Email : arpitmittal.ii...@gmail.com
rit2008...@iiita.ac.in
 Contact : +91-8853049787
 
 Let every man be respected as an individual and no man idolized.
 
--
You received this message because you are subscribed to the Google
 Groups  Algorithm Geeks group. To post to this group, send
 emailtoalgoge...@googlegroups.com.  To unsubscribe from this group, send
 email toalgogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
   --
   -Arpit Mittal
   6th Semester,
   Indian Institute of Information Technology,Allahabad
   Email : arpitmittal.ii...@gmail.com
  rit2008...@iiita.ac.in
   Contact : +91-8853049787
 
   Let every man be respected as an individual and no man idolized.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
-Arpit Mittal
6th Semester,
Indian Institute of Information Technology,Allahabad
Email : arpitmittal.ii...@gmail.com
   rit2008...@iiita.ac.in
Contact : +91-8853049787

Let every man be respected as an individual and no man idolized.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: PUZZLE

2011-05-22 Thread Wladimir Tavares
Consider the following scenario:
On the first trip, the elephant carries 1000 bananas. the elephant walk 250
km consuming 250 bananas  left in position 250 (500 bananas). After that, he
goes back over 250 Km eating more bananas 250 bananas. On the second trip,
the elephant carries 1000 bananas again, walk 250 km, carrying over 250
bananas and arrives at B with 250 bananas. More he can not go back just
because  finish bananas.
ok?
Wladimir Araujo Tavares
*Federal University of Ceará

*




On Sat, May 21, 2011 at 1:27 AM, Dave dave_and_da...@juno.com wrote:

 @Wladimir: According to the problem statement, the elephant starts out
 with 3,000 bananas. I am saying that the elephant can deliver 534
 bananas to the destination 1,000 km away.

 Dave

 On May 20, 7:22 pm, Wladimir Tavares wladimir...@gmail.com wrote:
  with 534 , the elephant can travel only 534 Km! I am right?
  Wladimir Araujo Tavares
  *Federal University of Ceará
 
  *
 
 
 
  On Fri, May 20, 2011 at 8:36 PM, Dave dave_and_da...@juno.com wrote:
   Upon reading the problem more carefully, the answer is 534 bananas,
   not 533-1/3.
 
   Dave
 
   On May 20, 3:43 pm, Dave dave_and_da...@juno.com wrote:
@Bhavesh: 533-1/3.
 
Dave
 
On May 20, 10:47 am, Bhavesh agrawal agr.bhav...@gmail.com wrote:
 
 1 elephant can take 1000 banana at a time and eat 1 banana after
 each
   1km
 travel.
 total bananas are 3000 and distance have to travel from A to B is
   1000km.
 
 So how many max bananas he can take from A to B.   (he'll eat in
 return
 travel  too)- Hide quoted text -
 
- Show quoted text -
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: PUZZLE

2011-05-22 Thread Wladimir Tavares
Brute-force algorithm with memoization for this problem!

/*
Autor: Wladimir Araújo Tavares
*/
#include stdio.h
#include stdlib.h
#include math.h
#include string.h
#define min(a,b) ab?a:b
#define max(a,b) ab?a:b
int memo[3001][1001];
int banana(int V, int D){
int total;
int j;
int temp;
if(V  D) return 0;
if(memo[V][D]!=-1) return memo[V][D];
//one travel
if(V1000)
total = 1000 - D;
else
  total = V-D;
//more than one
if(V1000){
temp = banana(V-1000, D) + 1000-2*D;
}else{
temp = V-D;
}
total = max(total, temp);
//cache
for(j=1;jD;j++){
temp = banana(banana(V,j),D-j);
if(temp  total)
  total = temp;
}
memo[V][D] = total;
return total;

}
int main(){
int x,i,j;
for(i=1;i=3000;i++)
  for(j=1;j=1000;j++)
memo[i][j] = -1;
while(1){
scanf(%d,x);
printf(%d\n,banana(3000,x));
}
  return 0;
}



Wladimir Araujo Tavares
*Federal University of Ceará

*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: PUZZLE

2011-05-22 Thread Wladimir Tavares
@ Dave: Disregard what I wrote!!


The algorithm that I developed after works as follows:
We can recursively define the maximum number of bananas brought by the
elephant by D km starting with V bananas:

banana (V, D) = max (V-D,
 banana (V - min (V, 1000), D) + min (V,
1000) -2 * D)
 banana (banana (V, j), D-j), 1 = j D

As the number of recursive calls is quite large, memorize a few values​​.

Some values ​​calculated by the algorithm
banana (initial D)
banana (3000,100) = 2500
banana (3000,200) = 2000
banana (3000,300) = 1700
banana (3000,400) = 1.400
banana (3000,500) = 1100
banana (3000,600) = 933
banana (3000,700) = 833
banana (3000,800) = 733
banana (3000,900) = 633
banana (3000,1000) = 533

Wladimir Araujo Tavares
*Federal University of Ceará

*




On Sun, May 22, 2011 at 4:04 PM, Dave dave_and_da...@juno.com wrote:

 @Wladimir: I don't understand what you are saying. If the first cache
 of bananas is established x km from the starting spot, with x = 500,
 the elephant can deliver 3,000 - 5*x bananas to that cache. In your
 case, x = 250, so the elephant can deliver 1,750 bananas.

 Dave

 On May 20, 11:56 pm, Wladimir Tavares wladimir...@gmail.com wrote:
  Consider the following scenario:
  On the first trip, the elephant carries 1000 bananas. the elephant walk
 250
  km consuming 250 bananas  left in position 250 (500 bananas). After that,
 he
  goes back over 250 Km eating more bananas 250 bananas. On the second
 trip,
  the elephant carries 1000 bananas again, walk 250 km, carrying over 250
  bananas and arrives at B with 250 bananas. More he can not go back just
  because  finish bananas.
  ok?
  Wladimir Araujo Tavares
  *Federal University of Ceará
 
  *
 
 
 
  On Sat, May 21, 2011 at 1:27 AM, Dave dave_and_da...@juno.com wrote:
   @Wladimir: According to the problem statement, the elephant starts out
   with 3,000 bananas. I am saying that the elephant can deliver 534
   bananas to the destination 1,000 km away.
 
   Dave
 
   On May 20, 7:22 pm, Wladimir Tavares wladimir...@gmail.com wrote:
with 534 , the elephant can travel only 534 Km! I am right?
Wladimir Araujo Tavares
*Federal University of Ceará
 
*
 
On Fri, May 20, 2011 at 8:36 PM, Dave dave_and_da...@juno.com
 wrote:
 Upon reading the problem more carefully, the answer is 534 bananas,
 not 533-1/3.
 
 Dave
 
 On May 20, 3:43 pm, Dave dave_and_da...@juno.com wrote:
  @Bhavesh: 533-1/3.
 
  Dave
 
  On May 20, 10:47 am, Bhavesh agrawal agr.bhav...@gmail.com
 wrote:
 
   1 elephant can take 1000 banana at a time and eat 1 banana
 after
   each
 1km
   travel.
   total bananas are 3000 and distance have to travel from A to B
 is
 1000km.
 
   So how many max bananas he can take from A to B.   (he'll eat
 in
   return
   travel  too)- Hide quoted text -
 
  - Show quoted text -
 
 --
 You received this message because you are subscribed to the Google
   Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.-Hide quoted text -
 
- Show quoted text -
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: PUZZLE

2011-05-21 Thread Anders Ma
1) go to 1000/3 with 1000 babanas, reserves 1000/3 at 1000/3 position
2) same as 1)

now there are 2000/3 bananas at 1000/3 position.

3) go to 1000/3 position with 1000 babanas, then there are (2000/3 +
1000 - 1000/3) = 4000/3 babanas
4) go to (1000/3 + (4000/3 -1000)/3) = 4000/9 position with 1000 bananas
4) go ahead and finally have (1000 -  (1000 - 4000/9)) = 4000/9 = 444.44

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: PUZZLE

2011-05-20 Thread amit kumar
533

On Sat, May 21, 2011 at 2:13 AM, Dave dave_and_da...@juno.com wrote:

 @Bhavesh: 533-1/3.

 Dave

 On May 20, 10:47 am, Bhavesh agrawal agr.bhav...@gmail.com wrote:
  1 elephant can take 1000 banana at a time and eat 1 banana after each 1km
  travel.
  total bananas are 3000 and distance have to travel from A to B is 1000km.
 
  So how many max bananas he can take from A to B.   (he'll eat in return
  travel  too)

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: PUZZLE

2011-05-20 Thread Wladimir Tavares
with 534 , the elephant can travel only 534 Km! I am right?
Wladimir Araujo Tavares
*Federal University of Ceará

*




On Fri, May 20, 2011 at 8:36 PM, Dave dave_and_da...@juno.com wrote:

 Upon reading the problem more carefully, the answer is 534 bananas,
 not 533-1/3.

 Dave

 On May 20, 3:43 pm, Dave dave_and_da...@juno.com wrote:
  @Bhavesh: 533-1/3.
 
  Dave
 
  On May 20, 10:47 am, Bhavesh agrawal agr.bhav...@gmail.com wrote:
 
 
 
   1 elephant can take 1000 banana at a time and eat 1 banana after each
 1km
   travel.
   total bananas are 3000 and distance have to travel from A to B is
 1000km.
 
   So how many max bananas he can take from A to B.   (he'll eat in return
   travel  too)- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: PUZZLE

2011-05-20 Thread anuj agarwal
@Dave: The problem statement says, the elephant can take 1000 at a time.
If he take max 1000, and eat 1 banana in each 1 km travel, he will be having
0 after 1000 Km.

Anuj Agarwal

Engineering is the art of making what you want from things you can get.


On Sat, May 21, 2011 at 9:57 AM, Dave dave_and_da...@juno.com wrote:

 @Wladimir: According to the problem statement, the elephant starts out
 with 3,000 bananas. I am saying that the elephant can deliver 534
 bananas to the destination 1,000 km away.

 Dave

 On May 20, 7:22 pm, Wladimir Tavares wladimir...@gmail.com wrote:
  with 534 , the elephant can travel only 534 Km! I am right?
  Wladimir Araujo Tavares
  *Federal University of Ceará
 
  *
 
 
 
  On Fri, May 20, 2011 at 8:36 PM, Dave dave_and_da...@juno.com wrote:
   Upon reading the problem more carefully, the answer is 534 bananas,
   not 533-1/3.
 
   Dave
 
   On May 20, 3:43 pm, Dave dave_and_da...@juno.com wrote:
@Bhavesh: 533-1/3.
 
Dave
 
On May 20, 10:47 am, Bhavesh agrawal agr.bhav...@gmail.com wrote:
 
 1 elephant can take 1000 banana at a time and eat 1 banana after
 each
   1km
 travel.
 total bananas are 3000 and distance have to travel from A to B is
   1000km.
 
 So how many max bananas he can take from A to B.   (he'll eat in
 return
 travel  too)- Hide quoted text -
 
- Show quoted text -
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@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.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-01-28 Thread saurabh gupta
up vote to
9 + 1 + 1/9

On Thu, Jan 27, 2011 at 6:06 PM, sunny agrawal sunny816.i...@gmail.comwrote:

 another one
 9*(1+ 1/9)


 On Thu, Jan 27, 2011 at 5:40 PM, nhkrishna2...@yahoo.com 
 nhkrishna2...@gmail.com wrote:

 9+1+1/9



 On Jan 27, 4:43 pm, ankit agarwal ankitgeniu...@gmail.com wrote:
  (9*9-1)/(9-1)
 
 
 
  On Thu, Jan 27, 2011 at 4:55 PM, nishaanth nishaant...@gmail.com
 wrote:
   (91-1)/9
 
   On Wed, Jan 26, 2011 at 11:07 PM, Apoorve Mohan 
 apoorvemo...@gmail.comwrote:
 
   9 + 1 - ( 1 / 9 )
 
   On Wed, Jan 26, 2011 at 10:29 PM, satish satish@gmail.com
 wrote:
 
   19-(9/1).
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 algogeeks%2bunsubscr...@googlegroups.comalgogeeks%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
   --
   regards
 
   Apoorve Mohan
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 algogeeks%2bunsubscr...@googlegroups.comalgogeeks%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
   --
   S.Nishaanth,
   Computer Science and engineering,
   IIT Madras.
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 algogeeks%2bunsubscr...@googlegroups.comalgogeeks%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
  Ankit Agarwal
  B.Tech. 3rd Year
  Computer Science  Engineering
  IIT Rajasthan

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




 --
 Sunny Aggrawal
 B-Tech IV year,CSI
 Indian Institute Of Technology,Roorkee

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Man goes to doctor. Says he's depressed. Says life seems harsh and cruel.
Says he feels all alone in a threatening world where what lies ahead is
vague and uncertain. Doctor says Treatment is simple. Great clown
Pagliacci is in town tonight. Go and see him. That should pick you up. Man
bursts into tears. Says But, doctor...I am Pagliacci.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-01-27 Thread sunny agrawal
another one
9*(1+ 1/9)

On Thu, Jan 27, 2011 at 5:40 PM, nhkrishna2...@yahoo.com 
nhkrishna2...@gmail.com wrote:

 9+1+1/9



 On Jan 27, 4:43 pm, ankit agarwal ankitgeniu...@gmail.com wrote:
  (9*9-1)/(9-1)
 
 
 
  On Thu, Jan 27, 2011 at 4:55 PM, nishaanth nishaant...@gmail.com
 wrote:
   (91-1)/9
 
   On Wed, Jan 26, 2011 at 11:07 PM, Apoorve Mohan 
 apoorvemo...@gmail.comwrote:
 
   9 + 1 - ( 1 / 9 )
 
   On Wed, Jan 26, 2011 at 10:29 PM, satish satish@gmail.com
 wrote:
 
   19-(9/1).
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 algogeeks%2bunsubscr...@googlegroups.comalgogeeks%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
   --
   regards
 
   Apoorve Mohan
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 algogeeks%2bunsubscr...@googlegroups.comalgogeeks%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
   --
   S.Nishaanth,
   Computer Science and engineering,
   IIT Madras.
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 algogeeks%2bunsubscr...@googlegroups.comalgogeeks%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
  Ankit Agarwal
  B.Tech. 3rd Year
  Computer Science  Engineering
  IIT Rajasthan

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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.




-- 
Sunny Aggrawal
B-Tech IV year,CSI
Indian Institute Of Technology,Roorkee

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@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] Re: Puzzle

2011-01-26 Thread abc abc
@neha yeah you can use them as per your choice

On Wed, Jan 26, 2011 at 9:31 PM, Dave dave_and_da...@juno.com wrote:

 9/.9 + 1 - 1

 On Jan 26, 8:12 am, may.I.answer may.i.answ...@gmail.com wrote:
  You have four numbers 1 , 1 , 9 ,9 .
  Now  using these four and operator + , - , * ,/ and parentheses(if
  required) your have to get 10.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@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 algogeeks@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] Re: Puzzle Will Stuck

2011-01-04 Thread ADITYA KUMAR
ankur is right
this problem is similar to the problem of converting a matrix to zero matrix

On Tue, Jan 4, 2011 at 8:36 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:

 how are they similar ?


 On Tue, Jan 4, 2011 at 8:31 PM, jennmeedo jennme...@gmail.com wrote:

 Generalization algorithm for the 8 - queens classical chess problem

 On Jan 4, 5:43 am, bittu shashank7andr...@gmail.com wrote:
  There is a lock which is an N by N grid of switches. Each switch can
  be in one of two states (on/off). The lock is unlocked if all the
  switches are on. The lock is built in such a way that, if you toggle
  some switch, all the switches in its row and its column toggle too
 
  Give an algorithm which, given N and a configuration of the N^2
  switches, will tell you whether the lock can be unlocked by a sequence
  of switch toggles
 
  Note 1: Can be done in O(N^2) time and O(1) space.
  Note 2: You just need to tell if a sequence which unlocks the lock
  exists (and not the actual sequence)

 --
 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.




-- 
Regards
Aditya Kumar
B-tech 3rd year
Computer Science  Engg.
MNNIT, Allahabad.

-- 
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] Re: puzzle

2010-12-31 Thread Vandana Bachani
The ant needs to cover: 9.403 units. It will need to pass the diagonal of
the side (4 by 5) and go up or down the side 3 units.
3+ sqrt(16+25)

On Fri, Dec 31, 2010 at 4:16 PM, bittu shashank7andr...@gmail.com wrote:


 2nd puzzle

 An ant has to crawl from one corner of a room to the diametrically
 opposite corner as quickly as possible. If the dimensions of the room
 are 3 x 4 x 5, what distance does the ant cover?

 --
 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] Re: Puzzle:

2010-06-11 Thread Terence

No need to enumerate all possible states.
In the final state (2,8,5), each jug is neither full nor empty, while 
every valid operation has to fill or empty one jug.
So it is not possible to get this state from any other state by one 
valid operation. (As others said, the state before the final one does 
not exist)



On 2010-6-10 0:35, Dave wrote:

Assuming that the only moves you can make are to pour the contents of
one jug into another until either the source is empty or the
destination is full, the following are the only positions possible:

  0: initial position   (15,0,0)
  1: starting from  0, pour 10 from jug 1 to jug 2, getting (5,10,0)
  2: starting from  0, pour  6 from jug 1 to jug 3, getting (9,0,6)
  3: starting from  1, pour  5 from jug 1 to jug 3, getting (0,10,5)
  4: starting from  1, pour  6 from jug 2 to jug 3, getting (5,4,6)
  5: starting from  2, pour  9 from jug 1 to jug 2, getting (0,9,6)
  6: starting from  2, pour  6 from jug 3 to jug 2, getting (9,6,0)
  7: starting from  3, pour 10 from jug 2 to jug 1, getting (10,0,5)
  8: starting from  4, pour  6 from jug 3 to jug 1, getting (11,4,0)
  9: starting from  5, pour  6 from jug 3 to jug 1, getting (6,9,0)
10: starting from  6, pour  6 from jug 1 to jug 3, getting (3,6,6)
11: starting from  7, pour  5 from jug 3 to jug 2, getting (10,5,0)
12: starting from  8, pour  4 from jug 2 to jug 3, getting (11,0,4)
13: starting from  9, pour  6 from jug 2 to jug 3, getting (6,3,6)
14: starting from 10, pour  4 from jug 3 to jug 2, getting (3,10,2)
15: starting from 11, pour  6 from jug 1 to jug 3, getting (4,5,6)
16: starting from 12, pour 10 from jug 1 to jug 2, getting (1,10,4)
17: starting from 13, pour  6 from jug 3 to jug 1, getting (12,3,0)
18: starting from 14, pour 10 from jug 2 to jug 1, getting (13,0,2)
19: starting from 15, pour  5 from jug 3 to jug 2, getting (4,10,1)
20: starting from 16, pour  2 from jug 2 to jug 3, getting (1,8,6)
21: starting from 17, pour  3 from jug 2 to jug 3, getting (12,0,3)
22: starting from 18, pour  2 from jug 3 to jug 2, getting (13,2,0)
23: starting from 19, pour 10 from jug 2 to jug 1, getting (14,0,1)
24: starting from 20, pour  6 from jug 3 to jug 1, getting (7,8,0)
25: starting from 21, pour 10 from jug 1 to jug 2, getting (2,10,3)
26: starting from 22, pour  6 from jug 1 to jug 3, getting (7,2,6)
27: starting from 23, pour  1 from jug 3 to jug 2, getting (14,1,0)
28: starting from 25, pour  3 from jug 2 to jug 3, getting (2,7,6)
29: starting from 27, pour  6 from jug 1 to jug 3, getting (8,1,6)
30: starting from 28, pour  6 from jug 3 to jug 1, getting (8,7,0)

Since {2,8,5) doesn't appear on the list, the puzzle has no solution.

Dave

On Jun 7, 3:32 am, sharadsharad20073...@gmail.com  wrote:
   

: Three containers are of 15,10 and 6 ltrs capacity. Initially its in
configuration (15,0,0). Make it to configuration (2,8,5)
 
   


--
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] Re: Puzzle:

2010-06-08 Thread sharad kumar
@ dheerraj...u cant measure 8 litre...u hve no additional instrument



@mohit...what do u mean by n th stageplzz elaborate

-- 
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] Re: Puzzle:

2010-06-08 Thread mohit ranjan
@Sharad


let's say that it will take n steps to reach from [15,0,0] to [2,8,5] then
after nth state will be 2,8,5
and (n-1)th state will be say [x,y,z] from which one transfer will lead to
o/p [2,8,5]

hope it's clear

Mohit Ranjan


On Tue, Jun 8, 2010 at 6:54 AM, sharad kumar sharad20073...@gmail.comwrote:

 @ dheerraj...u cant measure 8 litre...u hve no additional instrument



 @mohit...what do u mean by n th stageplzz elaborate

 --
 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.