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.



[algogeeks] Re: puzzle

2012-08-11 Thread Piyush
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.comjavascript:. 

   To unsubscribe from this group, send email to 
   algogeeks+...@googlegroups.com 
   javascript:algogeeks%2Bunsubscribe@googlegroups­.com 

   . 
   For more options, visit this group at 
  http://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.



[algogeeks] Re: Puzzle

2012-03-02 Thread Gene
My crazy guess is that you need to add 1900 and then these are
important years.  Maybe years when a team won some sports
championship?  I'm getting this from the no math or outside
knowledge.  You need inside knowledge.


On Feb 27, 8:24 am, karthikeya s karthikeya.a...@gmail.com wrote:
 3, 39, 41, 43, 45, 49, 51, 53, 55, 64, ?, ?, ...
 (These are successive numbers sharing a common property. No math or
 outside knowledge is needed.)

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



[algogeeks] Re: Puzzle

2012-02-29 Thread icy`
hm, very strange set of numbers.  If the first number was 38 I *might*
see the hints of a pattern, but since it is just 3,  I have no idea.

[if the first number was ]   38(now +1, or 1 squared)
39 , 41, 43, 45(+4, or 2 squared)
49, 51, 53, 55(+9, or 3 squared)
64, __  __  __   (I would then guess  66, 68, 70, and 86)

icy`


On Feb 28, 7:44 am, srikanth reddy malipatel srikk...@gmail.com
wrote:
 {39,41,43,45}    incremented by 2
 {49,51,53,55}    incremented by 2
 {64,?,?,?}

 first number in each set is considered as base number.
 3 is for the number of numbers in each set other than base number.
 so in final set base number is 64 and other 3 numbers are incremented by 2.









 On Tue, Feb 28, 2012 at 1:48 PM, payal gupta gpt.pa...@gmail.com wrote:
  one option cud be reverse the digits...i.e
  (bt the first n d last do not satisfy d pattern howeva)
  93 , 14,34,54,94,15,35,35,55
  an increment is applied to the last 4th no each tme...
  not very sure if its crckt...

  Regards,
  PAYAL GUPTA

  On Tue, Feb 28, 2012 at 12:48 PM, Kartik Sachan kartik.sac...@gmail.com
  wrote:

  I think logic is the difference is
  2 2 4 2 2 2 8 so next will be 2 2  2 2 2 16

  so ans will be 66 68 70

  but first number 3 making some problem

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

 --
 Srikanth Reddy M
 (M.Sc Tech.) Information Systems
 BITS-PILANI

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



[algogeeks] Re: puzzle

2011-10-06 Thread shady
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.



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.



[algogeeks] Re: puzzle

2011-09-24 Thread яαωαт Jee
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.



[algogeeks] Re: puzzle

2011-09-24 Thread яαωαт Jee
^^ 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.



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.



[algogeeks] Re: puzzle

2011-08-28 Thread vikas
lol

On Aug 27, 1:44 am, icy` vipe...@gmail.com wrote:
 Other than making little loops and risking the fall on the first trip
 down, I dont think the rope question has an answer.   NVIDIA just
 wanted to see if you were suicidal  =D

 On Aug 26, 3:36 pm, Piyush Grover piyush4u.iit...@gmail.com wrote:







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

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, 

[algogeeks] Re: puzzle

2011-08-26 Thread icy`
I hope you dont mind that I respond to the original question about the
6x6 matrix.  As I understand it, all elements have to be either 1 or
-1, and product of *every* row and *every* column is 1  = how many
arrangements?

Now a bunch of you seem to think(nxn)  = 2^((n-1)^2)   gives the
answer, so I'm trying to give it a chance, but already I'm kinda
skeptical that the answer is over 33million .   I wrote a brute force
which I'm trying to test for small case  3x3.  Using the formula you
guys gave,   2^(2^2) == 2^(4) == 16.   My program outputs, for n=3:

[[-1, -1, nil], [-1, -1, nil], [nil, nil, nil]]
[[-1, nil, -1], [-1, nil, -1], [nil, nil, nil]]
[[nil, -1, -1], [nil, -1, -1], [nil, nil, nil]]
[[-1, -1, nil], [nil, nil, nil], [-1, -1, nil]]
[[-1, nil, -1], [nil, nil, nil], [-1, nil, -1]]
[[nil, -1, -1], [nil, nil, nil], [nil, -1, -1]]
[[nil, nil, nil], [-1, -1, nil], [-1, -1, nil]]
[[nil, nil, nil], [-1, nil, -1], [-1, nil, -1]]
[[nil, nil, nil], [nil, -1, -1], [nil, -1, -1]]
10

