Re: [algogeeks] without using '-'

2011-09-26 Thread Kunal Yadav
difference = x+ ~y +1

On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 Find the difference of two numbers without using '-' operator !

 plz share ur solutions!

 --
 Cheers,

   Vicky

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

2011-09-26 Thread Kunal Yadav
@abhishek: absolutely correct abhishek :)

On Mon, Sep 26, 2011 at 11:53 PM, aditya kumar aditya.kumar130...@gmail.com
 wrote:

 +1 to abhishek


 On Mon, Sep 26, 2011 at 11:44 PM, Abhishek Gupta 
 guptaabhishe...@gmail.com wrote:

 thats basically taking twos' compliment and converting it to negative one
 and then adding it..its the same principle...which is used for dividing two
 numbers without using '/' and '-'...right kunal??


 On Mon, Sep 26, 2011 at 10:38 PM, Ashima . ashima.b...@gmail.com wrote:

 grt.we never generally use ~ operator. got to knw abt it.
 Ashima
 M.Sc.(Tech)Information Systems
  4th year
 BITS Pilani
 Rajasthan




 On Mon, Sep 26, 2011 at 10:07 AM, ~*~VICKY~*~ 
 venkat.jun...@gmail.comwrote:

 Tricky question with more tricky answers. thank you all.


 On Mon, Sep 26, 2011 at 9:55 PM, Kunal Yadav kunalyada...@gmail.comwrote:

 difference = x+ ~y +1

 On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ 
 venkat.jun...@gmail.comwrote:

 Find the difference of two numbers without using '-' operator !

 plz share ur solutions!

 --
 Cheers,

   Vicky

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




 --
 Cheers,

   Vicky

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




 --
 Thanks  Regards
 Abhishek Gupta


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


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

2011-09-26 Thread Kunal Yadav
@sandeep: Its simple xor. How can this be equal to difference??

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

2011-09-24 Thread Kunal Yadav
for 1st
#includeiostream
#includevector
using namespace std;
int  main()
{
char c;
string s;
int n;
vector char ans;
cins;
int i=0;
while(s[i]!='\0')
{
c=s[i];
n=s[i+1]-'0';
while(n--)
ans.push_back(c);
i+=2;
}
for(i=0;ians.size();i++)
coutans[i];
return 0;
}


On Thu, Sep 22, 2011 at 3:46 PM, Dheeraj Sharma dheerajsharma1...@gmail.com
 wrote:

 for 1st

 #includeiostream
 #includeconio.h
 #includestring.h

 using namespace std;
 int main()
 {
 char str[100];
 cinstr;
 int len=strlen(str);
 int i=1;
 while(ilen)
 {
 int x=str[i]-48;
 while(x--)
 coutstr[i-1];
 i+=2;
 }
  getch();

 }


 On Thu, Sep 22, 2011 at 3:42 PM, Dheeraj Sharma 
 dheerajsharma1...@gmail.com wrote:

 for 2nd one
 #includeiostream
 #includeconio.h
 using namespace std;
 int main()
 {
 char str[100];
 cinstr;

 char ch=str[0];
 int count=0,i=0;
 while(str[i])
 {
  if(str[i]==ch)
  count++;
  else
  {
  coutchcount;
  ch=str[i];
  count=1;
  }
  i++;
  }
  coutchcount;
  getch();

 }


 On Thu, Sep 22, 2011 at 11:58 AM, rahul sharma 
 rahul23111...@gmail.comwrote:

 i found a question of ms earlier but know i not able to find
 it.plz post link or thread 


 i/p::a3b2c4:
 o/p:aaabb

 i/p:aaabbc
 o/p:a3b2c1

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




 --
 *Dheeraj Sharma*
 Comp Engg.
 NIT Kurukshetra





 --
 *Dheeraj Sharma*
 Comp Engg.
 NIT Kurukshetra


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




