statistic question.....help

Discussion in 'Odds & Ends' started by pushing_wins, Jan 27, 2011.

  1. pushing_wins

    pushing_wins Hall of Fame

    Joined:
    May 12, 2006
    Messages:
    2,794
    random number generator between 1-100

    what is the probabiity of any number repeating at least once in 20 attempts?
     
    #1
  2. mightyrick

    mightyrick Hall of Fame

    Joined:
    Aug 19, 2010
    Messages:
    4,750
    Location:
    Austin, TX
    I don't like to give flat out answers, so I'll just say to first simplify the question to see the logic. Answer this question:

    "What is the probability of any random number (1-100) repeating in two attempts?" So for any number out of one hundred, there is a .01 (1%) chance of hitting it. You have to run through the tree of possible outcomes:

    P(Miss-Miss) = .99 * .99 = .9801
    P(Miss-Hit) = .99 * .01 = .0099
    P(Hit-Miss) = .01 * .99 = .0099
    P(Hit-Hit) = .01 * .01 = .0001

    The chance for hitting it two attempts is .01 * .01. = .0001. So 1 in 1000.

    Now, "What is the possibility of any random number (1-100) repeating at least twice in three attempts?" In three "rolls", there are the following possible outcomes:

    P(Miss-Miss-Miss) = .99 * .99 * .99 = .970299
    P(Miss-Miss-Hit) = .99 * .99 * .01 = .009801
    P(Miss-Hit-Miss) = .99 * .01 * .99 = .009801
    P(Miss-Hit-Hit) = .99 * .01 * .01 = .000099
    P(Hit-Hit-Hit) = .01 * .01 * .01 = .000001
    P(Hit-Hit-Miss) = .01 * .01 * .99 = .000099
    P(Hit-Miss-Hit) = .01 * .01 * .99 = .000099
    P(Hit-Miss-Miss) = .01 * .99 * .99 = .009801

    Total probability of the above (all of P(outcome)) added together is 1.0. Therefore, our probability tree is good.

    So the probability in three attempts of hitting any number at least twice is:

    P(MHH) + P(HHH) + P(HHM) + P(HMH) = .000099 + .000001 + .000099 + .000099 = .000298 = 1 in 298,000

    Now, there is a pattern here. I won't tell you how to solve it completely, but I will say that to answer the "What is the possibility of any random number (1-100) repeating at least twice in 20 attempts?"... start to think about it in the reverse:

    Total probability of all outcomes minus probability of hitting any random number only once in 20 attempts and minus the probability of not hitting it at all in 20 attempts:

    T(all P) - P(1 hit in 20 attempts) - P(0 hit in 20 attempts) = 1.0 - P(1 hit in 20 attempts) - P(MMMMMMMMMMMMMMMMMMMM)

    Now the question is... what is P(1 hit in 20 attempts)?

    Well, that would be P(HMMMMMMMMMMMMMMMMMMM) multipled by the 20 ways you can hit that outcome, right?

    I'll let you figure the rest out...

    :)
     
    Last edited: Jan 28, 2011
    #2
  3. VaththalKuzhambu

    VaththalKuzhambu Rookie

    Joined:
    Sep 24, 2010
    Messages:
    141
    Let me take a stab at this.

    Probability that the number A, where 1<=A<=100, occurs in any attempt is p=1/100.

    Number of attempts = n=20.

    You want the number A to appear at least twice in the 20 attempts. Therefore, number of occurrences required is k>=2. Occurrence is also sometimes referred to as a success.

    Number of occurrences, K, is a random variable that follows a binomial distribution with parameters n=20 and p=1/100 and can take the values k=0,1,...,20.

    P(K>=2) = 1 - [P(K<2)] = 1 - [P(K=0) + P(K=1)].

    P(K=0) and P(K=1) can be obtained using the probability mass function (pmf) for binomial distribution.

    Hope this is correct and it helps.
     
    #3
  4. sureshs

    sureshs Bionic Poster

    Joined:
    Oct 1, 2005
    Messages:
    35,027
    Prob of repeating at least once = 1 - (prob(it does not occur at all) + prob(it occurs exactly once))

    For binomial distribution, here p = prob of success = 0.01, q = prob of failure = 0.99.

    Prob of getting exactly r successes in n trials = (nCr)*p^r*q^(n-r)

    So the twp probs are:
    (20C0)*0.01^0*0.99^20 = 1*1*0.99^20 = 0.8179

    and
    (20C1)0.01^1*0.99^19 = 20*0.01*0.99^19 = 0.1652
    So, answer is 1 - (0.8179 + 0.1652) = 0.0169
     
    Last edited: Jan 28, 2011
    #4
  5. VaththalKuzhambu

    VaththalKuzhambu Rookie

    Joined:
    Sep 24, 2010
    Messages:
    141
    Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.


     
    #5
  6. sureshs

    sureshs Bionic Poster

    Joined:
    Oct 1, 2005
    Messages:
    35,027
    MeenKuzhambu

    Not mean as in average or mean as in character - but you know what I mean LOL
     
    #6
  7. sureshs

    sureshs Bionic Poster

    Joined:
    Oct 1, 2005
    Messages:
    35,027

    You are teasing him by not telling him about (nCr), aren't you :)
     
    Last edited: Jan 28, 2011
    #7
  8. pushing_wins

    pushing_wins Hall of Fame

    Joined:
    May 12, 2006
    Messages:
    2,794
    thanks everyone.

    i did a little research of my own. what i asked was the birthday problem. isnt it?
     
    #8
  9. mightyrick

    mightyrick Hall of Fame

    Joined:
    Aug 19, 2010
    Messages:
    4,750
    Location:
    Austin, TX
    :)

    I won't just *give* someone an answer. I prefer for someone to at least do a little looking... follow the breadcrumb trail... and find the answer.
     
    #9
  10. SoBad

    SoBad Legend

    Joined:
    Aug 2, 2006
    Messages:
    7,738
    Location:
    shiran
    I’d like to take a stab at this, and I think it’s easiest to find the odds of the opposite happening and subtract that from one. The way I see it, we have 20 independent trials then and want the likelihood of 20 unique numbers.

    On the first trial the number will definitely be unique, so 100/100 odds; for the second any number but the one drawn in the first trial will do, so it’s 99/100; for the third 98/100; etc., and for the 20th it’s 81/100. Since the trials are independent, we just multiply these 20 factors through and get a ratio with 100^20 in the denominator. In the numerator we have 100x99x98…x81, which is basically 100!/80!.

    Plug it into a spreadsheet, and I get p = 1 – (100!/80!)/100^20 = 86.96%

    This better be right.:neutral:
     
    #10
  11. Steady Eddy

    Steady Eddy Hall of Fame

    Joined:
    Jul 19, 2007
    Messages:
    2,545
    Location:
    Arizona
    First figure the probability of failure. The chance that the 2nd # does NOT match the first is 99/100. Then the 3rd # must avoid both of these, with a chance of 98/100, and so on.

    This looks like 100/100 * 99/100 *... * 81/100. Which is the same as the fraction 100 P 20 / 100^20, which is approximately equal to .13039. If that is the failure rate, the success rate is approximately .86961.

    Yes, this is the same as the math to the "birthday problem". There's also a way to estimate the answer. This might be needed because these large numbers are too big for many calculators. Consider, how many pairing occur in the 20? That is, how many ways are there to select 2 numbers out of 20? That's 20 C 2, or 190. So a decent estimate is .99^190 = .1481. 1 -.1481 = .8519. Not a bad estimate.

    (The P in 100 P 20 is for permutation, and that button is getting to be fairly common on calculators now. And 20 C 2 is for combinations, if your calculator does permutations it also does combinations, and the two buttons are probably right next to each other.)
     
    Last edited: Jan 28, 2011
    #11
  12. Steady Eddy

    Steady Eddy Hall of Fame

    Joined:
    Jul 19, 2007
    Messages:
    2,545
    Location:
    Arizona
    Yeah, 100!/80! would be another way of getting the product of the integers 81 through 100. Good job!!
     
    #12
  13. SoBad

    SoBad Legend

    Joined:
    Aug 2, 2006
    Messages:
    7,738
    Location:
    shiran
    Thanks, those are very very large numbers actually, and I am sure there is a proper mathematical way to simplify that ratio. But Excel and even the Google search window apparently have no trouble with 160-digit numbers, so why bother haha. I couldn't crank 100! on my HP 12C calculator, it can handle up to 100 significant figures, now that I test it.
     
    #13
  14. Steady Eddy

    Steady Eddy Hall of Fame

    Joined:
    Jul 19, 2007
    Messages:
    2,545
    Location:
    Arizona
    Since .99^100 is about 1/e, you can use the "e" button to estimate answers on the cheaper calculators.

    For example, the classic birthday problem says, "If 23 people are in a room, what is the chance that 2 share a birthday?" The exact way is 365 P 23 / 365^23. But the estimate way is: since 23 C 2 = 253. We could type (364/365)^253 = .4995, and 1 - .4995 = .5005, over 50%! Since 253/365 = .693, if a calculator can't handle this, e^-.693, (which is .50007) can still give a quick estimate.

    How do you do this with the google search window? :confused:
     
    #14
  15. SoBad

    SoBad Legend

    Joined:
    Aug 2, 2006
    Messages:
    7,738
    Location:
    shiran
    I was thinking there has to be some exact simplification for n!/k! that would have been used before Excel/Google calculator were widely available. Alas these supercomputing powers breed human laziness!

    As for the Google search window, just try typing expressions into it and see if you get a numeric answer. E.g., if I type "100!/80!/100^20", I get 0.130399502 from Google search. I mean Excel is more reliable, but Google search is great when you just need something very quickly, I use it for quick currency conversions all the time too!
     
    #15
  16. pushing_wins

    pushing_wins Hall of Fame

    Joined:
    May 12, 2006
    Messages:
    2,794
    #16
  17. pushing_wins

    pushing_wins Hall of Fame

    Joined:
    May 12, 2006
    Messages:
    2,794
    do you guys feel that stats was the most worthwhile course you took in university?
     
    #17
  18. mightyrick

    mightyrick Hall of Fame

    Joined:
    Aug 19, 2010
    Messages:
    4,750
    Location:
    Austin, TX
    For me, it wasn't the most worthwhile course, but it was very important.

    I think statistical modeling and analysis is the most useful and advanced mathematics that the ordinary person who doesn't want to be a physicist, chemist, or real (not computer programmers) engineer can get.

    My math background extends beyond just statistics, but for me... those concepts have been largely useless. Interesting maybe... but not really that useful.
     
    #18
  19. pushing_wins

    pushing_wins Hall of Fame

    Joined:
    May 12, 2006
    Messages:
    2,794
    a person without basic concepts or stats and probabilty, is it more likely he or she will make more wrong decisions/judgements than right in the long run?
     
    #19
  20. Steady Eddy

    Steady Eddy Hall of Fame

    Joined:
    Jul 19, 2007
    Messages:
    2,545
    Location:
    Arizona
    I think so. Someone emailed me a newspaper article about the big difference in assets between couples who knew some math and those that did not. There were 3 pretty easy math questions, couples who went 3 for 3 had acquired assets of over a $ million, on average. Couples who did poorly, averaged assets of only about $ 200,000 for their retirement.

    I don't have the email or link anymore. But it supported what I've long suspected, which is that just a little mathematical understanding makes a huge difference over a long period of time.
     
    #20
  21. mightyrick

    mightyrick Hall of Fame

    Joined:
    Aug 19, 2010
    Messages:
    4,750
    Location:
    Austin, TX
    Yes, it is more likely.

    The great thing about statistics is that it teaches someone that decisions can be made based on data. Rather than just with "your gut". Therefore, it enables people to make better decisions. That's why it is so valuable.
     
    #21
  22. ProgressoR

    ProgressoR Hall of Fame

    Joined:
    Feb 1, 2010
    Messages:
    2,005
    Location:
    No Man's Land
    Just saw the thread, this (below) is what I was going to write, it seems the "easiest" way to look at the issue, I havent checked the final calculation but the methodology is exactly what I would have done. This is not necessarily a good thing, please note.

    Mind you, I do tell myself very often that I am very intelligent.

     
    #22
  23. Photo

    Photo Banned

    Joined:
    Dec 31, 2010
    Messages:
    56
    Honestly, Sobad is the best of TTW posters and I love being a member of Club SOBAD:)
     
    #23

Share This Page