[algogeeks] Re: Google-Puzzle

2012-02-25 Thread karthikeya s
buddy i said that kadane's algo(max subsum) wouldn't work..

On Feb 25, 1:31 pm, Ashish Goel ashg...@gmail.com wrote:
 max subsum problem
 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652

 On Sat, Feb 25, 2012 at 1:03 PM, karthikeya s 
 karthikeya.a...@gmail.comwrote:







  You have a circular track containing fuel pits at irregular intervals.
  The total amount of fuel available from all the pits together is just
  sufficient to travel round the track and finish where you started.
  Given the the circuit perimeter, list of each fuel pit location and
  the amount of fuel they contain, find the optimal start point on the
  track such that you never run out of fuel and complete circuit.

  my logic:
  we can use an array having element as
  fuel(in km)-dist to next pit

  so now aim is to traverse the array as always having some +ve
  resultant sum.nd plz we cant use here kadane's algo.there are
  cases in which it will not hold 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.

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

2012-02-25 Thread Ashish Goel
it will

the diff is of fuel and dist forms the content of array which moves from 1
to 2n-1 elements(break the circle and instead of elem like 1,2,n have
1,2,n,1,2,...n-1
i.e. total 2n-1 so that mod stuff is not required.

now find maxsubSum such that sum=0 and count of nodes is n

not clear ehy it wont work.
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652


On Sat, Feb 25, 2012 at 2:54 PM, karthikeya s karthikeya.a...@gmail.comwrote:

 buddy i said that kadane's algo(max subsum) wouldn't work..

 On Feb 25, 1:31 pm, Ashish Goel ashg...@gmail.com wrote:
  max subsum problem
  Best Regards
  Ashish Goel
  Think positive and find fuel in failure
  +919985813081
  +919966006652
 
  On Sat, Feb 25, 2012 at 1:03 PM, karthikeya s karthikeya.a...@gmail.com
 wrote:
 
 
 
 
 
 
 
   You have a circular track containing fuel pits at irregular intervals.
   The total amount of fuel available from all the pits together is just
   sufficient to travel round the track and finish where you started.
   Given the the circuit perimeter, list of each fuel pit location and
   the amount of fuel they contain, find the optimal start point on the
   track such that you never run out of fuel and complete circuit.
 
   my logic:
   we can use an array having element as
   fuel(in km)-dist to next pit
 
   so now aim is to traverse the array as always having some +ve
   resultant sum.nd plz we cant use here kadane's algo.there are
   cases in which it will not hold 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.

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

2011-09-17 Thread Gene
This is not a C puzzle. It depends on operating system.

On Sep 17, 3:46 pm, teja bala pawanjalsa.t...@gmail.com wrote:
  you have to print the list of all the files in a directory and all
 its sub directories?

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

2011-09-17 Thread pooja
i tried it for Windows.

#includeiostream

using namespace std;
int main()
{
 char ch;
 int i=system(dir /s |more);
 ch=getchar();

 }


On Sep 17, 6:46 pm, teja bala pawanjalsa.t...@gmail.com wrote:
  you have to print the list of all the files in a directory and all
 its sub directories?

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

2011-09-17 Thread pooja
it's running..
http://ideone.com/XjGIo
wat is does is that through the system function u can run commands as
u do in command prompt.. nd dis is d command to show the files n all
as ur question asked.
try it on dev C++.

On Sep 17, 9:45 pm, teja bala pawanjalsa.t...@gmail.com wrote:
 @ pooja

 in borland c++ 4.5 compiler version its giving linker error,

 wat actually ur code does?







 On Sat, Sep 17, 2011 at 9:27 PM, pooja pooja27tan...@gmail.com wrote:
  i tried it for Windows.

  #includeiostream

  using namespace std;
  int main()
  {
      char ch;
      int i=system(dir /s |more);
      ch=getchar();

      }

  On Sep 17, 6:46 pm, teja bala pawanjalsa.t...@gmail.com wrote:
    you have to print the list of all the files in a directory and all
   its sub directories?

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

2011-09-15 Thread Don
It might be 3, but it doesn't have to be 3.
Don

On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com wrote:
 if P+Q+R= 0  then P2 /QR  + Q2/PR + R2/PQ = ??

 how to solve 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.



Re: [algogeeks] Re: Math Puzzle

2011-09-15 Thread abhinav gupta
Shut up...its 3,,

On Thu, Sep 15, 2011 at 9:43 AM, Don dondod...@gmail.com wrote:

 It might be 3, but it doesn't have to be 3.
 Don

 On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com wrote:
  if P+Q+R= 0  then P2 /QR  + Q2/PR + R2/PQ = ??
 
  how to solve 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.




-- 
@ |3  # ! /\/ @ \./

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

2011-09-15 Thread Piyush Grover
Don is right

if R = 0, P = 1 and Q = -1 then the given expression is UNDEFINED!!!



On Thu, Sep 15, 2011 at 10:16 PM, abhinav gupta
guptaabhinav...@gmail.comwrote:

 Shut up...its 3,,


 On Thu, Sep 15, 2011 at 9:43 AM, Don dondod...@gmail.com wrote:

 It might be 3, but it doesn't have to be 3.
 Don

 On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com wrote:
  if P+Q+R= 0  then P2 /QR  + Q2/PR + R2/PQ = ??
 
  how to solve 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.




 --
 @ |3  # ! /\/ @ \./

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

2011-09-15 Thread Don
No, not at all. Here is a trivial counterexample:

P = Q = R = 0

Don

On Sep 15, 11:46 am, abhinav gupta guptaabhinav...@gmail.com wrote:
 Shut up...its 3,,



 On Thu, Sep 15, 2011 at 9:43 AM, Don dondod...@gmail.com wrote:
  It might be 3, but it doesn't have to be 3.
  Don

  On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com wrote:
   if P+Q+R= 0  then P2 /QR  + Q2/PR + R2/PQ = ??

   how to solve 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.

 --
 @ |3  # ! /\/ @ \./

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

2011-09-15 Thread abhinav gupta
u cnt divide a number by 0..that thing is self undrstod

On Thu, Sep 15, 2011 at 9:49 AM, Piyush Grover piyush4u.iit...@gmail.comwrote:

 Don is right

 if R = 0, P = 1 and Q = -1 then the given expression is UNDEFINED!!!



 On Thu, Sep 15, 2011 at 10:16 PM, abhinav gupta guptaabhinav...@gmail.com
  wrote:

 Shut up...its 3,,


 On Thu, Sep 15, 2011 at 9:43 AM, Don dondod...@gmail.com wrote:

 It might be 3, but it doesn't have to be 3.
 Don

 On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com wrote:
  if P+Q+R= 0  then P2 /QR  + Q2/PR + R2/PQ = ??
 
  how to solve 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.




 --
 @ |3  # ! /\/ @ \./

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




-- 
@ |3  # ! /\/ @ \./

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

2011-09-15 Thread abhinav gupta
dude dats outside the domain of the qs...dont be oversmart.

On Thu, Sep 15, 2011 at 9:49 AM, Don dondod...@gmail.com wrote:

 No, not at all. Here is a trivial counterexample:

 P = Q = R = 0

 Don

 On Sep 15, 11:46 am, abhinav gupta guptaabhinav...@gmail.com wrote:
  Shut up...its 3,,
 
 
 
  On Thu, Sep 15, 2011 at 9:43 AM, Don dondod...@gmail.com wrote:
   It might be 3, but it doesn't have to be 3.
   Don
 
   On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com wrote:
if P+Q+R= 0  then P2 /QR  + Q2/PR + R2/PQ = ??
 
how to solve 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.
 
  --
  @ |3  # ! /\/ @ \./

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




-- 
@ |3  # ! /\/ @ \./

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

2011-09-15 Thread Don
Right, and in every proof above, at some point there is a possible
division by zero. Therefore the proof is not valid in cases where R or
P or Q are zero, and there are infinitely many such cases.
The problem states P+Q+R=0 as the only constraint. There are
infinitely many cases which fit that constraint where the expression
is not equal to 3.
Don

On Sep 15, 11:57 am, abhinav gupta guptaabhinav...@gmail.com wrote:
 u cnt divide a number by 0..that thing is self undrstod

 On Thu, Sep 15, 2011 at 9:49 AM, Piyush Grover 
 piyush4u.iit...@gmail.comwrote:



  Don is right

  if R = 0, P = 1 and Q = -1 then the given expression is UNDEFINED!!!

  On Thu, Sep 15, 2011 at 10:16 PM, abhinav gupta guptaabhinav...@gmail.com
   wrote:

  Shut up...its 3,,

  On Thu, Sep 15, 2011 at 9:43 AM, Don dondod...@gmail.com wrote:

  It might be 3, but it doesn't have to be 3.
  Don

  On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com wrote:
   if P+Q+R= 0  then P2 /QR  + Q2/PR + R2/PQ = ??

   how to solve 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.

  --
  @ |3  # ! /\/ @ \./

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

 --
 @ |3  # ! /\/ @ \./

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

2011-09-15 Thread Piyush Grover
@abhinav...

it's not about being over smart or to show someone or to prove someone
anything. It's just that
you should not take any assumptions by yourself or if you do you should
specify clearly.
If u r asked this question in an interview and you give the answer 3 without
telling your assumption, u r done!!

And if you are living in the programming world, you need to take care of all
the possible scenarios otherwise u will end up throwing exceptions and
segmentation faults.


On Thu, Sep 15, 2011 at 10:32 PM, Don dondod...@gmail.com wrote:

 Right, and in every proof above, at some point there is a possible
 division by zero. Therefore the proof is not valid in cases where R or
 P or Q are zero, and there are infinitely many such cases.
 The problem states P+Q+R=0 as the only constraint. There are
 infinitely many cases which fit that constraint where the expression
 is not equal to 3.
 Don

 On Sep 15, 11:57 am, abhinav gupta guptaabhinav...@gmail.com wrote:
  u cnt divide a number by 0..that thing is self undrstod
 
  On Thu, Sep 15, 2011 at 9:49 AM, Piyush Grover 
 piyush4u.iit...@gmail.comwrote:
 
 
 
   Don is right
 
   if R = 0, P = 1 and Q = -1 then the given expression is UNDEFINED!!!
 
   On Thu, Sep 15, 2011 at 10:16 PM, abhinav gupta 
 guptaabhinav...@gmail.com
wrote:
 
   Shut up...its 3,,
 
   On Thu, Sep 15, 2011 at 9:43 AM, Don dondod...@gmail.com wrote:
 
   It might be 3, but it doesn't have to be 3.
   Don
 
   On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com wrote:
if P+Q+R= 0  then P2 /QR  + Q2/PR + R2/PQ = ??
 
how to solve 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.
 
   --
   @ |3  # ! /\/ @ \./
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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.
 
  --
  @ |3  # ! /\/ @ \./

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

2011-09-15 Thread Ashima .
solution is =3 with the condition p!=0 and q!=0 and r!=0
Ashima
M.Sc.(Tech)Information Systems
4th year
BITS Pilani
Rajasthan




On Thu, Sep 15, 2011 at 10:38 PM, Piyush Grover
piyush4u.iit...@gmail.comwrote:

 @abhinav...

 it's not about being over smart or to show someone or to prove someone
 anything. It's just that
 you should not take any assumptions by yourself or if you do you should
 specify clearly.
 If u r asked this question in an interview and you give the answer 3
 without telling your assumption, u r done!!

 And if you are living in the programming world, you need to take care of
 all the possible scenarios otherwise u will end up throwing exceptions and
 segmentation faults.



 On Thu, Sep 15, 2011 at 10:32 PM, Don dondod...@gmail.com wrote:

 Right, and in every proof above, at some point there is a possible
 division by zero. Therefore the proof is not valid in cases where R or
 P or Q are zero, and there are infinitely many such cases.
 The problem states P+Q+R=0 as the only constraint. There are
 infinitely many cases which fit that constraint where the expression
 is not equal to 3.
 Don

 On Sep 15, 11:57 am, abhinav gupta guptaabhinav...@gmail.com wrote:
  u cnt divide a number by 0..that thing is self undrstod
 
  On Thu, Sep 15, 2011 at 9:49 AM, Piyush Grover 
 piyush4u.iit...@gmail.comwrote:
 
 
 
   Don is right
 
   if R = 0, P = 1 and Q = -1 then the given expression is UNDEFINED!!!
 
   On Thu, Sep 15, 2011 at 10:16 PM, abhinav gupta 
 guptaabhinav...@gmail.com
wrote:
 
   Shut up...its 3,,
 
   On Thu, Sep 15, 2011 at 9:43 AM, Don dondod...@gmail.com wrote:
 
   It might be 3, but it doesn't have to be 3.
   Don
 
   On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com
 wrote:
if P+Q+R= 0  then P2 /QR  + Q2/PR + R2/PQ = ??
 
how to solve 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.
 
   --
   @ |3  # ! /\/ @ \./
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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.
 
  --
  @ |3  # ! /\/ @ \./

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



Re: [algogeeks] Re: C puzzle

2011-09-04 Thread teja bala
but o/p is -15 -13 -11 -9

On Sun, Sep 4, 2011 at 3:38 AM, vikas vikas.rastogi2...@gmail.com wrote:

 f(19222)
  |
  |
 f(1922) -11 -2 =-13
  |
  |
 f(192) = -9 -2 = -11
  |
  |
 f(19) = f(1) - 9 = -9
  |
  |
  f(1) = 0

 output -9 -11 -13


 On Sep 3, 10:29 pm, teja bala pawanjalsa.t...@gmail.com wrote:
  Find the output of the following code - plzzz xplain the o/p
  int find(int j)
  {
  if(j1)
  {
  j=find(j/10)-(j%10);
  printf(%d,j);}
 
  else
  {
  j=0;}
  return j;
  }
 
  int main()
  {
  int i=19222;
  int k;
  k=find(i);
 
 
 
 
 
 
 
  }

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

2011-09-04 Thread Neha Gupta
o/p : -9-11-13-15

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

2011-09-04 Thread teja bala
@neha could u xplain it?

On Sun, Sep 4, 2011 at 12:05 PM, Neha Gupta nehagup...@gmail.com wrote:

 o/p : -9-11-13-15

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

2011-09-04 Thread NITESH KUMAR
output is :
-9-11-13-15

first j=19222 then
find(19222)=find(1922)-2
find(1922)=find(192)-2
find(192)=find(19)-2
find(19)=find(1)-9

find(1) returns 0  then
find(19)=0-9=-9
find(192)=-9-2=-11
find(1922)=-11-2=-13
find(19222)=-13-2=-15

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

2011-09-04 Thread Neha Gupta
@teja ...nitesh hv correctly explained it

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



Re: [algogeeks] Re: C puzzle

2011-09-04 Thread annarao kataru
@nitesh   good  explanation brother

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

2011-09-03 Thread vikas
f(19222)
  |
  |
f(1922) -11 -2 =-13
  |
  |
f(192) = -9 -2 = -11
 |
 |
f(19) = f(1) - 9 = -9
 |
 |
 f(1) = 0

output -9 -11 -13


On Sep 3, 10:29 pm, teja bala pawanjalsa.t...@gmail.com wrote:
 Find the output of the following code - plzzz xplain the o/p
 int find(int j)
 {
 if(j1)
 {
 j=find(j/10)-(j%10);
 printf(%d,j);}

 else
 {
 j=0;}
 return j;
 }

 int main()
 {
 int i=19222;
 int k;
 k=find(i);







 }

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

2011-08-28 Thread Dave
@Sivaviknesh: The smallest values of x and y are 1. The largest value
of y is (60 - 3) / 4 = 14. Solve for x: x = (60 - 4y) / 3. Since x is
an integer, 60 - 4y must be a multiple of 3. Since 60 - 3y is a
multiple of 3, (60 - 4y) - (60 - 3y) = y must be a multiple of 3.
Thus, y = 3, 6, 9, 12. Then you can solve for the corresponding values
of x.

Dave

On Aug 28, 7:46 am, sivaviknesh s sivavikne...@gmail.com wrote:
 *Find the number of solutions for 3x+4y=60, if x and y are positive
 integers.*

 Is there any standard method for solving these type of ques ..or only trial
 and error ???

 --
 Regards,
 $iva

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

2011-08-28 Thread Piyush Grover
3x+4y = 60
it's a straight line equation whose x intercept is 20 and y intercept is 15.
Draw it in first quadrant
(as x, y are positive integers)
now x = (60 - 4y)/3 = 4(15-y)/3
now for y = 1, 2...15 you need to check whether (15-y) is divisible by 3 or
not. It's simple y = 3, 6, 9, 12

-Piyush

On Sun, Aug 28, 2011 at 6:38 PM, Dave dave_and_da...@juno.com wrote:

 @Sivaviknesh: The smallest values of x and y are 1. The largest value
 of y is (60 - 3) / 4 = 14. Solve for x: x = (60 - 4y) / 3. Since x is
 an integer, 60 - 4y must be a multiple of 3. Since 60 - 3y is a
 multiple of 3, (60 - 4y) - (60 - 3y) = y must be a multiple of 3.
 Thus, y = 3, 6, 9, 12. Then you can solve for the corresponding values
 of x.

 Dave

 On Aug 28, 7:46 am, sivaviknesh s sivavikne...@gmail.com wrote:
  *Find the number of solutions for 3x+4y=60, if x and y are positive
  integers.*
 
  Is there any standard method for solving these type of ques ..or only
 trial
  and error ???
 
  --
  Regards,
  $iva

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

2011-08-28 Thread harshit sethi
maximum value of y satisfying this is y=15 and for that x=0;

now decrease y by 3 and increase x by 4 ,you will have x and y
satisfying the equation.

keep on doing this till you reach minimum value of y i.e 0

this you can do  5 times decreasing y=15 by 3 every time

so there will be 5 solutions .

On 8/28/11, Piyush Grover piyush4u.iit...@gmail.com wrote:
 3x+4y = 60
 it's a straight line equation whose x intercept is 20 and y intercept is 15.
 Draw it in first quadrant
 (as x, y are positive integers)
 now x = (60 - 4y)/3 = 4(15-y)/3
 now for y = 1, 2...15 you need to check whether (15-y) is divisible by 3 or
 not. It's simple y = 3, 6, 9, 12

 -Piyush

 On Sun, Aug 28, 2011 at 6:38 PM, Dave dave_and_da...@juno.com wrote:

 @Sivaviknesh: The smallest values of x and y are 1. The largest value
 of y is (60 - 3) / 4 = 14. Solve for x: x = (60 - 4y) / 3. Since x is
 an integer, 60 - 4y must be a multiple of 3. Since 60 - 3y is a
 multiple of 3, (60 - 4y) - (60 - 3y) = y must be a multiple of 3.
 Thus, y = 3, 6, 9, 12. Then you can solve for the corresponding values
 of x.

 Dave

 On Aug 28, 7:46 am, sivaviknesh s sivavikne...@gmail.com wrote:
  *Find the number of solutions for 3x+4y=60, if x and y are positive
  integers.*
 
  Is there any standard method for solving these type of ques ..or only
 trial
  and error ???
 
  --
  Regards,
  $iva

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



Re: [algogeeks] Re: math puzzle

2011-08-28 Thread harshit sethi
sorry 6 solutions y=15,12,9,6,3,0
and x=0,4,8,12,16,20  respectively

On 8/28/11, harshit sethi hshoneyma...@gmail.com wrote:
 maximum value of y satisfying this is y=15 and for that x=0;

 now decrease y by 3 and increase x by 4 ,you will have x and y
 satisfying the equation.

 keep on doing this till you reach minimum value of y i.e 0

 this you can do  5 times decreasing y=15 by 3 every time

 so there will be 5 solutions .

 On 8/28/11, Piyush Grover piyush4u.iit...@gmail.com wrote:
 3x+4y = 60
 it's a straight line equation whose x intercept is 20 and y intercept is
 15.
 Draw it in first quadrant
 (as x, y are positive integers)
 now x = (60 - 4y)/3 = 4(15-y)/3
 now for y = 1, 2...15 you need to check whether (15-y) is divisible by 3
 or
 not. It's simple y = 3, 6, 9, 12

 -Piyush

 On Sun, Aug 28, 2011 at 6:38 PM, Dave dave_and_da...@juno.com wrote:

 @Sivaviknesh: The smallest values of x and y are 1. The largest value
 of y is (60 - 3) / 4 = 14. Solve for x: x = (60 - 4y) / 3. Since x is
 an integer, 60 - 4y must be a multiple of 3. Since 60 - 3y is a
 multiple of 3, (60 - 4y) - (60 - 3y) = y must be a multiple of 3.
 Thus, y = 3, 6, 9, 12. Then you can solve for the corresponding values
 of x.

 Dave

 On Aug 28, 7:46 am, sivaviknesh s sivavikne...@gmail.com wrote:
  *Find the number of solutions for 3x+4y=60, if x and y are positive
  integers.*
 
  Is there any standard method for solving these type of ques ..or only
 trial
  and error ???
 
  --
  Regards,
  $iva

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

2011-08-28 Thread Dave
@Harhsit: Normally, 0 is not considered positive.

Dave

On Aug 28, 10:45 am, harshit sethi hshoneyma...@gmail.com wrote:
 sorry 6 solutions y=15,12,9,6,3,0
 and x=0,4,8,12,16,20  respectively

 On 8/28/11, harshit sethi hshoneyma...@gmail.com wrote:



  maximum value of y satisfying this is y=15 and for that x=0;

  now decrease y by 3 and increase x by 4 ,you will have x and y
  satisfying the equation.

  keep on doing this till you reach minimum value of y i.e 0

  this you can do  5 times decreasing y=15 by 3 every time

  so there will be 5 solutions .

  On 8/28/11, Piyush Grover piyush4u.iit...@gmail.com wrote:
  3x+4y = 60
  it's a straight line equation whose x intercept is 20 and y intercept is
  15.
  Draw it in first quadrant
  (as x, y are positive integers)
  now x = (60 - 4y)/3 = 4(15-y)/3
  now for y = 1, 2...15 you need to check whether (15-y) is divisible by 3
  or
  not. It's simple y = 3, 6, 9, 12

  -Piyush

  On Sun, Aug 28, 2011 at 6:38 PM, Dave dave_and_da...@juno.com wrote:

  @Sivaviknesh: The smallest values of x and y are 1. The largest value
  of y is (60 - 3) / 4 = 14. Solve for x: x = (60 - 4y) / 3. Since x is
  an integer, 60 - 4y must be a multiple of 3. Since 60 - 3y is a
  multiple of 3, (60 - 4y) - (60 - 3y) = y must be a multiple of 3.
  Thus, y = 3, 6, 9, 12. Then you can solve for the corresponding values
  of x.

  Dave

  On Aug 28, 7:46 am, sivaviknesh s sivavikne...@gmail.com wrote:
   *Find the number of solutions for 3x+4y=60, if x and y are positive
   integers.*

   Is there any standard method for solving these type of ques ..or only
  trial
   and error ???

   --
   Regards,
   $iva

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

2011-08-28 Thread Rishabbh A Dua
3x+4y = 60 can be expressed as 15 -y = 3x+3y -45
i.e, 15-y = 3(x+y-15)

which implies tht for every value of x,y  in the above eq 15-y is divisible
by 3

On Sun, Aug 28, 2011 at 10:03 PM, Dave dave_and_da...@juno.com wrote:

 @Harhsit: Normally, 0 is not considered positive.

 Dave

 On Aug 28, 10:45 am, harshit sethi hshoneyma...@gmail.com wrote:
  sorry 6 solutions y=15,12,9,6,3,0
  and x=0,4,8,12,16,20  respectively
 
  On 8/28/11, harshit sethi hshoneyma...@gmail.com wrote:
 
 
 
   maximum value of y satisfying this is y=15 and for that x=0;
 
   now decrease y by 3 and increase x by 4 ,you will have x and y
   satisfying the equation.
 
   keep on doing this till you reach minimum value of y i.e 0
 
   this you can do  5 times decreasing y=15 by 3 every time
 
   so there will be 5 solutions .
 
   On 8/28/11, Piyush Grover piyush4u.iit...@gmail.com wrote:
   3x+4y = 60
   it's a straight line equation whose x intercept is 20 and y intercept
 is
   15.
   Draw it in first quadrant
   (as x, y are positive integers)
   now x = (60 - 4y)/3 = 4(15-y)/3
   now for y = 1, 2...15 you need to check whether (15-y) is divisible by
 3
   or
   not. It's simple y = 3, 6, 9, 12
 
   -Piyush
 
On Sun, Aug 28, 2011 at 6:38 PM, Dave dave_and_da...@juno.com
 wrote:
 
   @Sivaviknesh: The smallest values of x and y are 1. The largest value
   of y is (60 - 3) / 4 = 14. Solve for x: x = (60 - 4y) / 3. Since x is
   an integer, 60 - 4y must be a multiple of 3. Since 60 - 3y is a
   multiple of 3, (60 - 4y) - (60 - 3y) = y must be a multiple of 3.
   Thus, y = 3, 6, 9, 12. Then you can solve for the corresponding
 values
   of x.
 
   Dave
 
   On Aug 28, 7:46 am, sivaviknesh s sivavikne...@gmail.com wrote:
*Find the number of solutions for 3x+4y=60, if x and y are positive
integers.*
 
Is there any standard method for solving these type of ques ..or
 only
   trial
and error ???
 
--
Regards,
$iva
 
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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.- 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.




-- 
Rishabbh A Dua

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

2011-08-16 Thread Jacob Ridley
I think there is some ambiguity in the question.

 (All this time you don't know you were tossing a fair coin or not).
1) Does the above statement mean that the thower don't know whether he
or she threw a fair coin even after throwing? Or is the thrower not
informed beforehand that one of them is not a fair coin?
2) Does the coin count reduce after every throw or should it be put
back?
3) Depending on 1) and 2), there will be different answers.