-- 
Regards
Kunal Yadav
(http://sourcebit.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] help nedded

2011-09-24 Thread Kunal Yadav
2nd
#includeiostream
#includevector
using namespace std;
int  main()
{
string s;
cins;
int i=0,count=1;
vectorint no;
vectorchar c;
while(s[i]!='\0')
{
if(s[i]==s[i+1])
count++;
else
{
c.push_back(s[i]);
no.push_back(count);
count=1;
}
i++;
}
for(i=0;ic.size();i++)
coutc[i]no[i];
return 0;
}


On Sat, Sep 24, 2011 at 5:53 PM, Kunal Yadav kunalyada...@gmail.com wrote:

 for 1st
 #includeiostream
 #includevector

 using namespace std;
 int  main()
 {
 char c;
 string s;
 int n;
 vector char ans;
 cins;
 int i=0;
 while(s[i]!='\0')
 {
 c=s[i];
 n=s[i+1]-'0';
 while(n--)
 ans.push_back(c);
 i+=2;
 }
 for(i=0;ians.size();i++)
 coutans[i];
 return 0;
 }


 On Thu, Sep 22, 2011 at 3:46 PM, Dheeraj Sharma 
 dheerajsharma1...@gmail.com wrote:

 for 1st

 #includeiostream
 #includeconio.h
 #includestring.h

 using namespace std;
 int main()
 {
 char str[100];
 cinstr;
 int len=strlen(str);
 int i=1;
 while(ilen)
 {
 int x=str[i]-48;
 while(x--)
 coutstr[i-1];
 i+=2;
 }
  getch();

 }


 On Thu, Sep 22, 2011 at 3:42 PM, Dheeraj Sharma 
 dheerajsharma1...@gmail.com wrote:

 for 2nd one
 #includeiostream
 #includeconio.h
 using namespace std;
 int main()
 {
 char str[100];
 cinstr;

 char ch=str[0];
 int count=0,i=0;
 while(str[i])
 {
  if(str[i]==ch)
  count++;
  else
  {
  coutchcount;
  ch=str[i];
  count=1;
  }
  i++;
  }
  coutchcount;
  getch();

 }


 On Thu, Sep 22, 2011 at 11:58 AM, rahul sharma 
 rahul23111...@gmail.comwrote:

 i found a question of ms earlier but know i not able to find
 it.plz post link or thread 


 i/p::a3b2c4:
 o/p:aaabb

 i/p:aaabbc
 o/p:a3b2c1

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




 --
 *Dheeraj Sharma*
 Comp Engg.
 NIT Kurukshetra





 --
 *Dheeraj Sharma*
 Comp Engg.
 NIT Kurukshetra


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




 --
 Regards
 Kunal Yadav
 (http://sourcebit.in)




-- 
Regards
Kunal Yadav
(http://sourcebit.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: can any body explain the output and the general method

2011-09-23 Thread Kunal Yadav
+1 dave
Its giving 97 in my compiler.

On Fri, Sep 23, 2011 at 4:22 PM, vishwa vishwavam...@gmail.com wrote:

 its 21 .


 On Fri, Sep 23, 2011 at 4:10 PM, vijay singh vijaysinghb...@gmail.comwrote:

 Think it as following...
 (++i + ++i) + ++i;
 i.e.
 (7 + 7) + 8;

 1) calculate ++i  i.e i=6
 2) calculate ++i  i.e i=7
 3) calculate (i + i)  i.e (7+7) = 14 because i is now 7
 4) calculate ++i  i.e i=8
 5) calculate 14 + i  i.e 22

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

2011-08-09 Thread Kunal Yadav
The procedure was like this:-
First they had a written test of 45 questions of 90 mins. Depending on the
performance in the test they divided selected students into two buckets. one
for software dev and other for sys ops.
Then there was coding round.
For sys ops one has to extract some information from the given log file. Be
sure to prepare file handling. I dont know abt the coding round for soft
dev.
After this they had 2 technical interviews and one hr interview.