The nil is just a null value;  imagine it is the 1 in the problem.
The program gives 9 cases, and implied is the empty set case, which
would be all nil's, or in our case, contains no  -1's, but instead has
all 1's.  So together it gives 10.   I even drew up the cases so that
it would be easier to see --  http://i56.tinypic.com/24b5kiq.png

So first I will ask, where are the missing 6 cases?

For each row, we choose 0, 2, 4, ...n-1's  to fill it with. If
we fill, for example, matrix[0][0]  and matrix[0][1] with  -1 , to
satisfy the first row requirement, this actually determines the
columns, do not forget.If we use this example for the simple 3x3
case, it is clearly seen that the first two columns must have
*exactly* one more -1  to fulfill the even requirement  (my output
shows this in case #1 and  case #4).

I think the formula does not cut enough of these intersections off.
I'm getting 962  for  n=6  , so    lol

icy`

On Aug 26, 10:34 am, Naren s sweetna...@gmail.com wrote:
 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
   

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 : 

[algogeeks] Re: puzzle

2011-08-26 Thread icy`
Other than making little loops and risking the fall on the first trip
down, I dont think the rope question has an answer.   NVIDIA just
wanted to see if you were suicidal  =D

On Aug 26, 3:36 pm, Piyush Grover piyush4u.iit...@gmail.com wrote:
 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 

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.



[algogeeks] Re: Puzzle

2011-08-20 Thread Dave
@Nikhil: The sum of the internal angles of an n-gon is (n - 2) * 180
degrees. The given polygon must satisfy

25 * 90 + (n - 25) * 270 = (n - 2) * 180.
This simplifies to 25 + 3*n - 75 = 2*n - 4,
giving the solution n = 46.
Since 25 angles are convex, 46 - 25 = 21 are concave.

Dave

On Aug 20, 6:46 am, Nikhil Gupta nikhilgupta2...@gmail.com wrote:
 Each side of a given polygon is parallel to either the X or the Y axis. A
 corner of such a polygon is said to be convex if the internal angle is 90o or
 concave if the internal angle is 270o. If the number of convex corners in
 such a polygon is 25, the number of concave corners must be
 21
 23
 22
 20
 --
 Nikhil Gupta

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



[algogeeks] Re: Puzzle

2011-08-19 Thread Dave
@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 true    then 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.



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.



[algogeeks] Re: Puzzle

2011-08-05 Thread Lakshmi Prasad
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.comwrote:

  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.



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.



[algogeeks] Re: Puzzle

2011-08-04 Thread Dave
@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.comwrote:

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



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.



[algogeeks] Re: puzzle

2011-08-04 Thread Dave
@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.



[algogeeks] Re: puzzle

2011-07-28 Thread abhijit sahoo
if a matrix of order nxn is given for every elements of a given row or
column we could arrange it in 2 way (i,e either 1 or -1),but as the
product across rows and column is 1,so we cannot arrange at least one
element,which will be depending on the product of rest n-1
elements..so finally we can arrange n-1 elements in rows and also
n-1 elements in column with 2 possibilities.so for us (n-1)(n-1)
elements with each possibility of 2 arrangements,so total arrangements
is 2^((n-1)^2).

On Jul 28, 11:06 am, 석문기 smgs2...@gmail.com wrote:
 The problem is finding the subspaces that satisfy two conditions in the 6*6
 total space?

 2011/7/28 vetri natarajananitha...@gmail.com

  given a 6x6 matrix with all the elements as either 1 or -1.
  find the number of ways the elements can b arranged such that

  1.the product of all elements of all columns is 1
  2.the product of all elements of all rows is 1

  can u pls post the answer if u no...

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



[algogeeks] Re: puzzle

2011-07-28 Thread Don
If you fill the upper 5x5 submatrix in any way, the two conditions can
be met by setting the last element of each row to the product of the
first five elements of that row, and likewise with the columns. The
lower right element can be formed using either the product of the last
column or last row. They are certain to be the same because either one
is the product of all 25 elements of the upper submatrix. So the
question comes down to this:

How many ways can you fill the upper 5x5 submatrix?

As others have said, the answer is 2^((n-1)^2) or 33,545,432.

Don

On Jul 27, 11:57 pm, vetri natarajananitha...@gmail.com wrote:
 given a 6x6 matrix with all the elements as either 1 or -1.
 find the number of ways the elements can b arranged such that

 1.the product of all elements of all columns is 1
 2.the product of all elements of all rows is 1

 can u pls post the answer if u no...

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



[algogeeks] Re: Puzzle and solution

2011-07-19 Thread sagar pareek
hey guys pls tell any other better solution ...

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

 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.



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.



[algogeeks] Re: puzzle

2011-07-08 Thread ranjith
Max of 14 drops required

Consider the floor from which egg needs to be dropped as F

F = 0, x =14

do
{
F = F + x
drop first egg from floor F
x--
}while(first egg doesnt break);

F = F - x-1;

do
{
F++
drop second egg from floor F
}while(second egg doesnt break);

return F


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.



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.



[algogeeks] Re: Puzzle

2011-07-07 Thread Gaurav Tyagi
The greatest chance i.e. 100% chance would be at position number 366.
(By Pigeonhole principle).

On Jul 7, 2:34 pm, swetha rahul swetharahu...@gmail.com wrote:
 At a movie theater, the manager announces that they will give a free ticket
 to the first person in line whose birthday is the same as someone who has
 already bought a ticket. You have the option of getting in line at any time.
 Assuming that you don't know anyone else's birthday, that birthdays are
 distributed randomly throughout the year, etc., what position in line gives
 you the greatest chance of being the first duplicate birthday?

 can sumone help to find 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-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.



[algogeeks] Re: puzzle

2011-07-06 Thread shiv narayan
whr s(S+1)/2 must be nearly equal to 100 can uexplain..

On Jul 6, 10:48 pm, TIRU REDDY tiru...@gmail.com wrote:
 s(s+1)/2 must be close to 100.
 The best possible number is 14.

 try from 14th floor.
 next from 14+13th floor.
 next from 14+13+12th floor.
 

 Worest case number of attempts = 14.
 Best Regards,
 T V Thirumala Reddy
 Engineer, Qualcomm India Private Ltd.
 1540C30, 15th Floor, Building #9, Mindspace, Hitech city, Madhapur,
 Hyderabad-81.

 On Wed, Jul 6, 2011 at 11:14 PM, Sriganesh Krishnan 2448...@gmail.comwrote:







  @tiru and @aseem: explanation pls...!

  On Wed, Jul 6, 2011 at 11:11 PM, TIRU REDDY tiru...@gmail.com wrote:

  14

  On 6 Jul 2011 22:35, 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.

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

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



[algogeeks] Re: Puzzle

2011-07-06 Thread shiv narayan
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.



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.



[algogeeks] Re: puzzle

2011-07-06 Thread 991
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.



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.



[algogeeks] Re: PUZZLE

2011-06-27 Thread Dave
@Bhavesh: Check the squares of the integers from
ceiling(sqrt(123456789)) to floor(sqrt(987654321)) to see which ones
contain all nine nonzero digits. Since the sum of the nine nonzero
digits is 45, a satisfactory square will be a multiple of 9, and
therefore, we only need consider the squares of integers that are
multiples of 3. Something like this should do the trick:

int i, j, k;
for( i = 2 ; i  31426 ; i += 3 )
{
j = i * i;
k = 0;
do
{
k |= 1  (j % 10);
j /= 10;
} while( j  0 );
if( k = 0x3FE )// 11  1110 in binary.
printf(%i\n,i);
}

Dave

On Jun 27, 11:01 pm, Bhavesh agrawal agr.bhav...@gmail.com wrote:
 All the nine digits are arranged here so as to form four square numbers:

           9      81       324       576

 How would you put them together so as to form  single smallest possible
 square number and a single largest possible square number..

 139854276 and 923187456 are the answers given everywhere but how to proceed
 this ??

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



[algogeeks] Re: PUZZLE

2011-06-27 Thread Dave
Replying to myself, I should have printed i*i instead of i near the
end of the code:
printf(%i\n,i*i);

Dave

On Jun 27, 11:47 pm, Dave dave_and_da...@juno.com wrote:
 @Bhavesh: Check the squares of the integers from
 ceiling(sqrt(123456789)) to floor(sqrt(987654321)) to see which ones
 contain all nine nonzero digits. Since the sum of the nine nonzero
 digits is 45, a satisfactory square will be a multiple of 9, and
 therefore, we only need consider the squares of integers that are
 multiples of 3. Something like this should do the trick:

 int i, j, k;
 for( i = 2 ; i  31426 ; i += 3 )
 {
     j = i * i;
     k = 0;
     do
     {
         k |= 1  (j % 10);
         j /= 10;
     } while( j  0 );
     if( k = 0x3FE )            // 11  1110 in binary.
         printf(%i\n,i);
 }

 Dave

 On Jun 27, 11:01 pm, Bhavesh agrawal agr.bhav...@gmail.com wrote:



  All the nine digits are arranged here so as to form four square numbers:

            9      81       324       576

  How would you put them together so as to form  single smallest possible
  square number and a single largest possible square number..

  139854276 and 923187456 are the answers given everywhere but how to proceed
  this ??- 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.



[algogeeks] Re: puzzle

2011-06-26 Thread shiv narayan
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.



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.



[algogeeks] Re: puzzle

2011-06-26 Thread Dave
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.



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.



[algogeeks] Re: puzzle

2011-06-26 Thread Dave
@D.N.: The problem with your solution is that it can take up to 28
hours, but you must determine the poisoned beer in at most 24 hours.

Dave

On Jun 26, 2:30 pm, D.N.Vishwakarma@IITR  deok...@gmail.com wrote:
 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
 *
 *- 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.



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.



[algogeeks] Re: puzzle

2011-06-26 Thread Dumanshu
These type of solutions require to think in binary.

First of all leave the last one because if we don't find a poisoned
bottle in first 5 then it means the last one is poisoned.
So 5 can be expressed using 3 bits.
these 3 bits will correspond to mice... 1 indicates the mice drinks
and 0 indicates it doesn't from the mentioned bottle.

1 - 001
2- 010
3- 011
4-100
5-101

the number on right is the bottle number for remaining five bottles.
The binary number on right tells us which mouse drinks from which
bottle.
e.g. bottle no. 5 is taken by mice 1 and mice 3 whereas bottle no.3 is
consumed by mice 2 and mice 3.
Now after 14hrs, the mice which die will tell us which bottle was
poisoned. Because the combination is unique.

Doom

On Jun 26, 11: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.



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.



[algogeeks] Re: Puzzle

2011-06-09 Thread ross
@lalit:
The idea here would be for Train T,
make it cross its own parachute first. Then move both the train fwd
until
the trailing train reaches a parachute. When the trailing train
reaches the parachute
of the leading train, make it move faster than the leading train .
Naturally the leading
train would execute MF MF MB (effectively moves 1 step), and the
trailing train would
have moved 3 steps (MF MF MF) and would ultimately catch up and
collide with the
leading train.

To make things clear go thro' the code,

label:  MF MF MB
  if(parachute)
  {MF MF MF}
  GOTO label


Hope it helps,


On Jun 10, 12:06 am, LALIT SHARMA lks.ru...@gmail.com wrote:
  A helicopter drops two trains, each on a parachute, onto a straight
 infinite railway line. There is an undefined distance between the two
 trains. Each faces the same direction, and upon landing, the parachute
 attached to each train falls to the ground next to the train and detaches.
 Each train has a microchip that controls its motion. The chips are
 identical. There is no way for the trains to know where they are. You need
 to write the code in the chip to make the trains bump into each other. Each
 line of code takes a single clock cycle to execute.*
 You can use the following commands (and only these);*
 MF - moves the train forward
 MB - moves the train backward
 IF (P) - conditional that's satisfied if the train is next to a parachute.
 There is no then to this IF statement.
 GOTO

 --
 Lalit Kishore Sharma,

 IIIT Allahabad (Amethi Capmus),
 6th Sem.

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



[algogeeks] Re: Puzzle

2011-05-27 Thread vishwakarma
Correct me if i m wrong !!!

Number of matches of each team  = 14.
Let team A,B,C,D qualify for semifinal.
1.maximum number of matches A can win  = 14 (all played )
2.maximum number of matches B can win = 12 (all played except played
with team A)
3.maximum number of matches C can win = 10 (all played except played
with team A and B)
4.maximum number of matches D can win = 8 (all played except played
with team A , B and C)


so 8 should  be the minimum number of matches to be won to proceed for
semis !!!

On May 27, 6:10 pm, Aakash Johari aakashj@gmail.com wrote:
 Is it the minimum required matches to ensure for semifinals?

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









  suppose bottom 4 teams have won least matches  and upper 4 teams have won
  equal number of matches  ...

  1 - x
  2 - x
  3 - x
  4 - x

  5 - 6
  6 - 4
  7 - 2
  8 - 0

  total matches are 56
  and let upper four teams have won x matches each

  so x = (56-(6+4+2+0))/4
   x = 11

  so in this way to ensure qualification to semi finals team must win 11
  matches  ...

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



[algogeeks] Re: Puzzle

2011-05-27 Thread vishwakarma
@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.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 
  toalgoge...@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.



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.



[algogeeks] Re: Puzzle

2011-05-27 Thread vishwakarma
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
  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 
  toalgoge...@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.



[algogeeks] Re: Puzzle

2011-05-27 Thread vishwakarma
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.



[algogeeks] Re: Puzzle

2011-05-27 Thread vishwakarma
correction--Then C loses two of its matches to(one to A and one to
C).  to Then C loses two of its matches 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.



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.



[algogeeks] Re: Puzzle

2011-05-27 Thread L
Ah! sorry.
This combination is not possible.
It will be 10,10,10,10,10,4,2,0. So, the answer is 11.

On May 27, 10:10 pm, L prnk.bhatna...@gmail.com wrote:
 The worst case will occur when 5 teams have the same number of wins.
 As only 4 can qualify, one team with the same number of points will
 not be able to qualify.

 Team. Wins
 1. 11
 2. 11
 3. 11
 4. 11
 5. 11
 6. 1
 7. 0
 8. 0

 In this scenario, a team with 11 points will not be able to qualify.
 So, to ensure that it is in the finals a team should win 12 matches.

 On May 27, 6:06 pm, Rishabh Maurya poofiefoo...@gmail.com wrote:







  suppose bottom 4 teams have won least matches  and upper 4 teams have won
  equal number of matches  ...

  1 - x
  2 - x
  3 - x
  4 - x

  5 - 6
  6 - 4
  7 - 2
  8 - 0

  total matches are 56
  and let upper four teams have won x matches each

  so x = (56-(6+4+2+0))/4
   x = 11

  so in this way to ensure qualification to semi finals team must win 11
  matches  ...

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



[algogeeks] Re: Puzzle

2011-05-27 Thread Don
To solve this, look at an 8x8 grid representing the games played. The
diagonal is not used, because teams do not play themselves. Below the
diagonal is the first game between each team and above the diagonal is
the second game. Assume that teams 1-4 are the ones who will go to the
semi-finals. This means that you only need to assign winners in the
first 4 rows and first 4 columns. The lower right of the grid can
remain empty. Start by assigning team 1-4 as the winner every time
they play teams 5-8. That gives teams 1-4 eight wins each. That leaves
just 12 games left to assign in the top left quarter of the grid. It
is not hard to assign them so that each time wins 3 of the games,
meaning that it takes 11 games to assure a spot in the semi-finals.

Here is a grid of results for one such outcome:

X134
1X24
12X3
423X
1234
1234
1234
1234

Don

On May 12, 1:44 pm, amit amitjaspal...@gmail.com wrote:
 Consider a series in which 8 teams are participating. each team plays
 twice with all other teams. 4 of them will go to the semi final.How
 many matches should a team win, so that it will ensure that it will go
 to semi finals.?

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



[algogeeks] Re: PUZZLE

2011-05-22 Thread Dave
@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.



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.



[algogeeks] Re: PUZZLE

2011-05-21 Thread bittu
@all  you can find the better explanation here , hope it will help

http://ashutosh7s.blogspot.com/2011/02/camel-and-banana.html

feel free to comment if anything wrong


Thanks
Shashank Mani Best Way to Escape From Problem is to Solve It
CSE,BIT Mesra

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



[algogeeks] Re: PUZZLE

2011-05-21 Thread Dave
@All: The difference between the camel-and-banana problem and this one
is that the elephant eats the banana _after_ he has gone the km. As in
the camel explanation, he establishes a cache of bananas at 200 km.
This takes 5 one-way trips of 200 km, so he eats 1,000 bananas, and
has 2,000 bananas at that point. He then establishes a second cache of
bananas at 533-1/2 km, as follows: Starting with 1,000 bananas, he
goes 333-1/2 km (eating 333 bananas, since he eats a banana only at
the end of a km), drops 333 bananas, and returns 333-1/2 km (eating
334 bananas). Taking the last 1,000 bananas to the second cache, he
eats 333 bananas. So he has 333 + 667 = 1,000 bananas, with 466-1/2 km
left to go. He eats 466 of the 1,000 bananas on the way. Thus, he ends
up with 534 bananas.

Dave

On May 21, 7:14 am, bittu shashank7andr...@gmail.com wrote:
 @all  you can find the better explanation here , hope it will help

 http://ashutosh7s.blogspot.com/2011/02/camel-and-banana.html

 feel free to comment if anything wrong

 Thanks
 Shashank Mani Best Way to Escape From Problem is to Solve It
 CSE,BIT Mesra

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



  1   2   >