On Aug 9, 12:13 am, Maddy madhu.mitha...@gmail.com wrote:
 I think the answer is 17/80, because
 as you say the 5 trials are independent.. but
 the fact that a head turns up in all the 5 trials, give some
 information about our original probability of choosing the coins.

 in case we had obtained a tail in the first trial, we can be sure its
 the fair coin, and so the consecutive trials would become
 independent..

 but since that is not the case, every head is going to increase the
 chance of choosing the biased coin(initially), and hence affect the
 probability of the next head..

 before the first trial probability of landing a head is 3/5, but once
 u see the first head, the probability of landing a head on the second
 trial changes to 4/5*1/4+1/5, and so on..that is, there is a higher
 probability that we chose a biased coin, rather than the fair coin.

 hope its clear..

 On Aug 7, 11:36 pm, sumit gaur sumitgau...@gmail.com wrote:



  (3/5)

  On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:

   A bag contains 5 coins. Four of them are fair and one has heads on
   both sides. You randomly pulled one coin from the bag and tossed it 5
   times, heads turned up all five times. What is the probability that
   you toss next time, heads turns up. (All this time you don't know you
   were tossing a fair coin or not).- 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: Probability Puzzle

2011-08-16 Thread pacific :-)
I'm little late but I too got 17/18.

On Tue, Aug 16, 2011 at 10:47 PM, Jacob Ridley jridley2...@gmail.comwrote:

 I think there is some ambiguity in the question.

  (All this time you don't know you were tossing a fair coin or not).
 1) Does the above statement mean that the thower don't know whether he
 or she threw a fair coin even after throwing? Or is the thrower not
 informed beforehand that one of them is not a fair coin?
 2) Does the coin count reduce after every throw or should it be put
 back?
 3) Depending on 1) and 2), there will be different answers.


 On Aug 9, 12:13 am, Maddy madhu.mitha...@gmail.com wrote:
  I think the answer is 17/80, because
  as you say the 5 trials are independent.. but
  the fact that a head turns up in all the 5 trials, give some
  information about our original probability of choosing the coins.
 
  in case we had obtained a tail in the first trial, we can be sure its
  the fair coin, and so the consecutive trials would become
  independent..
 
  but since that is not the case, every head is going to increase the
  chance of choosing the biased coin(initially), and hence affect the
  probability of the next head..
 
  before the first trial probability of landing a head is 3/5, but once
  u see the first head, the probability of landing a head on the second
  trial changes to 4/5*1/4+1/5, and so on..that is, there is a higher
  probability that we chose a biased coin, rather than the fair coin.
 
  hope its clear..
 
  On Aug 7, 11:36 pm, sumit gaur sumitgau...@gmail.com wrote:
 
 
 
   (3/5)
 
   On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 