On Tue, Aug 9, 2011 at 3:50 PM, NIKHIL JAIN
nikhil.jain.shali...@gmail.comwrote:

 can any dce student give an idea whats the procedure and what are the
 questions asked by directi recruitment group

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

2011-08-07 Thread Kunal Yadav
Agree with puneet completely. After first blue pen, only possible outcomes
are blue or black and hence 1/2.

On Sat, Aug 6, 2011 at 12:28 AM, Puneet Goyal puneetgoya...@gmail.comwrote:


 @shiv : you are considering the case when you need to know the probability
 of both pens being blue, but in the question you already know that 1st one
 is blue so you dont need to care about it, and also the 3rd packet getting
 eliminated coz of it increases the probability to 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.




-- 
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] how to reverse a string in place??plz post code also

2011-08-07 Thread Kunal Yadav
#includestdio.h
#includeiostream
#includestring.h
#includestdlib.h
using namespace std;
int main()
{
   char s[1000];
   cins;
   int start=0;
   int end=strlen(s);
   coutendendl;
   int end1=end;
   while(start=end)
{
char e;  //swap
e=s[start];
s[start]=s[end];
s[end]=e;
   start++;
   end--;
   }
   for(int i=0;i=end1;i++)
   couts[i];
   return 0;

}


On Sun, Aug 7, 2011 at 8:24 PM, Rajesh Kumar testalgori...@gmail.comwrote:



 --
 Regards
 Rajesh Kumar


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




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



Re: [algogeeks] Directi Question

2011-08-06 Thread Kunal Yadav
Expected value of a random variable x is defined as E(x)= summation of xp(x)
over all value of x where p(x) is the probability.
so in this case
E(x)= E(2)+E(4)+ E(6)+ .
 = 2*1/6 + 4* 3/(6*6)+ 6*10/(6*6*6) + .

On Sat, Aug 6, 2011 at 9:19 PM, sukran dhawan sukrandha...@gmail.comwrote:



 On Sat, Aug 6, 2011 at 8:24 PM, muthu raj muthura...@gmail.com wrote:

 Microsoft written:

 What is the probability of getting atleast one 6 in  3 attempts of a dice?

 probability of not getting 6 = 5/6  * 5/6 * 5/6 = 91/216

 so ans 1- 91/216
 let me know how was the paper and the pattern

 *Muthuraj R
 IV th Year , ISE
 PESIT , Bangalore*




 On Sat, Aug 6, 2011 at 7:34 AM, shady sinv...@gmail.com wrote:

 Hi,

 A fair dice is rolled. Each time the value is noted and running sum is
 maintained. What is the expected number of runs needed so that the sum is
 even ?
 Can anyone tell how to solve this problem ? as well as other related
 problems of such sort

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




-- 
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] Directi Question

2011-08-06 Thread Kunal Yadav
Hey sry for my above post. I got a little confused. x is the no of times
dice is rolled so
e(x)=e(1)+e(2)+e(3)+
 =1/2 + 2*1/(2*2) + 3*1/(2*2*2) + ..
Please correct me if m wrong..

On Sat, Aug 6, 2011 at 10:54 PM, Kunal Yadav kunalyada...@gmail.com wrote:

 Expected value of a random variable x is defined as E(x)= summation of
 xp(x) over all value of x where p(x) is the probability.
 so in this case
 E(x)= E(2)+E(4)+ E(6)+ .
  = 2*1/6 + 4* 3/(6*6)+ 6*10/(6*6*6) + .


 On Sat, Aug 6, 2011 at 9:19 PM, sukran dhawan sukrandha...@gmail.comwrote:



 On Sat, Aug 6, 2011 at 8:24 PM, muthu raj muthura...@gmail.com wrote:

  Microsoft written:

 What is the probability of getting atleast one 6 in  3 attempts of a
 dice?

 probability of not getting 6 = 5/6  * 5/6 * 5/6 = 91/216

 so ans 1- 91/216
 let me know how was the paper and the pattern

 *Muthuraj R
 IV th Year , ISE
 PESIT , Bangalore*




 On Sat, Aug 6, 2011 at 7:34 AM, shady sinv...@gmail.com wrote:

 Hi,

 A fair dice is rolled. Each time the value is noted and running sum is
 maintained. What is the expected number of runs needed so that the sum is
 even ?
 Can anyone tell how to solve this problem ? as well as other related
 problems of such sort

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




 --
 Regards
 Kunal Yadav
 (http://algoritmus.in/)




-- 
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] Directi Question

