Test your math ability

This is a discussion on Test your math ability within the A Brief History of Cprogramming.com forums, part of the Community Boards category; WTF is happening????? I did sign in. how come it is showing me as a guest???? I know i am ...

  1. #16
    Registered User Jet_Master's Avatar
    Join Date
    May 2002
    Posts
    291
    WTF is happening????? I did sign in. how come it is showing me as a guest???? I know i am a member of this board!!
    Help me moderator (or somebody)
    I am the Alpha and the Omega!!!

  2. #17
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    You have to use the user cp if you want to sign in (well most people do...)

    According to your wording, all five people own all five hats, so the probability is 1 in 1.
    I'd have to go with that answer aswell.

  3. #18
    Registered User moonwalker's Avatar
    Join Date
    Jul 2002
    Posts
    282

    Ask the master if it's math

    First, let's see ...

    Probability = (Favourable Outcomes) / (Total Number of outcomes)


    Favourable Outcomes....

    it's when all the five have their own
    hats... no other combination is acceptable... so only 1 favourable
    outcome

    Total Outcomes ....

    Five hats can be given to 5 people in 5! ways

    5! = 5 * 4 * 3 * 2 * 1 = 120

    Probability (P) = 1/120

    Have fun

  4. #19
    Registered User moonwalker's Avatar
    Join Date
    Jul 2002
    Posts
    282

    and....

    now you ask me why 5! ways ?

    observe the pattern carefully... if you can follow
    till 3, you'll understand...

    1 person ... 1 hat ... 1 way ... ( 1! )

    2 persons .. 2 hats ... 2 ways ... ( 2! )

    3 persons ... 3 hats ... 6 ways ... ( 3! )

    4 persons ... 4 hats ... 24 ways ... ( 4! )

    5 persons ... 5 hats ... 120 ways .... ( 5! )

    from the above pattern,

    n persons ... n hats ... n! ways

  5. #20
    Registered User moonwalker's Avatar
    Join Date
    Jul 2002
    Posts
    282

    another explanation...

    here's another way of looking at it (if you're still interested)

    5 hats - 1 2 3 4 5
    5 girls - A B C D E

    probability of A getting the right hat (out of 5 hats)

    1/5

    probability of B getting the right hat (out of remaining 4 hats)

    1/4

    probability of C getting the right hat (out of remaining 3 hats)

    1/3

    probability of D getting the right hat (out of remaining 2 hats)

    1/2

    probability of E getting the right hat (out of remaining 1 hat)

    1/1


    Now if A gets the right hat, no one else gets A hat (sounds
    dumb, but see...) ... it's the same for B C D & E

    so these "events" tell us that it is conditional probability.
    so, the probability of everybody getting their own hats is

    1/5 * 1/4 * 1/3 * 1/2 * 1/1 = 1/5!


    someone here said 1/3125

    that answer will be correct if the person "picks" the right hat
    and puts it back again ... and the rest do the same ("pick" the
    right hat and put it back again)


    Math is fun

  6. #21
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Posts
    892
    1/5! = 1/120
    Simple stats question.
    Try not.
    Do or do not.
    There is no try.

    - Master Yoda

  7. #22
    Still A Registered User DISGUISED's Avatar
    Join Date
    Aug 2001
    Posts
    499
    1/5 * 1/4 * 1/3 * 1/2 * 1/1 = 1/5!
    Ditto

  8. #23
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380


    Odds of contracting and being affected by the West Nile virus in Illinois: 1/30000

  9. #24
    Still A Registered User DISGUISED's Avatar
    Join Date
    Aug 2001
    Posts
    499
    Originally posted by BMJ


    Odds of contracting and being affected by the West Nile virus in Illinois: 1/30000
    7 more cases found today, one critical, lucky us.

  10. #25
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    meh? Oh... yea, heh; Lucky

    I just saw a bunch of stats, so I just felt like posting something

  11. #26
    Still A Registered User DISGUISED's Avatar
    Join Date
    Aug 2001
    Posts
    499
    I am just glad I live downtown..I don't see to many bugs here.

  12. #27
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Okay , early i said 1/120 , I am sticking with that answer. Here is a little reasoning. Lets assume you have 5 objects. There are only a certain number of permuations for this set. 2 Permuations are

    1,2,3,4,5
    1,2,3,5,4

    Just for example. To get the total number of permuations you do 5! which equals 120. Only 1 of those is right however because each of the 5 owners only owns 1 hat. So 1/120 is the correct answer. It doesn't matter if you pass out the hats all at once OR one by one, the answer holds.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  13. #28
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Is it a permutations answer or a combinations answer? I don't want to think about, but my guess after reading was 5! or 1 in 120 that each individual would recieve their own hat.

  14. #29
    Registered User moonwalker's Avatar
    Join Date
    Jul 2002
    Posts
    282

    hmm

    probabilities are usually based on permutations.

    combinations come into place when it doesn't matter
    which way you give the hat as long as they get hats..

    Eg.
    The number of combinations of 3 girls sitting together in
    3 seats is 1.
    (doesn't care about arrangements.. as long as they sit
    together, it's a combination.. different ways of arrangements
    of the same are considered as repitition)

    The number of permutations of 3 girls sitting together
    in 3 seats is 6.
    (does care about arrangements)


    Now why would we want to study combinations then?
    It's when we want to cancel out repititions.

    For example, the number of ways of "choosing" 3 girls
    from 12 girls is 12 C 3 (doesnt matter which way you
    choose the girls, as long as you choose 3 of them)

    The number of ways of "arranging" 3 specific girls out
    of 12 is 12 P 3 (it matters which spice girl you pulled out
    1st, 2nd and 3rd )
    Last edited by moonwalker; 08-21-2002 at 10:19 AM.

  15. #30
    Unregistered
    Guest
    Most of you put what was expected: 1/25.
    But the correct answer is: 1/120.

    Thanks Again

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sustring test puzzle
    By WDT in forum C# Programming
    Replies: 3
    Last Post: 06-29-2009, 08:19 AM
  2. Help needed to verify a new on-line C test
    By JanHruska in forum Projects and Job Recruitment
    Replies: 15
    Last Post: 06-20-2009, 07:48 AM
  3. American math students ...
    By whiteflags in forum A Brief History of Cprogramming.com
    Replies: 36
    Last Post: 05-26-2008, 01:47 PM
  4. Math Test Problem Disagreement
    By orbitz in forum A Brief History of Cprogramming.com
    Replies: 29
    Last Post: 02-28-2003, 04:27 PM
  5. Test yourself
    By SAMSAM in forum Game Programming
    Replies: 20
    Last Post: 02-20-2003, 11:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21