A bag contains 5 coins. Four of them are fair and one has heads on
both sides. You randomly pulled one coin from the bag and tossed it 5
times, heads turned up all five times. What is the probability that
you toss next time, heads turns up. (All this time you don't know you
were tossing a fair coin or not).- 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.




-- 
regards,
chinna.

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

2011-08-15 Thread Don
#include ctype.h
#include string.h

int main(int argc, char* argv[])
{
char line[500];
char tmp[500];
char *words[100];
int wordCount = 0;
char *p, *wordStart=0;

printf(Enter string:);
fgets(line,500,stdin);

for(p = line; *p; ++p)
{
if (!wordStart  isalpha(*p)) wordStart = p;
else if (wordStart  !isalpha(*p))
{
words[wordCount++] = wordStart;
*p = 0;
wordStart = 0;
}
}

p = tmp;
for(int i = wordCount-1; i = 0; --i) p += sprintf(p, %s ,
words[i]);
strcpy(line,tmp);
printf(%s\n, line);
return 0;
}

On Aug 15, 6:18 am, programming love love.for.programm...@gmail.com
wrote:
 write a program to reverse the words in a give string.
 also state the time complexity of the algo.

 if the string is i am a programmer
 the output should be programmer a am i

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

2011-08-15 Thread Pervinder Singh
First reverse the whole sentence and then reverse every word of the
sentence
Example  : I am a programmer

Step 1 Reverse entire sentence

remmargorp a ma I

Step 2 Now reverse every word in a sentence

programmer a am I

Complexity O(n)

On Mon, Aug 15, 2011 at 10:22 PM, Don dondod...@gmail.com wrote:

 #include ctype.h
 #include string.h

 int main(int argc, char* argv[])
 {
char line[500];
char tmp[500];
char *words[100];
int wordCount = 0;
char *p, *wordStart=0;

printf(Enter string:);
fgets(line,500,stdin);

for(p = line; *p; ++p)
{
if (!wordStart  isalpha(*p)) wordStart = p;
else if (wordStart  !isalpha(*p))
{
words[wordCount++] = wordStart;
*p = 0;
wordStart = 0;
}
}

p = tmp;
for(int i = wordCount-1; i = 0; --i) p += sprintf(p, %s ,
 words[i]);
strcpy(line,tmp);
printf(%s\n, line);
return 0;
 }

 On Aug 15, 6:18 am, programming love love.for.programm...@gmail.com
 wrote:
  write a program to reverse the words in a give string.
  also state the time complexity of the algo.
 
  if the string is i am a programmer
  the output should be programmer a am i

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

2011-08-14 Thread Shashank Narayan
HI Rohit,
 Although i haven't checked test many cases also I am not saying
algo is wrong but DP will
 always Gives us Optimal Solution, even for large data-set,but
Greedy Will Fail in That Case.I
  was aware of the same Greedy Algo/Code That you posted but found
DP Will Excite Interviewer :)

 Regards
 Shashank Mani Computer Science Is Awesome So Why I Write Code
 Computer Science
 Birla institute of Technology Mesra

On Sat, Aug 13, 2011 at 11:08 PM, rohit jangid rohit.nsi...@gmail.comwrote:

 ok check this, https://ideone.com/hZboG
 there may be bugs in coding, but I'm quite sure that algo is correct
 need to check more cases though
 but working on all the cases discussed here
 is there any proof that greedy won't work in this case?

 On Sat, Aug 13, 2011 at 11:03 PM, rohit jangid rohit.nsi...@gmail.com
 wrote:
  found some bugs , will repost it
 
 
  On Sat, Aug 13, 2011 at 10:55 PM, rohit jangid rohit.nsi...@gmail.com
 wrote:
  I can only say that above code is wrong, check this code of mine, I
  have tested more cases and all are working,
  https://ideone.com/pEBs8
  see if you can find any bug in this one .
 
  thanks.
 
  On Sat, Aug 13, 2011 at 8:03 PM, WgpShashank 
 shashank7andr...@gmail.com wrote:
  @rohit , I think we will get some cases where greedy won't work check
 out
  its giving 3 jumps still
 
  https://ideone.com/6UWW1
 
  checked in hurray , if anything wrong do send me over gmail ?
 
  Regards
  Shashank Mani Computer Science Is Awesome So Why I Write Code
  Computer Science
  Birla institute of Technology Mesra
 
  --
  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/-/Rerf5mzR7XcJ.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
 
 
  --
  Rohit Jangid
  Under Graduate Student,
  Deptt. of Computer Engineering
  NSIT, Delhi University, India
 
 
 
 
  --
  Rohit Jangid
  Under Graduate Student,
  Deptt. of Computer Engineering
  NSIT, Delhi University, India
 



 --
 Rohit Jangid
 Under Graduate Student,
 Deptt. of Computer Engineering
 NSIT, Delhi University, 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.



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

2011-08-14 Thread Ankit Gupta
A=p(biased coin/5 heads)=8/9  probability that the coin is biased
given 5 heads (bayes theorem)

B=p(unbiased coin/5 heads)=1/9

P(6th head)=A*1+B*1/2=17/18

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

2011-08-13 Thread rohit jangid
@shashank
acc to me the problem can be done easily using greedy approach
https://ideone.com/dYbUd  ( it is your non optimal greedy solution
with just one line added )
couldn't find any case where the above code is giving wrong answer .

if you know any case, please let me know.

I wrote a dp O(n^2) solution before that but found that same can be
done using greedy as well

On Fri, Aug 12, 2011 at 7:57 PM, WgpShashank shashank7andr...@gmail.com wrote:
 A Top Down Memoization DP Algorithm Will be As  Follow

 Step 1. Declare an array of size N say jump[N];
 where ith position indicates the number of jumps requires to reach from
 start to this (ith) position in array .

 Step 2. Initialize jump[0]=0; indicates to reach oth location form starting
 location (3which is obviuosly 0) we don't requires any jump.

 Step 3. Check size of array and value at 0th location in array For first
 index, optimum number of jumps will be zero. Please note that if value at
 first index is zero, we can’t jump to any element and return infinite.so
 these tow cases are
   A.If size of array==0 means array is of zero size;
  B.If value at zero then we can't jump or we can't proceed
 to next location

 Step 4. Run Through Loop for remaining elements in array and Initialize
 jump[i] as infinite. where
    1=i=N.
    Sub-step 4A. (Please Note j runs in inner loop until i=j+a[j] )
     if jump[i]jump[j]+1 update jump[i]  repeat until ji (this
 whole processing will happen in
     inner loop). e.g. for each ith element this loop will run 
 tries to figure out optimal/minimum
    number of jumps required to reach this ith position from starting
 of array .

 Step 5. After running above algorithm we will return array[n-1] that will
 show number of jumps required
 to reach last elemnt in array from start.

 Time Complexity O(N^2)
 Space Complexity O(N)
 Hope You Can Convert it into Production Code

 Do Notify me via mail if i missed anything ??

 Regards
 Shashank Mani Computer Science Is Awesome So Why I Write Code
 Computer Science
 Birla institute of Technology Mesra




 --
 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/-/37L_lAEKGVkJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Rohit Jangid
Under Graduate Student,
Deptt. of Computer Engineering
NSIT, Delhi University, 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.



Re: [algogeeks] Re: Jumping Puzzle

2011-08-13 Thread rohit jangid
I can only say that above code is wrong, check this code of mine, I
have tested more cases and all are working,
https://ideone.com/pEBs8
see if you can find any bug in this one .

thanks.

On Sat, Aug 13, 2011 at 8:03 PM, WgpShashank shashank7andr...@gmail.com wrote:
 @rohit , I think we will get some cases where greedy won't work check out
 its giving 3 jumps still

 https://ideone.com/6UWW1

 checked in hurray , if anything wrong do send me over gmail ?

 Regards
 Shashank Mani Computer Science Is Awesome So Why I Write Code
 Computer Science
 Birla institute of Technology Mesra

 --
 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/-/Rerf5mzR7XcJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Rohit Jangid
Under Graduate Student,
Deptt. of Computer Engineering
NSIT, Delhi University, 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.



Re: [algogeeks] Re: Jumping Puzzle

2011-08-13 Thread rohit jangid
ok check this, https://ideone.com/hZboG
there may be bugs in coding, but I'm quite sure that algo is correct
need to check more cases though
but working on all the cases discussed here
is there any proof that greedy won't work in this case?

On Sat, Aug 13, 2011 at 11:03 PM, rohit jangid rohit.nsi...@gmail.com wrote:
 found some bugs , will repost it


 On Sat, Aug 13, 2011 at 10:55 PM, rohit jangid rohit.nsi...@gmail.com wrote:
 I can only say that above code is wrong, check this code of mine, I
 have tested more cases and all are working,
 https://ideone.com/pEBs8
 see if you can find any bug in this one .

 thanks.

 On Sat, Aug 13, 2011 at 8:03 PM, WgpShashank shashank7andr...@gmail.com 
 wrote:
 @rohit , I think we will get some cases where greedy won't work check out
 its giving 3 jumps still

 https://ideone.com/6UWW1

 checked in hurray , if anything wrong do send me over gmail ?

 Regards
 Shashank Mani Computer Science Is Awesome So Why I Write Code
 Computer Science
 Birla institute of Technology Mesra

 --
 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/-/Rerf5mzR7XcJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Rohit Jangid
 Under Graduate Student,
 Deptt. of Computer Engineering
 NSIT, Delhi University, India




 --
 Rohit Jangid
 Under Graduate Student,
 Deptt. of Computer Engineering
 NSIT, Delhi University, India




-- 
Rohit Jangid
Under Graduate Student,
Deptt. of Computer Engineering
NSIT, Delhi University, 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.



[algogeeks] Re: Jumping Puzzle

2011-08-12 Thread WgpShashank
A Top Down Memoization DP Algorithm Will be As  Follow 

Step 1. Declare an array of size N say jump[N]; 
where ith position indicates the number of jumps requires to reach from 
start to this (ith) position in array . 

Step 2. Initialize jump[0]=0; indicates to reach oth location form starting 
location (3which is obviuosly 0) we don't requires any jump. 

Step 3. Check size of array and value at 0th location in array For first 
index, optimum number of jumps will be zero. Please note that if value at 
first index is zero, we can’t jump to any element and return infinite.so 
these tow cases are 
  A.If size of array==0 means array is of zero size; 
 B.If value at zero then we can't jump or we can't proceed 
to next location 

Step 4. Run Through Loop for remaining elements in array and Initialize 
jump[i] as infinite. where  
   1=i=N. 
   Sub-step 4A. (Please Note j runs in inner loop until i*=j+a[j] )
if jump[i]jump[j]+1 update jump[i]  repeat until ji (this 
whole processing will happen in 
inner loop). e.g. for each ith element this loop will run  
tries to figure out optimal/minimum 
   number of jumps required to reach this ith position from starting 
of array .

Step 5. After running above algorithm we will return array[n-1] that will 
show number of jumps required 
to reach last elemnt in array from start.

Time Complexity O(N^2)
Space Complexity O(N)
Hope You Can Convert it into Production Code 

Do Notify me via mail if i missed anything ??

**Regards
Shashank Mani Computer Science Is Awesome So Why I Write Code
Computer Science
Birla institute of Technology Mesra
*
*   

 
*

-- 
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/-/37L_lAEKGVkJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: Jumping Puzzle

2011-08-11 Thread Algo Lover
Hi, probably you did'nt got my approach :

A={2,2,3,4,1,1,1,1,1}

first i=0 A[i] = 2

so candidates are A[1] ,A[2]

we choose max(A[1] +1 , 2 + A[2]) = A[2]

now we jump to A[2].

now candidates are A[3],A[4],A[5]
we choose max(A[3] + 3 , A[4] + 4, A[5] + 5)
= A[3]

so now we jump to A[3]

now candidates are A[4],A[5],A[6],A[7],

Clearly A[7] + 7 is maximum so we jump to A[7] and then we jump to
A[8]

so we went from 0-2-3-7-8.

Note i am not choosing max A[i] I am choosing max(i + A[i]).

Can anyone find a flaw in this approach ?


On Aug 11, 9:42 pm, Tharun Damera tharun1...@gmail.com wrote:
 Yes, greedy algo doesn't work.. U shud hv DP.. plz post the soln which u
 read..
 A={2,2,3,4,1,1,1,1,1}

 Ur algo gives 0,2,5,6,7,8(these are indices... index starts frm 0)
 best soln is 0,1,3,7,8..

 On Thu, Aug 11, 2011 at 2:37 PM, Arun Vishwanathan
 aaron.nar...@gmail.comwrote:









  I did not get the optimal solution part..how is that u jump 1 to index 1?

  On Thu, Aug 11, 2011 at 10:07 AM, Algo Lover algolear...@gmail.comwrote:

  Given an array, start from the first element and reach the last by
  jumping. The jump length can be at most the value at the current
  position in the array. Optimum result is when you reach the goal in
  minimum number of jumps.

  For ex:
  Given array A = {2,3,1,1,4}
  possible ways to reach the end (index list)
  i) 0,2,3,4 (jump 2 to index 2, then jump 1 to index 3 then 1 to index
  4)
  ii) 0,1,4 (jump 1 to index 1, then jump 3 to index 4)

  Since second solution has only 2 jumps it is the optimum result.

  My solution is for any index i loop from i to i + A[i]
                                                find an index j where
  (j + A[j]) is maximum for all j.
                                                make i=j;

  This solution in O(n) i suppose coz we are picking each element twice
  in the worst case.

  I have read a O(n^2) DP solution for this problem.Is there any
  case where my approach will 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.

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

 --
 D.Tharun| Computer Science and Engineering, IIT Bombay | tharu...@iitb.ac.in |
 +918097345806

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

2011-08-11 Thread Don
int A[100];
int dist[100];
int N;

void findDist(int p, int d)
{
if (d  dist[p])
{
dist[p] = d;
for(int i = 0; i  p; ++i)
if ((i+A[i]) = p)
findDist(i,d+1);
}
}

int main(int argc, char* argv[])
{
int i;
int location = 0;

printf(Number of elements:);
scanf(%d, N);
for(i = 0; i  N; ++i)
{
printf(Element %d:, i);
scanf(%d,A[i]);
}

for(i = 0; i  N; ++i)
dist[i] = N;
findDist(N-1, 0);

for(i = 1; i  N; ++i)
if (dist[i] == (dist[location]-1))
{
printf(Move %d to location %d\n, i-location, i);
location = i;
}

return 0;
}