2011-08-06 Thread Kunal Yadav
According to me if we get even number in first case then the series will end
there only as we just need an even sum. Similarly in case of e(3) the only
possible sequence for which the sum is even in exactly 3 turns is odd then
even and then odd.

On Sat, Aug 6, 2011 at 11:40 PM, Mukul Gupta mukul.gupta...@gmail.comwrote:

 E(x)= 1 x (1/2) + 2 x (1/2 x 1/2 (Odd-Odd) + 1/2 x 1/2 (Even-Even) + 3 (1/4
 x 1/2 (Odd-Odd-Even)+ 1/4 x 1/2 (Odd-Even-Odd)+ 1/4 x 1/2 (Even-Odd-Odd)+
 1/4 x 1/2(Even-Even-Even) )+
 E(x)= 1/2 + 1 + 3/2 .
 According to me, since the series does not converge, Expectation value does
 not exist.

 @Kunal: For E(2)...The running sum can be even if
 (i) On the first die, we get an odd and then again an odd.
 (ii) On the first die, we get an even and then again an even.

 How have you considered only a single case?

 Please correct if I'm wrong.

 Regards,

 Mukul Gupta
 3rd Year, COE
 NSIT


 On Sat, Aug 6, 2011 at 11:22 PM, Kunal Yadav kunalyada...@gmail.comwrote:

 Hey sry for my above post. I got a little confused. x is the no of times
 dice is rolled so
 e(x)=e(1)+e(2)+e(3)+
  =1/2 + 2*1/(2*2) + 3*1/(2*2*2) + ..
 Please correct me if m wrong..

 On Sat, Aug 6, 2011 at 10:54 PM, Kunal Yadav kunalyada...@gmail.comwrote:

 Expected value of a random variable x is defined as E(x)= summation of
 xp(x) over all value of x where p(x) is the probability.
 so in this case
 E(x)= E(2)+E(4)+ E(6)+ .
  = 2*1/6 + 4* 3/(6*6)+ 6*10/(6*6*6) + .


 On Sat, Aug 6, 2011 at 9:19 PM, sukran dhawan sukrandha...@gmail.comwrote:



 On Sat, Aug 6, 2011 at 8:24 PM, muthu raj muthura...@gmail.com wrote:

  Microsoft written:

 What is the probability of getting atleast one 6 in  3 attempts of a
 dice?

 probability of not getting 6 = 5/6  * 5/6 * 5/6 = 91/216

 so ans 1- 91/216
 let me know how was the paper and the pattern

 *Muthuraj R
 IV th Year , ISE
 PESIT , Bangalore*




 On Sat, Aug 6, 2011 at 7:34 AM, shady sinv...@gmail.com wrote:

 Hi,

 A fair dice is rolled. Each time the value is noted and running sum is
 maintained. What is the expected number of runs needed so that the sum is
 even ?
 Can anyone tell how to solve this problem ? as well as other related
 problems of such sort

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




 --
 Regards
 Kunal Yadav
 (http://algoritmus.in/)




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




-- 
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] [brain teaser] What word am I

2011-06-23 Thread Kunal Yadav
MISTAKEN

On Thu, Jun 23, 2011 at 12:39 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:

 What word am I - 23 june
 *
 *
 *I am eight letters long - “12345678” *
 *My 1234 is an atmospheric condition.
 My 34567 supports a plant.
 My 4567 is to appropriate.
 My 45 is a friendly thank-you.
 My 678 is a man’s name.
 Q: What word am I?
 *
 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/06/what-word-am-i.html?lavesh=lavesh

 Solution:
 Will be updated after 1 day




 --

 Never explain yourself. Your friends don’t need it and
 your enemies won’t believe 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.




-- 
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: spoj NKTM

2011-06-15 Thread Kunal Yadav
Whats ur running time. Mine is 0.05 without using priority queque.

On Wed, Jun 15, 2011 at 8:24 PM, kartik sachan kartik.sac...@gmail.comwrote:

 ya dude finally i applied that algo only

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

2011-06-08 Thread Kunal Yadav
Mr. Black

On Wed, Jun 8, 2011 at 12:33 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:

 *Famous Probability puzzle shoot
  *
 *
 *
 **
 *Mr. Black, Mr. Gray, and Mr. White are fighting in a truel. They each get
 a gun and take turns shooting at each other until only one person is left.
 Mr. Black, who hits his shot 1/3 of the time, gets to shoot first. Mr. Gray,
 who hits his shot 2/3 of the time, gets to shoot next, assuming he is still
 alive. Mr. White, who hits his shot all the time, shoots next, assuming he
 is also alive. The cycle repeats. If you are Mr. Black, where should you
 shoot first for the highest chance of survival?
 *

 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/06/famous-probability-puzzle-shoot-8-june.html?lavesh=lavesh

 Solution:
 Will be updated after 1 day

 --

 Never explain yourself. Your friends don’t need it and
 your enemies won’t believe 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.




-- 
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] snake and ladder

