GeeksforGeeks » Interview Questions

Infosys Interview Question for Software Engineer/Developer (Fresher) about Puzzle

(5 posts)
  1. ganesh
    guest
    Posted 2 years ago #

    Persons A and B. Person A picks a random no. from 1 to 1000.Then person B picks a random no. from 1 to 1000. What is the probability of B getting no. greater then what A has picked.

  2. ajaym
    Member
    Posted 2 years ago #

    Say A picks 1 with probability of 1/1000 so now B has 999 numbers to choose from that are greater than 1.
    So the probability comes out to be
    1/1000*1/999+ 1/1000*1/998+ 1/1000*1/997 .... 1/1000*1(where A chooses 999).
    i.e
    1/1000( 1/999 + 1/998 + 1/997+...1)

  3. devendraiiit
    Member
    Posted 2 years ago #

    I think @ajaym has missed some point

    Say A picks 1 with probability of 1/1000 so now B has 999 numbers to choose from that are greater than 1.So the probability comes out to be (1/1000 * 1 )

    Say A picks 2 with probability of 1/1000 so now B has 999 numbers to choose from that are greater than 1.So the probability comes out to be (1/1000 * 998/999 )

    similarly

    1/1000*1/999+ 1/1000*2/999+ 1/1000*3/999 .... 1/1000*999/999
    i.e
    =(1/1000)*( 1+2+3+ ... +999) /999
    =(1/1000)*(999*1000*(1/2))/999
    =1/2
    =============

    We can think this problem in other way also , directly give probability to 1/2.

    :)

  4. man9sh
    Member
    Posted 6 months ago #

    its
    999/2000;

  5. sankalp
    guest
    Posted 4 months ago #

    a very logical way to solve it easily:

    prob of B not getting same number as A : (1-(1/1000))=999/1000

    As a simple symmetry rule
    prob of getting smaller number = prob getting greater number
    Therefore probability of getting larger number=999/2000
    -----------------------
    one more way to see this problem as ways of choosing 2 numbers that will be 1000 C 2
    and total ways will be 1000*1000
    so prob =(1000 c 2)/(1000^2)


Reply

You must log in to post.

RSS feed for this topic