On Aug 11, 3:07 am, Algo Lover algolear...@gmail.com wrote:
 Given an array, start from the first element and reach the last by
 jumping. The jump length can be at most the value at the current
 position in the array. Optimum result is when you reach the goal in
 minimum number of jumps.

 For ex:
 Given array A = {2,3,1,1,4}
 possible ways to reach the end (index list)
 i) 0,2,3,4 (jump 2 to index 2, then jump 1 to index 3 then 1 to index
 4)
 ii) 0,1,4 (jump 1 to index 1, then jump 3 to index 4)

 Since second solution has only 2 jumps it is the optimum result.

 My solution is for any index i loop from i to i + A[i]
                                                find an index j where
 (j + A[j]) is maximum for all j.
                                                make i=j;

 This solution in O(n) i suppose coz we are picking each element twice
 in the worst case.

 I have read a O(n^2) DP solution for this problem.Is there any
 case where my approach will 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: Probability Puzzle

2011-08-09 Thread Arun Vishwanathan
@dave: yes it seems so that 17/18 is correct...I deduced it from the cond
prob formula..

I have a minor doubt in general why  prob( 2nd toss is a head given that
a head occurred in the first toss ) doesnt seem same as p( head in first
toss and head in second toss with fair coin) +p(head in first toss and head
in second toss with unfair coin)? is it due to the fact that we are not
looking at the same sample space in both cases?i am not able to visualise
the difference in general..this is also the reason why most of the people
said earlier 17/80 as the answer

moreover, if the question was exactly the same except in that it was NOT
mentioned that heads occurred previously , what would the prob of getting a
head in the second toss?

would it be P( of getting tail in first toss and head in second toss given
that fair coin is chosen) +P( of getting head in first toss and head in
second toss given that fair coin is chosen) +P( getting heads in first toss
and heads in second toss given that unfair coin is chosen) ? this for any
toss turns out to be 3/5 can u explain the logic abt why it always gives
3/5?

On Tue, Aug 9, 2011 at 7:37 AM, raj kumar megamonste...@gmail.com wrote:

 plz reply am i right or 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.




-- 
 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: Probability Puzzle

2011-08-09 Thread arpit.gupta
it is (1/5)/( (4/5 *(1/2)^6) + (1/5 * 1)) = 80/85 = 16/17

On Aug 7, 10:54 pm, Nitish Garg nitishgarg1...@gmail.com wrote:
 Should be (4/5 *(1/2)^6) + (1/5 * 1) = 17/80

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

2011-08-09 Thread shady
go through the posts before posting anything :)

On Tue, Aug 9, 2011 at 6:29 PM, arpit.gupta arpitg1...@gmail.com wrote:

 it is (1/5)/( (4/5 *(1/2)^6) + (1/5 * 1)) = 80/85 = 16/17

 On Aug 7, 10:54 pm, Nitish Garg nitishgarg1...@gmail.com wrote:
  Should be (4/5 *(1/2)^6) + (1/5 * 1) = 17/80

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

2011-08-09 Thread arpit.gupta
ans is 16/17 + 1/2*1/17 = 33/34

On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 A bag contains 5 coins. Four of them are fair and one has heads on
 both sides. You randomly pulled one coin from the bag and tossed it 5
 times, heads turned up all five times. What is the probability that
 you toss next time, heads turns up. (All this time you don't know you
 were tossing a fair coin or not).

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

2011-08-09 Thread Dave
@Arpit: No. The probability of getting 6 consecutive heads is
1/5 * 1 + 4/5 * (1/2)^6 ) = 17/80,
while the probability of getting 5 consecutive heads is
1/5 * 1 + 4/5 * (1/2)^6 ) = 9/40.
Thus, the probability of getting a head on the sixth roll given that
you have gotten heads on all five previous rolls is (17/80) / (9/40),
which is 17/18.

Dave

On Aug 9, 7:59 am, arpit.gupta arpitg1...@gmail.com wrote:
 it is (1/5)/( (4/5 *(1/2)^6) + (1/5 * 1)) = 80/85 = 16/17

 On Aug 7, 10:54 pm, Nitish Garg nitishgarg1...@gmail.com wrote:



  Should be (4/5 *(1/2)^6) + (1/5 * 1) = 17/80

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

2011-08-09 Thread Dave
@Arun: The probability of getting a head on the first toss is
1/5 * 1 + 4/5 * (1/2) ) = 3/5,
while the probability of getting 2 consecutive heads is
1/5 * 1 + 4/5 * (1/2)^2 ) = 2/5.
Thus, the probability of getting a head on the second roll given that
you have gotten a head on the first roll is (2/5) / (3/5), which is
2/3.

If you didn't know the outcome of the first roll, the probability of
heads on the second roll would still be 3/5.

Dave

On Aug 9, 2:57 am, Arun Vishwanathan aaron.nar...@gmail.com wrote:
 @dave: yes it seems so that 17/18 is correct...I deduced it from the cond
 prob formula..

 I have a minor doubt in general why  prob( 2nd toss is a head given that
 a head occurred in the first toss ) doesnt seem same as p( head in first
 toss and head in second toss with fair coin) +p(head in first toss and head
 in second toss with unfair coin)? is it due to the fact that we are not
 looking at the same sample space in both cases?i am not able to visualise
 the difference in general..this is also the reason why most of the people
 said earlier 17/80 as the answer

 moreover, if the question was exactly the same except in that it was NOT
 mentioned that heads occurred previously , what would the prob of getting a
 head in the second toss?

 would it be P( of getting tail in first toss and head in second toss given
 that fair coin is chosen) +P( of getting head in first toss and head in
 second toss given that fair coin is chosen) +P( getting heads in first toss
 and heads in second toss given that unfair coin is chosen) ? this for any
 toss turns out to be 3/5 can u explain the logic abt why it always gives
 3/5?

 On Tue, Aug 9, 2011 at 7:37 AM, raj kumar megamonste...@gmail.com wrote:
  plz reply am i right or 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.

 --
  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: Probability Puzzle

2011-08-09 Thread arpit.gupta
@dave- calculation mistake on my part - method is right.

getting 17/18 only thanks anyways.

On Aug 9, 6:26 pm, Dave dave_and_da...@juno.com wrote:
 @Arun: The probability of getting a head on the first toss is
 1/5 * 1 + 4/5 * (1/2) ) = 3/5,
 while the probability of getting 2 consecutive heads is
 1/5 * 1 + 4/5 * (1/2)^2 ) = 2/5.
 Thus, the probability of getting a head on the second roll given that
 you have gotten a head on the first roll is (2/5) / (3/5), which is
 2/3.

 If you didn't know the outcome of the first roll, the probability of
 heads on the second roll would still be 3/5.

 Dave

 On Aug 9, 2:57 am, Arun Vishwanathan aaron.nar...@gmail.com wrote:







  @dave: yes it seems so that 17/18 is correct...I deduced it from the cond
  prob formula..

  I have a minor doubt in general why  prob( 2nd toss is a head given that
  a head occurred in the first toss ) doesnt seem same as p( head in first
  toss and head in second toss with fair coin) +p(head in first toss and head
  in second toss with unfair coin)? is it due to the fact that we are not
  looking at the same sample space in both cases?i am not able to visualise
  the difference in general..this is also the reason why most of the people
  said earlier 17/80 as the answer

  moreover, if the question was exactly the same except in that it was NOT
  mentioned that heads occurred previously , what would the prob of getting a
  head in the second toss?

  would it be P( of getting tail in first toss and head in second toss given
  that fair coin is chosen) +P( of getting head in first toss and head in
  second toss given that fair coin is chosen) +P( getting heads in first toss
  and heads in second toss given that unfair coin is chosen) ? this for any
  toss turns out to be 3/5 can u explain the logic abt why it always gives
  3/5?

  On Tue, Aug 9, 2011 at 7:37 AM, raj kumar megamonste...@gmail.com wrote:
   plz reply am i right or 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.

  --
   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: Probability Puzzle

2011-08-09 Thread Dave
The probability of getting n consecutive heads is
P(n heads) = 1/5 * 1 + 4/5 * (1/2)^n,
Thus, the probability of getting a head on the n+1st roll given that
you have gotten heads on all n previous rolls is
P(n+1 heads | n heads) = P(n+1) / P(n)
= ( 1/5 * 1 + 4/5 * (1/2)^(n+1) ) / ( 1/5 * 1 + 4/5 * (1/2)^n ).
Multiplying numerator and denominator by 5* 2^(n-1) and recognizing 4
as 2^2 gives
P(n+1 heads | n heads) = (2^(n-1) + 1) / (2^(n-1) + 2).

Dave

On Aug 9, 12:30 am, programming love love.for.programm...@gmail.com
wrote:
 @Dave: I guess 17/18 is correct. Since we have to *calculate the probability
 of getting a head in the 6th flip given that first 5 flips are a head*. Can
 you please explain how you got the values of consequent flips when you said
 this?

 *In fact, the probability is 3/5 for the first flip. After a head is
 flipped, the probability of a head is 2/3. After two heads have been
 flipped, it is 3/4. After 3 heads, it is 5/6. After 4 heads, the
  probability is 9/10, and after 5 heads, the probability is 17/18.*

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

2011-08-09 Thread arpit.gupta
@dave - method is right, calculation mistake on my part, getting 17/18
only. thanks anyways.

On Aug 9, 6:26 pm, Dave dave_and_da...@juno.com wrote:
 @Arun: The probability of getting a head on the first toss is
 1/5 * 1 + 4/5 * (1/2) ) = 3/5,
 while the probability of getting 2 consecutive heads is
 1/5 * 1 + 4/5 * (1/2)^2 ) = 2/5.
 Thus, the probability of getting a head on the second roll given that
 you have gotten a head on the first roll is (2/5) / (3/5), which is
 2/3.

 If you didn't know the outcome of the first roll, the probability of
 heads on the second roll would still be 3/5.

 Dave

 On Aug 9, 2:57 am, Arun Vishwanathan aaron.nar...@gmail.com wrote:







  @dave: yes it seems so that 17/18 is correct...I deduced it from the cond
  prob formula..

  I have a minor doubt in general why  prob( 2nd toss is a head given that
  a head occurred in the first toss ) doesnt seem same as p( head in first
  toss and head in second toss with fair coin) +p(head in first toss and head
  in second toss with unfair coin)? is it due to the fact that we are not
  looking at the same sample space in both cases?i am not able to visualise
  the difference in general..this is also the reason why most of the people
  said earlier 17/80 as the answer

  moreover, if the question was exactly the same except in that it was NOT
  mentioned that heads occurred previously , what would the prob of getting a
  head in the second toss?

  would it be P( of getting tail in first toss and head in second toss given
  that fair coin is chosen) +P( of getting head in first toss and head in
  second toss given that fair coin is chosen) +P( getting heads in first toss
  and heads in second toss given that unfair coin is chosen) ? this for any
  toss turns out to be 3/5 can u explain the logic abt why it always gives
  3/5?

  On Tue, Aug 9, 2011 at 7:37 AM, raj kumar megamonste...@gmail.com wrote:
   plz reply am i right or 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.

  --
   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: Probability Puzzle

2011-08-09 Thread ritu
The statement You randomly pulled one coin from the bag and tossed
tells that all the  events of tossing the coin are independent hence
ans is 3/5

On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 A bag contains 5 coins. Four of them are fair and one has heads on
 both sides. You randomly pulled one coin from the bag and tossed it 5
 times, heads turned up all five times. What is the probability that
 you toss next time, heads turns up. (All this time you don't know you
 were tossing a fair coin or not).

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

2011-08-09 Thread programming love
@Dave: Thanks for the explanation :)

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

2011-08-09 Thread Dave
@Ritu: We are flipping one coin five times. Are you saying that you
don't learn anything about the coin by flipping it? Would you learn
something if any one of the five flips turned up tails? After a tails,
would you say that the probability of a subsequent head is still 3/5?

Dave

On Aug 9, 11:19 am, ritu ritugarg.c...@gmail.com wrote:
 The statement You randomly pulled one coin from the bag and tossed
 tells that all the  events of tossing the coin are independent hence
 ans is 3/5

 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:



  A bag contains 5 coins. Four of them are fair and one has heads on
  both sides. You randomly pulled one coin from the bag and tossed it 5
  times, heads turned up all five times. What is the probability that
  you toss next time, heads turns up. (All this time you don't know you
  were tossing a fair coin or not).

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

2011-08-09 Thread Prakash D
@dave: thank you.. nice explanation :)

On Wed, Aug 10, 2011 at 3:24 AM, Dave dave_and_da...@juno.com wrote:

 @Ritu: We are flipping one coin five times. Are you saying that you
 don't learn anything about the coin by flipping it? Would you learn
 something if any one of the five flips turned up tails? After a tails,
 would you say that the probability of a subsequent head is still 3/5?

 Dave

 On Aug 9, 11:19 am, ritu ritugarg.c...@gmail.com wrote:
  The statement You randomly pulled one coin from the bag and tossed
  tells that all the  events of tossing the coin are independent hence
  ans is 3/5
 
  On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 
 
 
   A bag contains 5 coins. Four of them are fair and one has heads on
   both sides. You randomly pulled one coin from the bag and tossed it 5
   times, heads turned up all five times. What is the probability that
   you toss next time, heads turns up. (All this time you don't know you
   were tossing a fair coin or not).

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

2011-08-09 Thread Shachindra A C
@dave : nice explanationsthank you for pointing out :)

On Wed, Aug 10, 2011 at 3:39 AM, Prakash D cegprak...@gmail.com wrote:

 @dave: thank you.. nice explanation :)


 On Wed, Aug 10, 2011 at 3:24 AM, Dave dave_and_da...@juno.com wrote:

 @Ritu: We are flipping one coin five times. Are you saying that you
 don't learn anything about the coin by flipping it? Would you learn
 something if any one of the five flips turned up tails? After a tails,
 would you say that the probability of a subsequent head is still 3/5?

 Dave

 On Aug 9, 11:19 am, ritu ritugarg.c...@gmail.com wrote:
  The statement You randomly pulled one coin from the bag and tossed
  tells that all the  events of tossing the coin are independent hence
  ans is 3/5
 
  On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 
 
 
   A bag contains 5 coins. Four of them are fair and one has heads on
   both sides. You randomly pulled one coin from the bag and tossed it 5
   times, heads turned up all five times. What is the probability that
   you toss next time, heads turns up. (All this time you don't know you
   were tossing a fair coin or not).

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