2011-05-29 Thread Kunal Yadav
Made snake and ladder in c using graphics some time ago. Maybe it could help
http://algoritmus.in/blog/2011/03/snakes-and-ladder-in-cgraphics/

On Sat, May 28, 2011 at 2:58 PM, utkarsh srivastav usdilogi...@gmail.comwrote:

 sorry snake and ladder


 On Sat, May 28, 2011 at 2:27 AM, Dilogical King usdilogi...@gmail.comwrote:

 what are the apllication of anake and ladder algo in 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.




-- 
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] PHP E-Book

2011-05-07 Thread Kunal Yadav
W3schools tutorials are best for beginners.

On Sat, May 7, 2011 at 3:01 AM, somya mishra somya.bvm...@gmail.com wrote:

 o riley is good


 On Sat, May 7, 2011 at 2:21 AM, Aniket aniket...@gmail.com wrote:

 Please suggest me a standard PHP book.I know there are lots in the
 internet.But as I am a beginner I want suggestions.Also if possible
 send the book or give me the link.Thanks in advance.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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
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] [brain teaser ] TRICK BRAIN TEASER 2 May

2011-05-02 Thread Kunal Yadav
Place an F on _ to make it a E

On Mon, May 2, 2011 at 1:17 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote:

 * TRICK BRAIN TEASER

  S E Q U E N C _
 What letter can you place on the line, other than E, to complete this
 sequence?

 *
 *Update Your Answers at* : Click 
 Herehttp://dailybrainteaser.blogspot.com/2011/05/trick-brain-teaser-2-may.html?lavesh=lavesh

 Solution:
 Will be updated after 1 day





 --

 Never explain yourself. Your friends don’t need it and
 your enemies won’t believe 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.




-- 
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] [brain teaser] Pirate Puzzle 21april

2011-04-21 Thread Kunal Yadav
So the explanation is:-

Lets say,, there were only 2. Then the top guy does not need any vote. He
will keep all 100. But the bottom guy can see this. So when 3 people were
alive, he will support the 3rd guy. The third guy is greedy and he will keep
99 and give 1 to bottom guy. Bottom fellow will happily take that coin.

But, the second guy knows this. So when the 4th guy was alive, he would vote
for him and take 1 coin from him.

But, the third guy has already figured it out. So he will take whatever the
5th guy offers! Now the 5th guy will give 1 each to 3rd and first.

On Thu, Apr 21, 2011 at 3:21 PM, durgaprasad k durga...@gmail.com wrote:

 @vaibhav : if they dont agree for 1 gold icon they will be thrown out. so
 they will accept the 1 gold coin to stay on .



 On Thu, Apr 21, 2011 at 3:10 PM, vaibhav agrawal agrvaib...@gmail.comwrote:

 Why the two pirates would agree when they are getting only one coins each?


 On Thu, Apr 21, 2011 at 3:05 PM, harshit agrawal 
 hagrawal.250...@gmail.com wrote:

 thwy will be shared according to
 senior most pirate(5th)=98
 4th =0
 3rd =1
 2nd=0
 1st =1


 On Thu, Apr 21, 2011 at 2:54 PM, Anders Ma xuejiao...@gmail.com wrote:

 the coins will be shared the way the oldest pirate proposes.

 On Thu, Apr 21, 2011 at 3:51 PM, Lavesh Rawat lavesh.ra...@gmail.com
 wrote:
  Pirate Puzzle
 
  5 pirates of different ages have a treasure of 100 gold coins.
  On their ship, they decide to split the coins using this scheme:
  The oldest pirate proposes how to share the coins, and all pirates
 remaining
  will vote for or against it.
  If 50% or more of the pirates vote for it, then the coins will be
 shared
  that way. Otherwise, the pirate proposing the scheme will be thrown
  overboard, and the process is repeated with the pirates that remain.
 
  Assuming that all 5 pirates are intelligent, rational, greedy, and do
 not
  wish to die, (and are rather good at math for pirates) what will
 happen?
 
  Update Your Answers at : Click Here
  Solution:
  Will be updated after 1 day
 
  --
 
  Never explain yourself. Your friends don’t need
 it and
  your enemies won’t believe 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.
 



 --
 Regards
 Anders

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




 --









 Harshit Agrawal
 MNNIT Allahabad

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


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

2011-04-02 Thread Kunal Yadav
7 races. well explained by Dave.

On Thu, Mar 31, 2011 at 11:00 AM, sourabh jakhar sourabhjak...@gmail.comwrote:

 answer is 6 races



 On Mon, Mar 28, 2011 at 11:53 PM, Dave dave_and_da...@juno.com wrote:

 7 races.

 For the first five races, divide the horses into groups of five and
 record the win, place, and show finishers of each race.

 For the sixth race, run the winners of the first five races.

 Now, only six horses remain in contention for the fastest three:
   The winner of the sixth race and the place and show horses of his
 first race,
   The place horse in the sixth race and the place horse in his first
 race.
   The show horse in the sixth race.
   Three of these horses are known to be faster than all other horses.

 The winner of the sixth race is known to be the fastest horse. Run the
 other five contenders in race 7 and choose the fastest two.

 Dave

 On Mar 28, 2:54 am, Lavesh Rawat lavesh.ra...@gmail.com wrote:
  *Horse Race Problem Solution*
  *
  *Ok, so there are 25 horses and the race track only allows 5 horses to
 race
  at a given time. Given that there is no stop watch available your task
 is to
  determine the fastest 3 horses. Assume that each horses speed is
 constant in
  different races, what is the minimum number of races to determine the
  fastest 3?
 
  Update Your Answers at : Click
  Here
 http://dailybrainteaser.blogspot.com/2011/03/28march.html?lavesh=lavesh
 
  Solution:
  Will be updated after 1 day
 
  --
 
  Never explain yourself. Your friends don’t need it
 and
  your enemies won’t believe 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.




 --
 SOURABH JAKHAR,(CSE)(3 year)
 ROOM NO 167 ,
 TILAK,HOSTEL
 'MNNIT ALLAHABAD

 The Law of Win says, Let's not do it your way or my way; let's do it the
 best way.

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

2011-03-30 Thread Kunal Yadav
One is grandpa
-- 
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] [brain teaser ] 29march

2011-03-29 Thread Kunal Yadav
122


 1, 2, 5, 14, 41, x
 Whats x ??


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