[algogeeks] Re: Amazon Puzzle

2011-08-08 Thread Venkat
I ve a small assumption, if we consider flight go in straight
direction.

Then in one paper, they can write  Walk towards flight direction and
jump first.

In another paper Walk towards opposite to flight direction.
and jump jump at any random location in that stright line..
then they can meet at middle point.

Its may be a soultion, but not sure.

Thanks
Venkat
http://cloud-computation.blogspot.com/

On Aug 7, 10:59 pm, Algo Lover algolear...@gmail.com wrote:
 Two people are travelling through flight. Both have parachute and jump
 anywhere randomly i.e none of them knows who has jumped where.(Assume
 there's a big desert and they jump at any random location). Now, both
 of them have a single piece of paper on which they can write
 instructions before jumping and that's the only way they can meet each
 other. What would they write on paper before jumping ?

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

2011-08-08 Thread siddharam suresh
i feel, 1st person who jumps he just writes the time at he jumped. second
person(my assumption) may be having the compass and watch to calculate the
direction(of the 1st person) on his page/paper.

Thank you,
Siddharam


On Mon, Aug 8, 2011 at 11:30 AM, Venkat venkataharishan...@gmail.comwrote:

 I ve a small assumption, if we consider flight go in straight
 direction.

 Then in one paper, they can write  Walk towards flight direction and
 jump first.

 In another paper Walk towards opposite to flight direction.
 and jump jump at any random location in that stright line..
 then they can meet at middle point.

 Its may be a soultion, but not sure.

 Thanks
 Venkat
 http://cloud-computation.blogspot.com/

 On Aug 7, 10:59 pm, Algo Lover algolear...@gmail.com wrote:
  Two people are travelling through flight. Both have parachute and jump
  anywhere randomly i.e none of them knows who has jumped where.(Assume
  there's a big desert and they jump at any random location). Now, both
  of them have a single piece of paper on which they can write
  instructions before jumping and that's the only way they can meet each
  other. What would they write on paper before jumping ?

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

2011-08-08 Thread sumit gaur
(3/5)

On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 A bag contains 5 coins. Four of them are fair and one has heads on
 both sides. You randomly pulled one coin from the bag and tossed it 5
 times, heads turned up all five times. What is the probability that
 you toss next time, heads turns up. (All this time you don't know you
 were tossing a fair coin or not).

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

2011-08-08 Thread Shachindra A C
@brijesh

*first five times* is mentioned intentionally to mislead i think. I vote for
3/5. Moreover, 17/80 doesn't make sense also. Plz correct me if I am wrong.


On Mon, Aug 8, 2011 at 12:06 PM, sumit gaur sumitgau...@gmail.com wrote:

 (3/5)

 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
  A bag contains 5 coins. Four of them are fair and one has heads on
  both sides. You randomly pulled one coin from the bag and tossed it 5
  times, heads turned up all five times. What is the probability that
  you toss next time, heads turns up. (All this time you don't know you
  were tossing a fair coin or not).

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



[algogeeks] Re: Amazon Puzzle

2011-08-08 Thread sumit gaur
Person jumping first faces in the direction of flight, person jumping
second faces in the direction opp. to the flight, and will just drop
down and they'll walk in the facing direction after jump.

On Aug 7, 10:59 pm, Algo Lover algolear...@gmail.com wrote:
 Two people are travelling through flight. Both have parachute and jump
 anywhere randomly i.e none of them knows who has jumped where.(Assume
 there's a big desert and they jump at any random location). Now, both
 of them have a single piece of paper on which they can write
 instructions before jumping and that's the only way they can meet each
 other. What would they write on paper before jumping ?

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

2011-08-08 Thread Puneet Goyal
I think if we use the relevance of the flight we would not be able to do it,
because we dont when they jumped or where they jumped,
as far as i think, any one can just write an angle and the app. length of
the shadow( they may take the same as their heights) and i think that will
take them to the same height, i know it sounds a bit ridiculous :P
and the sunlight must be there

On Mon, Aug 8, 2011 at 1:34 PM, sumit gaur sumitgau...@gmail.com wrote:

 Person jumping first faces in the direction of flight, person jumping
 second faces in the direction opp. to the flight, and will just drop
 down and they'll walk in the facing direction after jump.

 On Aug 7, 10:59 pm, Algo Lover algolear...@gmail.com wrote:
  Two people are travelling through flight. Both have parachute and jump
  anywhere randomly i.e none of them knows who has jumped where.(Assume
  there's a big desert and they jump at any random location). Now, both
  of them have a single piece of paper on which they can write
  instructions before jumping and that's the only way they can meet each
  other. What would they write on paper before jumping ?

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




-- 
---
Puneet Goyal
Student of B. Tech. III Year (Software Engineering)
Delhi Technological University, 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: Amazon Puzzle

2011-08-08 Thread Puneet Goyal
On Mon, Aug 8, 2011 at 1:58 PM, Puneet Goyal puneetgoya...@gmail.comwrote:

 I think if we use the relevance of the flight we would not be able to do
 it, because we dont know when they jumped or where they jumped,
 as far as i think, any one can just write an angle and the app. length of
 the shadow( they may take the same as their heights) and i think that will
 take them to the same point, i know it sounds a bit ridiculous :P
 and the sunlight must be there


 --

---
Puneet Goyal
Student of B. Tech. III Year (Software Engineering)
Delhi Technological University, 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: Probability Puzzle

2011-08-08 Thread Puneet Goyal
I think 17/80 is wrong
because if you say that while calculating the answer 3/5, you havent
included the first 5 cases, then even after including it will only increase
the probability of getting the biased coin in hand and thus increasing the
overall probability of getting the heads and 17/80 is a way lesser than 3/5
although i am not sure about 3/5 even coz of the reasoning i just gave

also, when you are calculating 4/5*1/2^6 you are not getting any benefit out
of the first five tosses, like, they must have gave you some positive
response towards that yes, you will get the head even next time, but doing
this you are actually decreasing the probability as compared to the one you
could have get without those 5 cases

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

 @brijesh

 *first five times* is mentioned intentionally to mislead i think. I vote
 for 3/5. Moreover, 17/80 doesn't make sense also. Plz correct me if I am
 wrong.


 On Mon, Aug 8, 2011 at 12:06 PM, sumit gaur sumitgau...@gmail.com wrote:

 (3/5)

 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
  A bag contains 5 coins. Four of them are fair and one has heads on
  both sides. You randomly pulled one coin from the bag and tossed it 5
  times, heads turned up all five times. What is the probability that
  you toss next time, heads turns up. (All this time you don't know you
  were tossing a fair coin or not).

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




-- 
---
Puneet Goyal
Student of B. Tech. III Year (Software Engineering)
Delhi Technological University, 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: Amazon Puzzle

2011-08-08 Thread sushant gupta
Maybe those guys were having some gadgets like mobile phones or satellite
phones..  So they would write their number on the other's paper...

Or maybe they were carrying a GPS system..  So they would write a common
(latitude,longitude) to meet at the same point...

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

2011-08-08 Thread Maddy
I think the answer is 17/80, because
as you say the 5 trials are independent.. but
the fact that a head turns up in all the 5 trials, give some
information about our original probability of choosing the coins.

in case we had obtained a tail in the first trial, we can be sure its
the fair coin, and so the consecutive trials would become
independent..

but since that is not the case, every head is going to increase the
chance of choosing the biased coin(initially), and hence affect the
probability of the next head..

before the first trial probability of landing a head is 3/5, but once
u see the first head, the probability of landing a head on the second
trial changes to 4/5*1/4+1/5, and so on..that is, there is a higher
probability that we chose a biased coin, rather than the fair coin.

hope its clear..

On Aug 7, 11:36 pm, sumit gaur sumitgau...@gmail.com wrote:
 (3/5)

 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:







  A bag contains 5 coins. Four of them are fair and one has heads on
  both sides. You randomly pulled one coin from the bag and tossed it 5
  times, heads turned up all five times. What is the probability that
  you toss next time, heads turns up. (All this time you don't know you
  were tossing a fair coin or not).

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

2011-08-08 Thread Don
The answer is 17 in 18, because flipping 5 heads in a row is evidence
that the probability is high that we have the coin with two heads.
Don

On Aug 7, 12:34 pm, Algo Lover algolear...@gmail.com wrote:
 A bag contains 5 coins. Four of them are fair and one has heads on
 both sides. You randomly pulled one coin from the bag and tossed it 5
 times, heads turned up all five times. What is the probability that
 you toss next time, heads turns up. (All this time you don't know you
 were tossing a fair coin or not).

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

2011-08-08 Thread Arun Vishwanathan
@don: i too get yr answer 17/18 using conditional probability...does that
make sense??i guess this is first new answer lol

On Mon, Aug 8, 2011 at 9:29 PM, Don dondod...@gmail.com wrote:

 The answer is 17 in 18, because flipping 5 heads in a row is evidence
 that the probability is high that we have the coin with two heads.
 Don

 On Aug 7, 12:34 pm, Algo Lover algolear...@gmail.com wrote:
  A bag contains 5 coins. Four of them are fair and one has heads on
  both sides. You randomly pulled one coin from the bag and tossed it 5
  times, heads turned up all five times. What is the probability that
  you toss next time, heads turns up. (All this time you don't know you
  were tossing a fair coin or not).

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

2011-08-08 Thread Don
Consider the 5 * 64 possible outcomes for the selection of coin and
six flips, each one happening with equal probability. Of those 320
possible outcomes, 4*62 are excluded by knowing that the first 5 flips
are heads. That leaves 64 outcomes with the rigged coin and 2 outcomes
with each of the fair coins, for a total of 72 outcomes. 68 of those
are heads, so the answer to the puzzle is 68 of 72, or 17 of 18.
Don

On Aug 8, 2:36 am, Shachindra A C sachindr...@gmail.com wrote:
 @brijesh

 *first five times* is mentioned intentionally to mislead i think. I vote for
 3/5. Moreover, 17/80 doesn't make sense also. Plz correct me if I am wrong.



 On Mon, Aug 8, 2011 at 12:06 PM, sumit gaur sumitgau...@gmail.com wrote:
  (3/5)

  On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
   A bag contains 5 coins. Four of them are fair and one has heads on
   both sides. You randomly pulled one coin from the bag and tossed it 5
   times, heads turned up all five times. What is the probability that
   you toss next time, heads turns up. (All this time you don't know you
   were tossing a fair coin or not).

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

2011-08-08 Thread shady
answer is 3/5. 17/80 is the answer for 6 consecutive heads.

On Tue, Aug 9, 2011 at 2:07 AM, Don dondod...@gmail.com wrote:

 Consider the 5 * 64 possible outcomes for the selection of coin and
 six flips, each one happening with equal probability. Of those 320
 possible outcomes, 4*62 are excluded by knowing that the first 5 flips
 are heads. That leaves 64 outcomes with the rigged coin and 2 outcomes
 with each of the fair coins, for a total of 72 outcomes. 68 of those
 are heads, so the answer to the puzzle is 68 of 72, or 17 of 18.
 Don

 On Aug 8, 2:36 am, Shachindra A C sachindr...@gmail.com wrote:
  @brijesh
 
  *first five times* is mentioned intentionally to mislead i think. I vote
 for
  3/5. Moreover, 17/80 doesn't make sense also. Plz correct me if I am
 wrong.
 
 
 
  On Mon, Aug 8, 2011 at 12:06 PM, sumit gaur sumitgau...@gmail.com
 wrote:
   (3/5)
 
   On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
A bag contains 5 coins. Four of them are fair and one has heads on
both sides. You randomly pulled one coin from the bag and tossed it 5
times, heads turned up all five times. What is the probability that
you toss next time, heads turns up. (All this time you don't know you
were tossing a fair coin or not).
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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.



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

2011-08-08 Thread Arun Vishwanathan
@shady: 3/5 can be the answer to such a question: what is prob of getting
head on nth toss if we have 4 coins fair and one biased...then at nth toss u
choose 4/5 1/5 prob and then u get 3/5

@shady , don: i did this: P( 6th head | 5 heads occured)= P( 6 heads )/ P( 5
heads)

answr u get is 17/18..i cud be wrong please correct if so

On Mon, Aug 8, 2011 at 10:45 PM, shady sinv...@gmail.com wrote:

 answer is 3/5. 17/80 is the answer for 6 consecutive heads.


 On Tue, Aug 9, 2011 at 2:07 AM, Don dondod...@gmail.com wrote:

 Consider the 5 * 64 possible outcomes for the selection of coin and
 six flips, each one happening with equal probability. Of those 320
 possible outcomes, 4*62 are excluded by knowing that the first 5 flips
 are heads. That leaves 64 outcomes with the rigged coin and 2 outcomes
 with each of the fair coins, for a total of 72 outcomes. 68 of those
 are heads, so the answer to the puzzle is 68 of 72, or 17 of 18.
 Don

 On Aug 8, 2:36 am, Shachindra A C sachindr...@gmail.com wrote:
  @brijesh
 
  *first five times* is mentioned intentionally to mislead i think. I vote
 for
  3/5. Moreover, 17/80 doesn't make sense also. Plz correct me if I am
 wrong.
 
 
 
  On Mon, Aug 8, 2011 at 12:06 PM, sumit gaur sumitgau...@gmail.com
 wrote:
   (3/5)
 
   On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
A bag contains 5 coins. Four of them are fair and one has heads on
both sides. You randomly pulled one coin from the bag and tossed it
 5
times, heads turned up all five times. What is the probability that
you toss next time, heads turns up. (All this time you don't know
 you
were tossing a fair coin or not).
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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.


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




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

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



Re: [algogeeks] Re: Probability Puzzle

2011-08-08 Thread Shuaib Khan
Man, I feel so stupid. Yes, it is a case of conditional probability. We have
to calculate the probability of six heads, given that 5 heads have
occured. So answer is 17/18.

On Tue, Aug 9, 2011 at 1:47 AM, Arun Vishwanathan aaron.nar...@gmail.comwrote:

 @shady: 3/5 can be the answer to such a question: what is prob of getting
 head on nth toss if we have 4 coins fair and one biased...then at nth toss u
 choose 4/5 1/5 prob and then u get 3/5

 @shady , don: i did this: P( 6th head | 5 heads occured)= P( 6 heads )/ P(
 5 heads)

 answr u get is 17/18..i cud be wrong please correct if so


 On Mon, Aug 8, 2011 at 10:45 PM, shady sinv...@gmail.com wrote:

 answer is 3/5. 17/80 is the answer for 6 consecutive heads.


 On Tue, Aug 9, 2011 at 2:07 AM, Don dondod...@gmail.com wrote:

 Consider the 5 * 64 possible outcomes for the selection of coin and
 six flips, each one happening with equal probability. Of those 320
 possible outcomes, 4*62 are excluded by knowing that the first 5 flips
 are heads. That leaves 64 outcomes with the rigged coin and 2 outcomes
 with each of the fair coins, for a total of 72 outcomes. 68 of those
 are heads, so the answer to the puzzle is 68 of 72, or 17 of 18.
 Don

 On Aug 8, 2:36 am, Shachindra A C sachindr...@gmail.com wrote:
  @brijesh
 
  *first five times* is mentioned intentionally to mislead i think. I
 vote for
  3/5. Moreover, 17/80 doesn't make sense also. Plz correct me if I am
 wrong.
 
 
 
  On Mon, Aug 8, 2011 at 12:06 PM, sumit gaur sumitgau...@gmail.com
 wrote:
   (3/5)
 
   On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
A bag contains 5 coins. Four of them are fair and one has heads on
both sides. You randomly pulled one coin from the bag and tossed it
 5
times, heads turned up all five times. What is the probability that
you toss next time, heads turns up. (All this time you don't know
 you
were tossing a fair coin or not).
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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.


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




-- 
Shuaib
http://www.bytehood.com
http://twitter.com/ShuaibKhan

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

2011-08-08 Thread vinay aggarwal
answer should be 3/5
think like that tossing 5 times will not help you predict the outcome
of sixth toss. Therefore that information is meaningless.

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

2011-08-08 Thread Dave
@Vinay: What if you tossed 100 consecutive heads? Would that be enough
to convince you that you had the double-headed coin? If so, then
doesn't tossing 5 consecutive heads give you at least an inkling that
you might have it? Wouldn't you then think that there would be a
higher probability of getting a head on the sixth toss than there was
on the first toss (3/5)? Don's conditional probability answer 17/18 is
the right answer.

Dave

On Aug 8, 5:04 pm, vinay aggarwal vinayiiit2...@gmail.com wrote:
 answer should be 3/5
 think like that tossing 5 times will not help you predict the outcome
 of sixth toss. Therefore that information is meaningless.

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

2011-08-08 Thread Dipankar Patro
3/5.

As the question doesn't ask anything about the sequence.
Had the question been  Find the probability that all 6 are H  then it
would have been 17/80.

On 9 August 2011 04:07, Dave dave_and_da...@juno.com wrote:

 @Vinay: What if you tossed 100 consecutive heads? Would that be enough
 to convince you that you had the double-headed coin? If so, then
 doesn't tossing 5 consecutive heads give you at least an inkling that
 you might have it? Wouldn't you then think that there would be a
 higher probability of getting a head on the sixth toss than there was
 on the first toss (3/5)? Don's conditional probability answer 17/18 is
 the right answer.

 Dave

 On Aug 8, 5:04 pm, vinay aggarwal vinayiiit2...@gmail.com wrote:
  answer should be 3/5
  think like that tossing 5 times will not help you predict the outcome
  of sixth toss. Therefore that information is meaningless.

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




-- 
___

Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees

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

2011-08-08 Thread Dave
@Dipankar: You are correct about the answer to your alternative
question being 17/80, but your answer 3/5 says that you don't think
you have learned anything by the five heads flips. Don has given a
good explanation as to why the answer is 17/18, but you apparently
refuse to accept it. There is none so blind as one who will not see.

Dave

On Aug 8, 9:26 pm, Dipankar Patro dip10c...@gmail.com wrote:
 3/5.

 As the question doesn't ask anything about the sequence.
 Had the question been  Find the probability that all 6 are H  then it
 would have been 17/80.

 On 9 August 2011 04:07, Dave dave_and_da...@juno.com wrote:





  @Vinay: What if you tossed 100 consecutive heads? Would that be enough
  to convince you that you had the double-headed coin? If so, then
  doesn't tossing 5 consecutive heads give you at least an inkling that
  you might have it? Wouldn't you then think that there would be a
  higher probability of getting a head on the sixth toss than there was
  on the first toss (3/5)? Don's conditional probability answer 17/18 is
  the right answer.

  Dave

  On Aug 8, 5:04 pm, vinay aggarwal vinayiiit2...@gmail.com wrote:
   answer should be 3/5
   think like that tossing 5 times will not help you predict the outcome
   of sixth toss. Therefore that information is meaningless.

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

 --
 ___­

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

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

2011-08-08 Thread coder dumca
it's 3/5

On Tue, Aug 9, 2011 at 8:29 AM, Dave dave_and_da...@juno.com wrote:

 @Dipankar: You are correct about the answer to your alternative
 question being 17/80, but your answer 3/5 says that you don't think
 you have learned anything by the five heads flips. Don has given a
 good explanation as to why the answer is 17/18, but you apparently
 refuse to accept it. There is none so blind as one who will not see.

 Dave

 On Aug 8, 9:26 pm, Dipankar Patro dip10c...@gmail.com wrote:
  3/5.
 
  As the question doesn't ask anything about the sequence.
  Had the question been  Find the probability that all 6 are H  then it
  would have been 17/80.
 
  On 9 August 2011 04:07, Dave dave_and_da...@juno.com wrote:
 
 
 
 
 
   @Vinay: What if you tossed 100 consecutive heads? Would that be enough
   to convince you that you had the double-headed coin? If so, then
   doesn't tossing 5 consecutive heads give you at least an inkling that
   you might have it? Wouldn't you then think that there would be a
   higher probability of getting a head on the sixth toss than there was
   on the first toss (3/5)? Don's conditional probability answer 17/18 is
   the right answer.
 
   Dave
 
   On Aug 8, 5:04 pm, vinay aggarwal vinayiiit2...@gmail.com wrote:
answer should be 3/5
think like that tossing 5 times will not help you predict the outcome
of sixth toss. Therefore that information is meaningless.
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
 
 ___­
 
  Please do not print this e-mail until urgent requirement. Go Green!!
  Save Papers = Save Trees

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

2011-08-08 Thread raj kumar
@all those who gave Should be (4/5 *(1/2)^6) + (1/5 * 1) = 17/80


when it's already given that 5 heads have turned up already then why abut
are you adding that probability
you all are considering it as finding the probability of finding 6
consecutive heads.

since all tosses are independent the answer should be 3/5.
 the point that 5 heads have turned up already may points that the coin
selected is biased in that case pr(6)=1;
now the answer depends on the interviewer  according to me it should be 3/5


thanks

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

2011-08-08 Thread sagar pareek
Pls check the ques 8th
This may remove misunderstanding...

http://www.folj.com/puzzles/difficult-logic-problems.htm

On Tue, Aug 9, 2011 at 10:21 AM, raj kumar megamonste...@gmail.com wrote:

 @all those who gave Should be (4/5 *(1/2)^6) + (1/5 * 1) = 17/80


 when it's already given that 5 heads have turned up already then why abut
 are you adding that probability
 you all are considering it as finding the probability of finding 6
 consecutive heads.

 since all tosses are independent the answer should be 3/5.
  the point that 5 heads have turned up already may points that the coin
 selected is biased in that case pr(6)=1;
 now the answer depends on the interviewer  according to me it should be 3/5


 thanks


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

2011-08-08 Thread Dave
@Coder: You (and others) are saying that the probability of a head is
3/5 on the first flip, and that it doesn't change after any number of
heads are flipped. Notice, however, that if the first flip were tails,
you wouldn't say that the probability of getting heads on the next
flip is 3/5. You would have learned that one of the four fair coins
was chosen. So even though the probability of a head was 3/5 on the
first flip, it changes to 1/2 on all flips subsequent to a tail. Since
the probabililty changes if a tail is flipped, what makes you think it
doesn't change if a head is flipped.

In fact, the probability is 3/5 for the first flip. After a head is
flipped, the probability of a head is 2/3. After two heads have been
flipped, it is 3/4. After 3 heads, it is 5/6. After 4 heads, the
probability is 9/10, and after 5 heads, the probability is 17/18.

Dave

On Aug 8, 11:23 pm, coder dumca coder.du...@gmail.com wrote:
 it's 3/5



 On Tue, Aug 9, 2011 at 8:29 AM, Dave dave_and_da...@juno.com wrote:
  @Dipankar: You are correct about the answer to your alternative
  question being 17/80, but your answer 3/5 says that you don't think
  you have learned anything by the five heads flips. Don has given a
  good explanation as to why the answer is 17/18, but you apparently
  refuse to accept it. There is none so blind as one who will not see.

  Dave

  On Aug 8, 9:26 pm, Dipankar Patro dip10c...@gmail.com wrote:
   3/5.

   As the question doesn't ask anything about the sequence.
   Had the question been  Find the probability that all 6 are H  then it
   would have been 17/80.

   On 9 August 2011 04:07, Dave dave_and_da...@juno.com wrote:

@Vinay: What if you tossed 100 consecutive heads? Would that be enough
to convince you that you had the double-headed coin? If so, then
doesn't tossing 5 consecutive heads give you at least an inkling that
you might have it? Wouldn't you then think that there would be a
higher probability of getting a head on the sixth toss than there was
on the first toss (3/5)? Don's conditional probability answer 17/18 is
the right answer.

Dave

On Aug 8, 5:04 pm, vinay aggarwal vinayiiit2...@gmail.com wrote:
 answer should be 3/5
 think like that tossing 5 times will not help you predict the outcome
 of sixth toss. Therefore that information is meaningless.

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

   --

  ___­­

   Please do not print this e-mail until urgent requirement. Go Green!!
   Save Papers = Save Trees

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

2011-08-08 Thread Dave
@Raj. Granted that the first flip has a 3/5 probability of getting a
head. But if it produces a tail, would you say that the second flip
also has a 3/5 probability of getting a head? Or have you learned
something from the tail? If you learn something from a tail, why don't
you learn something from a head?

Dave

On Aug 8, 11:51 pm, raj kumar megamonste...@gmail.com wrote:
 @all those who gave Should be (4/5 *(1/2)^6) + (1/5 * 1) = 17/80

 when it's already given that 5 heads have turned up already then why abut
 are you adding that probability
 you all are considering it as finding the probability of finding 6
 consecutive heads.

 since all tosses are independent the answer should be 3/5.
  the point that 5 heads have turned up already may points that the coin
 selected is biased in that case pr(6)=1;
 now the answer depends on the interviewer  according to me it should be 3/5

 thanks

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

2011-08-08 Thread raj kumar
Just to resolve the issue what will be the probability of getting 6
consecutive heads

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

2011-08-08 Thread raj kumar
no then it will be 1/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.



[algogeeks] Re: Probability Puzzle

2011-08-08 Thread Dave
@Raj: After getting 5 consecutive heads, the probability of getting a
6th head is 17/18.

Dave

On Aug 9, 12:17 am, raj kumar megamonste...@gmail.com wrote:
 Just to resolve the issue what will be the probability of getting 6
 consecutive heads

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

2011-08-08 Thread Dave
@Raj. Good. So now answer my last question?

Dave

On Aug 9, 12:21 am, raj kumar megamonste...@gmail.com wrote:
 no then it will be 1/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: Probability Puzzle

2011-08-08 Thread programming love
@Dave: I guess 17/18 is correct. Since we have to *calculate the probability
of getting a head in the 6th flip given that first 5 flips are a head*. Can
you please explain how you got the values of consequent flips when you said
this?

*In fact, the probability is 3/5 for the first flip. After a head is
flipped, the probability of a head is 2/3. After two heads have been
flipped, it is 3/4. After 3 heads, it is 5/6. After 4 heads, the
 probability is 9/10, and after 5 heads, the probability is 17/18.*

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

2011-08-08 Thread raj kumar
http://math.arizona.edu/~jwatkins/f-condition.pdf
see this link now  ithink the answer should be 65/66

bcoz the probability of selectting double headed coin after n heads
=2^n/2^n+1

and fair coin is =1/2^n+1


so for 6th head it should be :2^n/2^n+1*1+((1/2^n+1)*1/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: Probability Puzzle

2011-08-08 Thread raj kumar
plz reply am i right or 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.



[algogeeks] Re: Probability Puzzle

2011-08-07 Thread saurabh chhabra
0.6?

On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 A bag contains 5 coins. Four of them are fair and one has heads on
 both sides. You randomly pulled one coin from the bag and tossed it 5
 times, heads turned up all five times. What is the probability that
 you toss next time, heads turns up. (All this time you don't know you
 were tossing a fair coin or not).

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

2011-08-07 Thread saurabh chhabra
sry...its wrong

On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 A bag contains 5 coins. Four of them are fair and one has heads on
 both sides. You randomly pulled one coin from the bag and tossed it 5
 times, heads turned up all five times. What is the probability that
 you toss next time, heads turns up. (All this time you don't know you
 were tossing a fair coin or not).

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

2011-08-07 Thread Algo Lover
Can anyone explain the approach how to solve this .
I think all tosses are independent so it should be 3/5. why is this in-
correct


On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com wrote:
 sry...its wrong

 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:







  A bag contains 5 coins. Four of them are fair and one has heads on
  both sides. You randomly pulled one coin from the bag and tossed it 5
  times, heads turned up all five times. What is the probability that
  you toss next time, heads turns up. (All this time you don't know you
  were tossing a fair coin or not).

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

2011-08-07 Thread Kunal Yadav
@algo: We can get head in two cases:-

1.) coin is biases
2.) coin is not biased

P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
P(head) for unbiased= 4/5*(1/2)^6
hence combined probability is what nitish has already mentioned. Hope you
get the point.

On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover algolear...@gmail.com wrote:

 Can anyone explain the approach how to solve this .
 I think all tosses are independent so it should be 3/5. why is this in-
 correct


 On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com wrote:
  sry...its wrong
 
  On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 
 
 
 
 
 
 
   A bag contains 5 coins. Four of them are fair and one has heads on
   both sides. You randomly pulled one coin from the bag and tossed it 5
   times, heads turned up all five times. What is the probability that
   you toss next time, heads turns up. (All this time you don't know you
   were tossing a fair coin or not).

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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
Kunal Yadav
(http://algoritmus.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.



[algogeeks] Re: Probability Puzzle

2011-08-07 Thread saurabh chhabra
Even u dont get why u people are gettin 17/80...the probability that
it will be a head 6th time will be same as the frst time...so it shud
be 3/5...

On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
 @algo: We can get head in two cases:-

 1.) coin is biases
 2.) coin is not biased

 P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
 P(head) for unbiased= 4/5*(1/2)^6
 hence combined probability is what nitish has already mentioned. Hope you
 get the point.









 On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover algolear...@gmail.com wrote:
  Can anyone explain the approach how to solve this .
  I think all tosses are independent so it should be 3/5. why is this in-
  correct

  On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com wrote:
   sry...its wrong

   On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:

A bag contains 5 coins. Four of them are fair and one has heads on
both sides. You randomly pulled one coin from the bag and tossed it 5
times, heads turned up all five times. What is the probability that
you toss next time, heads turns up. (All this time you don't know you
were tossing a fair coin or not).

  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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
 Kunal Yadav
 (http://algoritmus.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: Probability Puzzle

2011-08-07 Thread aseem garg
If the coin is unbiased then probability of heads: 1/2 irrespective of
whether it is first time or nth time. So answer should be 3/5.
Aseem



On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra saurabh131...@gmail.comwrote:

 Even u dont get why u people are gettin 17/80...the probability that
 it will be a head 6th time will be same as the frst time...so it shud
 be 3/5...

 On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
  @algo: We can get head in two cases:-
 
  1.) coin is biases
  2.) coin is not biased
 
  P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
  P(head) for unbiased= 4/5*(1/2)^6
  hence combined probability is what nitish has already mentioned. Hope you
  get the point.
 
 
 
 
 
 
 
 
 
  On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover algolear...@gmail.com
 wrote:
   Can anyone explain the approach how to solve this .
   I think all tosses are independent so it should be 3/5. why is this in-
   correct
 
   On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com wrote:
sry...its wrong
 
On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 
 A bag contains 5 coins. Four of them are fair and one has heads on
 both sides. You randomly pulled one coin from the bag and tossed it
 5
 times, heads turned up all five times. What is the probability that
 you toss next time, heads turns up. (All this time you don't know
 you
 were tossing a fair coin or not).
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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
  Kunal Yadav
  (http://algoritmus.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.



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

2011-08-07 Thread Puneet Gautam
Sixth toss is independent of previous tosses and dependent only on
coin selection...!

1/5 + 4/5(1/2)= 3/5

is the correct answer

we want to calc. probability of getting heads the sixth time only
even if it would have been 100 th time...3/5 would be the answer
only..


On 8/8/11, Prakash D cegprak...@gmail.com wrote:
 1.) coin is fair
 2.) coin is unfair

 P(head) for unfair coin= 1/5 * 1= 1/5
 P(head) for fair coin= 4/5* 1/2 = 2/5


 the probability at any instant that the tossed coin is a head is 3/5

 17/80 is the probability to get head at all the six times.

 the soln. for this problem will be 3/5

 On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com wrote:

 If the coin is unbiased then probability of heads: 1/2 irrespective of
 whether it is first time or nth time. So answer should be 3/5.
 Aseem



 On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra
 saurabh131...@gmail.comwrote:

 Even u dont get why u people are gettin 17/80...the probability that
 it will be a head 6th time will be same as the frst time...so it shud
 be 3/5...

 On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
  @algo: We can get head in two cases:-
 
  1.) coin is biases
  2.) coin is not biased
 
  P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
  P(head) for unbiased= 4/5*(1/2)^6
  hence combined probability is what nitish has already mentioned. Hope
 you
  get the point.
 
 
 
 
 
 
 
 
 
  On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover algolear...@gmail.com
 wrote:
   Can anyone explain the approach how to solve this .
   I think all tosses are independent so it should be 3/5. why is this
 in-
   correct
 
   On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com wrote:
sry...its wrong
 
On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
 
 A bag contains 5 coins. Four of them are fair and one has heads
 on
 both sides. You randomly pulled one coin from the bag and tossed
 it 5
 times, heads turned up all five times. What is the probability
 that
 you toss next time, heads turns up. (All this time you don't know
 you
 were tossing a fair coin or not).
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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
  Kunal Yadav
  (http://algoritmus.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.


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



Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread Shuaib Khan
On Mon, Aug 8, 2011 at 12:40 AM, Puneet Gautam puneet.nsi...@gmail.comwrote:

 Sixth toss is independent of previous tosses and dependent only on
 coin selection...!

 1/5 + 4/5(1/2)= 3/5

 is the correct answer

 we want to calc. probability of getting heads the sixth time only
 even if it would have been 100 th time...3/5 would be the answer
 only..


It is not independent. Re read the question. The first five times, it HAS to
be heads.


 On 8/8/11, Prakash D cegprak...@gmail.com wrote:
  1.) coin is fair
  2.) coin is unfair
 
  P(head) for unfair coin= 1/5 * 1= 1/5
  P(head) for fair coin= 4/5* 1/2 = 2/5
 
 
  the probability at any instant that the tossed coin is a head is 3/5
 
  17/80 is the probability to get head at all the six times.
 
  the soln. for this problem will be 3/5
 
  On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com wrote:
 
  If the coin is unbiased then probability of heads: 1/2 irrespective of
  whether it is first time or nth time. So answer should be 3/5.
  Aseem
 
 
 
  On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra
  saurabh131...@gmail.comwrote:
 
  Even u dont get why u people are gettin 17/80...the probability that
  it will be a head 6th time will be same as the frst time...so it shud
  be 3/5...
 
  On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
   @algo: We can get head in two cases:-
  
   1.) coin is biases
   2.) coin is not biased
  
   P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
   P(head) for unbiased= 4/5*(1/2)^6
   hence combined probability is what nitish has already mentioned. Hope
  you
   get the point.
  
  
  
  
  
  
  
  
  
   On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover algolear...@gmail.com
  wrote:
Can anyone explain the approach how to solve this .
I think all tosses are independent so it should be 3/5. why is this
  in-
correct
  
On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com
 wrote:
 sry...its wrong
  
 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
  
  A bag contains 5 coins. Four of them are fair and one has heads
  on
  both sides. You randomly pulled one coin from the bag and
 tossed
  it 5
  times, heads turned up all five times. What is the probability
  that
  you toss next time, heads turns up. (All this time you don't
 know
  you
  were tossing a fair coin or not).
  
--
You received this message because you are subscribed to the Google
  Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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
   Kunal Yadav
   (http://algoritmus.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.
 
 
   --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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.




-- 
Shuaib
http://www.bytehood.com
http://twitter.com/ShuaibKhan

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

2011-08-07 Thread aseem garg
Think it like this. I have tossed a coin 5 times and it showed heads all the
times. What is the probabilty of it shoing a HEADS now?
Aseem



On Mon, Aug 8, 2011 at 1:12 AM, Shuaib Khan aries.shu...@gmail.com wrote:



 On Mon, Aug 8, 2011 at 12:40 AM, Puneet Gautam puneet.nsi...@gmail.comwrote:

 Sixth toss is independent of previous tosses and dependent only on
 coin selection...!

 1/5 + 4/5(1/2)= 3/5

 is the correct answer

 we want to calc. probability of getting heads the sixth time only
 even if it would have been 100 th time...3/5 would be the answer
 only..


 It is not independent. Re read the question. The first five times, it HAS
 to be heads.


 On 8/8/11, Prakash D cegprak...@gmail.com wrote:
  1.) coin is fair
  2.) coin is unfair
 
  P(head) for unfair coin= 1/5 * 1= 1/5
  P(head) for fair coin= 4/5* 1/2 = 2/5
 
 
  the probability at any instant that the tossed coin is a head is 3/5
 
  17/80 is the probability to get head at all the six times.
 
  the soln. for this problem will be 3/5
 
  On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com
 wrote:
 
  If the coin is unbiased then probability of heads: 1/2 irrespective of
  whether it is first time or nth time. So answer should be 3/5.
  Aseem
 
 
 
  On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra
  saurabh131...@gmail.comwrote:
 
  Even u dont get why u people are gettin 17/80...the probability that
  it will be a head 6th time will be same as the frst time...so it shud
  be 3/5...
 
  On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
   @algo: We can get head in two cases:-
  
   1.) coin is biases
   2.) coin is not biased
  
   P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
   P(head) for unbiased= 4/5*(1/2)^6
   hence combined probability is what nitish has already mentioned.
 Hope
  you
   get the point.
  
  
  
  
  
  
  
  
  
   On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover algolear...@gmail.com
  wrote:
Can anyone explain the approach how to solve this .
I think all tosses are independent so it should be 3/5. why is
 this
  in-
correct
  
On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com
 wrote:
 sry...its wrong
  
 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
  
  A bag contains 5 coins. Four of them are fair and one has
 heads
  on
  both sides. You randomly pulled one coin from the bag and
 tossed
  it 5
  times, heads turned up all five times. What is the probability
  that
  you toss next time, heads turns up. (All this time you don't
 know
  you
  were tossing a fair coin or not).
  
--
You received this message because you are subscribed to the Google
  Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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
   Kunal Yadav
   (http://algoritmus.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.
 
 
   --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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.




 --
 Shuaib
 http://www.bytehood.com
 http://twitter.com/ShuaibKhan

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

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread Shuaib Khan
On Mon, Aug 8, 2011 at 12:47 AM, aseem garg ase.as...@gmail.com wrote:

 Think it like this. I have tossed a coin 5 times and it showed heads all
 the times. What is the probabilty of it shoing a HEADS now?
 Aseem


Well you are thinking about it the wrong way. Question asks that what is the
probability that heads will show up the first five times, plus a sixth time.
Not just the sixth time. The first five times head showing up is part of the
question.






 On Mon, Aug 8, 2011 at 1:12 AM, Shuaib Khan aries.shu...@gmail.comwrote:



 On Mon, Aug 8, 2011 at 12:40 AM, Puneet Gautam 
 puneet.nsi...@gmail.comwrote:

 Sixth toss is independent of previous tosses and dependent only on
 coin selection...!

 1/5 + 4/5(1/2)= 3/5

 is the correct answer

 we want to calc. probability of getting heads the sixth time only
 even if it would have been 100 th time...3/5 would be the answer
 only..


 It is not independent. Re read the question. The first five times, it HAS
 to be heads.


 On 8/8/11, Prakash D cegprak...@gmail.com wrote:
  1.) coin is fair
  2.) coin is unfair
 
  P(head) for unfair coin= 1/5 * 1= 1/5
  P(head) for fair coin= 4/5* 1/2 = 2/5
 
 
  the probability at any instant that the tossed coin is a head is 3/5
 
  17/80 is the probability to get head at all the six times.
 
  the soln. for this problem will be 3/5
 
  On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com
 wrote:
 
  If the coin is unbiased then probability of heads: 1/2 irrespective of
  whether it is first time or nth time. So answer should be 3/5.
  Aseem
 
 
 
  On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra
  saurabh131...@gmail.comwrote:
 
  Even u dont get why u people are gettin 17/80...the probability that
  it will be a head 6th time will be same as the frst time...so it shud
  be 3/5...
 
  On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
   @algo: We can get head in two cases:-
  
   1.) coin is biases
   2.) coin is not biased
  
   P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
   P(head) for unbiased= 4/5*(1/2)^6
   hence combined probability is what nitish has already mentioned.
 Hope
  you
   get the point.
  
  
  
  
  
  
  
  
  
   On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover algolear...@gmail.com
 
  wrote:
Can anyone explain the approach how to solve this .
I think all tosses are independent so it should be 3/5. why is
 this
  in-
correct
  
On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com
 wrote:
 sry...its wrong
  
 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
  
  A bag contains 5 coins. Four of them are fair and one has
 heads
  on
  both sides. You randomly pulled one coin from the bag and
 tossed
  it 5
  times, heads turned up all five times. What is the
 probability
  that
  you toss next time, heads turns up. (All this time you don't
 know
  you
  were tossing a fair coin or not).
  
--
You received this message because you are subscribed to the
 Google
  Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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
   Kunal Yadav
   (http://algoritmus.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.
 
 
   --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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.




 --
 Shuaib
 http://www.bytehood.com
 http://twitter.com/ShuaibKhan

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, 

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread aseem garg
@Shuaib:  **What is the probability that you toss *next time, heads turns up
***.
Aseem



On Mon, Aug 8, 2011 at 1:19 AM, Shuaib Khan aries.shu...@gmail.com wrote:



 On Mon, Aug 8, 2011 at 12:47 AM, aseem garg ase.as...@gmail.com wrote:

 Think it like this. I have tossed a coin 5 times and it showed heads all
 the times. What is the probabilty of it shoing a HEADS now?
 Aseem


 Well you are thinking about it the wrong way. Question asks that what is
 the probability that heads will show up the first five times, plus a sixth
 time. Not just the sixth time. The first five times head showing up is part
 of the question.






 On Mon, Aug 8, 2011 at 1:12 AM, Shuaib Khan aries.shu...@gmail.comwrote:



 On Mon, Aug 8, 2011 at 12:40 AM, Puneet Gautam 
 puneet.nsi...@gmail.comwrote:

 Sixth toss is independent of previous tosses and dependent only on
 coin selection...!

 1/5 + 4/5(1/2)= 3/5

 is the correct answer

 we want to calc. probability of getting heads the sixth time only
 even if it would have been 100 th time...3/5 would be the answer
 only..


 It is not independent. Re read the question. The first five times, it HAS
 to be heads.


 On 8/8/11, Prakash D cegprak...@gmail.com wrote:
  1.) coin is fair
  2.) coin is unfair
 
  P(head) for unfair coin= 1/5 * 1= 1/5
  P(head) for fair coin= 4/5* 1/2 = 2/5
 
 
  the probability at any instant that the tossed coin is a head is 3/5
 
  17/80 is the probability to get head at all the six times.
 
  the soln. for this problem will be 3/5
 
  On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com
 wrote:
 
  If the coin is unbiased then probability of heads: 1/2 irrespective
 of
  whether it is first time or nth time. So answer should be 3/5.
  Aseem
 
 
 
  On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra
  saurabh131...@gmail.comwrote:
 
  Even u dont get why u people are gettin 17/80...the probability that
  it will be a head 6th time will be same as the frst time...so it
 shud
  be 3/5...
 
  On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
   @algo: We can get head in two cases:-
  
   1.) coin is biases
   2.) coin is not biased
  
   P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
   P(head) for unbiased= 4/5*(1/2)^6
   hence combined probability is what nitish has already mentioned.
 Hope
  you
   get the point.
  
  
  
  
  
  
  
  
  
   On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover 
 algolear...@gmail.com
  wrote:
Can anyone explain the approach how to solve this .
I think all tosses are independent so it should be 3/5. why is
 this
  in-
correct
  
On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com
 wrote:
 sry...its wrong
  
 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
  
  A bag contains 5 coins. Four of them are fair and one has
 heads
  on
  both sides. You randomly pulled one coin from the bag and
 tossed
  it 5
  times, heads turned up all five times. What is the
 probability
  that
  you toss next time, heads turns up. (All this time you don't
 know
  you
  were tossing a fair coin or not).
  
--
You received this message because you are subscribed to the
 Google
  Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
 .
To unsubscribe from 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
   Kunal Yadav
   (http://algoritmus.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.
 
 
   --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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.




 --
 Shuaib
 

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread Prakash D
no fight.. lets mention both the answers :D

On Mon, Aug 8, 2011 at 1:19 AM, Shuaib Khan aries.shu...@gmail.com wrote:



 On Mon, Aug 8, 2011 at 12:47 AM, aseem garg ase.as...@gmail.com wrote:

 Think it like this. I have tossed a coin 5 times and it showed heads all
 the times. What is the probabilty of it shoing a HEADS now?
 Aseem


 Well you are thinking about it the wrong way. Question asks that what is
 the probability that heads will show up the first five times, plus a sixth
 time. Not just the sixth time. The first five times head showing up is part
 of the question.






 On Mon, Aug 8, 2011 at 1:12 AM, Shuaib Khan aries.shu...@gmail.comwrote:



 On Mon, Aug 8, 2011 at 12:40 AM, Puneet Gautam 
 puneet.nsi...@gmail.comwrote:

 Sixth toss is independent of previous tosses and dependent only on
 coin selection...!

 1/5 + 4/5(1/2)= 3/5

 is the correct answer

 we want to calc. probability of getting heads the sixth time only
 even if it would have been 100 th time...3/5 would be the answer
 only..


 It is not independent. Re read the question. The first five times, it HAS
 to be heads.


 On 8/8/11, Prakash D cegprak...@gmail.com wrote:
  1.) coin is fair
  2.) coin is unfair
 
  P(head) for unfair coin= 1/5 * 1= 1/5
  P(head) for fair coin= 4/5* 1/2 = 2/5
 
 
  the probability at any instant that the tossed coin is a head is 3/5
 
  17/80 is the probability to get head at all the six times.
 
  the soln. for this problem will be 3/5
 
  On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com
 wrote:
 
  If the coin is unbiased then probability of heads: 1/2 irrespective
 of
  whether it is first time or nth time. So answer should be 3/5.
  Aseem
 
 
 
  On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra
  saurabh131...@gmail.comwrote:
 
  Even u dont get why u people are gettin 17/80...the probability that
  it will be a head 6th time will be same as the frst time...so it
 shud
  be 3/5...
 
  On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
   @algo: We can get head in two cases:-
  
   1.) coin is biases
   2.) coin is not biased
  
   P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
   P(head) for unbiased= 4/5*(1/2)^6
   hence combined probability is what nitish has already mentioned.
 Hope
  you
   get the point.
  
  
  
  
  
  
  
  
  
   On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover 
 algolear...@gmail.com
  wrote:
Can anyone explain the approach how to solve this .
I think all tosses are independent so it should be 3/5. why is
 this
  in-
correct
  
On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com
 wrote:
 sry...its wrong
  
 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:
  
  A bag contains 5 coins. Four of them are fair and one has
 heads
  on
  both sides. You randomly pulled one coin from the bag and
 tossed
  it 5
  times, heads turned up all five times. What is the
 probability
  that
  you toss next time, heads turns up. (All this time you don't
 know
  you
  were tossing a fair coin or not).
  
--
You received this message because you are subscribed to the
 Google
  Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
 .
To unsubscribe from 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
   Kunal Yadav
   (http://algoritmus.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.
 
 
   --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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.




 --
 Shuaib
 http://www.bytehood.com
 

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread Shuaib Khan
On Mon, Aug 8, 2011 at 12:51 AM, aseem garg ase.as...@gmail.com wrote:

 @Shuaib:  **What is the probability that you toss *next time, heads turns
 up***.


Well if you interpret it your way, then you are right. Otherwise, not.


 Aseem



 On Mon, Aug 8, 2011 at 1:19 AM, Shuaib Khan aries.shu...@gmail.comwrote:



 On Mon, Aug 8, 2011 at 12:47 AM, aseem garg ase.as...@gmail.com wrote:

 Think it like this. I have tossed a coin 5 times and it showed heads all
 the times. What is the probabilty of it shoing a HEADS now?
 Aseem


 Well you are thinking about it the wrong way. Question asks that what is
 the probability that heads will show up the first five times, plus a sixth
 time. Not just the sixth time. The first five times head showing up is part
 of the question.






 On Mon, Aug 8, 2011 at 1:12 AM, Shuaib Khan aries.shu...@gmail.comwrote:



 On Mon, Aug 8, 2011 at 12:40 AM, Puneet Gautam puneet.nsi...@gmail.com
  wrote:

 Sixth toss is independent of previous tosses and dependent only on
 coin selection...!

 1/5 + 4/5(1/2)= 3/5

 is the correct answer

 we want to calc. probability of getting heads the sixth time only
 even if it would have been 100 th time...3/5 would be the answer
 only..


 It is not independent. Re read the question. The first five times, it
 HAS to be heads.


 On 8/8/11, Prakash D cegprak...@gmail.com wrote:
  1.) coin is fair
  2.) coin is unfair
 
  P(head) for unfair coin= 1/5 * 1= 1/5
  P(head) for fair coin= 4/5* 1/2 = 2/5
 
 
  the probability at any instant that the tossed coin is a head is 3/5
 
  17/80 is the probability to get head at all the six times.
 
  the soln. for this problem will be 3/5
 
  On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com
 wrote:
 
  If the coin is unbiased then probability of heads: 1/2 irrespective
 of
  whether it is first time or nth time. So answer should be 3/5.
  Aseem
 
 
 
  On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra
  saurabh131...@gmail.comwrote:
 
  Even u dont get why u people are gettin 17/80...the probability
 that
  it will be a head 6th time will be same as the frst time...so it
 shud
  be 3/5...
 
  On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
   @algo: We can get head in two cases:-
  
   1.) coin is biases
   2.) coin is not biased
  
   P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
   P(head) for unbiased= 4/5*(1/2)^6
   hence combined probability is what nitish has already mentioned.
 Hope
  you
   get the point.
  
  
  
  
  
  
  
  
  
   On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover 
 algolear...@gmail.com
  wrote:
Can anyone explain the approach how to solve this .
I think all tosses are independent so it should be 3/5. why is
 this
  in-
correct
  
On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com
 wrote:
 sry...its wrong
  
 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com
 wrote:
  
  A bag contains 5 coins. Four of them are fair and one has
 heads
  on
  both sides. You randomly pulled one coin from the bag and
 tossed
  it 5
  times, heads turned up all five times. What is the
 probability
  that
  you toss next time, heads turns up. (All this time you
 don't know
  you
  were tossing a fair coin or not).
  
--
You received this message because you are subscribed to the
 Google
  Groups
Algorithm Geeks group.
To post to this group, send email to
 algogeeks@googlegroups.com.
To unsubscribe from 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
   Kunal Yadav
   (http://algoritmus.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.
 
 
   --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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
 

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread Puneet Gautam
abe yaar kya farak padta hai... 3/5=0.6 , other one may be 0.4 ya 0.3,

 0.3 ke difference ke liye lad rahe ho...

Chill guys...

On 8/8/11, Shuaib Khan aries.shu...@gmail.com wrote:
 On Mon, Aug 8, 2011 at 12:51 AM, aseem garg ase.as...@gmail.com wrote:

 @Shuaib:  **What is the probability that you toss *next time, heads turns
 up***.


 Well if you interpret it your way, then you are right. Otherwise, not.


 Aseem



 On Mon, Aug 8, 2011 at 1:19 AM, Shuaib Khan aries.shu...@gmail.comwrote:



 On Mon, Aug 8, 2011 at 12:47 AM, aseem garg ase.as...@gmail.com wrote:

 Think it like this. I have tossed a coin 5 times and it showed heads all
 the times. What is the probabilty of it shoing a HEADS now?
 Aseem


 Well you are thinking about it the wrong way. Question asks that what is
 the probability that heads will show up the first five times, plus a
 sixth
 time. Not just the sixth time. The first five times head showing up is
 part
 of the question.






 On Mon, Aug 8, 2011 at 1:12 AM, Shuaib Khan
 aries.shu...@gmail.comwrote:



 On Mon, Aug 8, 2011 at 12:40 AM, Puneet Gautam puneet.nsi...@gmail.com
  wrote:

 Sixth toss is independent of previous tosses and dependent only on
 coin selection...!

 1/5 + 4/5(1/2)= 3/5

 is the correct answer

 we want to calc. probability of getting heads the sixth time only
 even if it would have been 100 th time...3/5 would be the answer
 only..


 It is not independent. Re read the question. The first five times, it
 HAS to be heads.


 On 8/8/11, Prakash D cegprak...@gmail.com wrote:
  1.) coin is fair
  2.) coin is unfair
 
  P(head) for unfair coin= 1/5 * 1= 1/5
  P(head) for fair coin= 4/5* 1/2 = 2/5
 
 
  the probability at any instant that the tossed coin is a head is 3/5
 
  17/80 is the probability to get head at all the six times.
 
  the soln. for this problem will be 3/5
 
  On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com
 wrote:
 
  If the coin is unbiased then probability of heads: 1/2 irrespective
 of
  whether it is first time or nth time. So answer should be 3/5.
  Aseem
 
 
 
  On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra
  saurabh131...@gmail.comwrote:
 
  Even u dont get why u people are gettin 17/80...the probability
 that
  it will be a head 6th time will be same as the frst time...so it
 shud
  be 3/5...
 
  On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
   @algo: We can get head in two cases:-
  
   1.) coin is biases
   2.) coin is not biased
  
   P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
   P(head) for unbiased= 4/5*(1/2)^6
   hence combined probability is what nitish has already mentioned.
 Hope
  you
   get the point.
  
  
  
  
  
  
  
  
  
   On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover 
 algolear...@gmail.com
  wrote:
Can anyone explain the approach how to solve this .
I think all tosses are independent so it should be 3/5. why is
 this
  in-
correct
  
On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com
 wrote:
 sry...its wrong
  
 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com
 wrote:
  
  A bag contains 5 coins. Four of them are fair and one has
 heads
  on
  both sides. You randomly pulled one coin from the bag and
 tossed
  it 5
  times, heads turned up all five times. What is the
 probability
  that
  you toss next time, heads turns up. (All this time you
 don't know
  you
  were tossing a fair coin or not).
  
--
You received this message because you are subscribed to the
 Google
  Groups
Algorithm Geeks group.
To post to this group, send email to
 algogeeks@googlegroups.com.
To unsubscribe from 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
   Kunal Yadav
   (http://algoritmus.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.
 
 
   --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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 

[algogeeks] Re: Probability Puzzle

2011-08-07 Thread Dave
@Puneet: So are you saying that 100 heads in a row wouldn't convince
you that you had the unfair coin? How many heads in a row would it
take?

Dave

On Aug 7, 2:40 pm, Puneet Gautam puneet.nsi...@gmail.com wrote:
 Sixth toss is independent of previous tosses and dependent only on
 coin selection...!

 1/5 + 4/5(1/2)= 3/5

 is the correct answer

 we want to calc. probability of getting heads the sixth time only
 even if it would have been 100 th time...3/5 would be the answer
 only..

 On 8/8/11, Prakash D cegprak...@gmail.com wrote:



  1.) coin is fair
  2.) coin is unfair

  P(head) for unfair coin= 1/5 * 1= 1/5
  P(head) for fair coin= 4/5* 1/2 = 2/5

  the probability at any instant that the tossed coin is a head is 3/5

  17/80 is the probability to get head at all the six times.

  the soln. for this problem will be 3/5

  On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com wrote:

  If the coin is unbiased then probability of heads: 1/2 irrespective of
  whether it is first time or nth time. So answer should be 3/5.
  Aseem

  On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra
  saurabh131...@gmail.comwrote:

  Even u dont get why u people are gettin 17/80...the probability that
  it will be a head 6th time will be same as the frst time...so it shud
  be 3/5...

  On Aug 7, 11:05 pm, Kunal Yadav kunalyada...@gmail.com wrote:
   @algo: We can get head in two cases:-

   1.) coin is biases
   2.) coin is not biased

   P(head) for biased= 1/5 *1*1*1*1*1*1= 1/5
   P(head) for unbiased= 4/5*(1/2)^6
   hence combined probability is what nitish has already mentioned. Hope
  you
   get the point.

   On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover algolear...@gmail.com
  wrote:
Can anyone explain the approach how to solve this .
I think all tosses are independent so it should be 3/5. why is this
  in-
correct

On Aug 7, 10:55 pm, saurabh chhabra saurabh131...@gmail.com wrote:
 sry...its wrong

 On Aug 7, 10:34 pm, Algo Lover algolear...@gmail.com wrote:

  A bag contains 5 coins. Four of them are fair and one has heads
  on
  both sides. You randomly pulled one coin from the bag and tossed
  it 5
  times, heads turned up all five times. What is the probability
  that
  you toss next time, heads turns up. (All this time you don't know
  you
  were tossing a fair coin or not).

--
You received this message because you are subscribed to the Google
  Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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
   Kunal Yadav
   (http://algoritmus.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.

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



  1   2   >