Results 1 to 6 of 6

Thread: [RESOLVED] very simple probability problem (A or B or C)

  1. #1

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Resolved [RESOLVED] very simple probability problem (A or B or C)

    Can someone please verify that I've got my head on straight and see if I've got the right answer to the following probability calculation...

    Three completely unrelated events have the following probabilities...

    A has a probability of 0.14
    B has a probability of 0.47
    C has a probability of 0.71

    What is the probability of 1 OR MORE of those events happening?

    My working so far is to rewrite the expression as ((A or B) or C) ...

    OR is calculated for 2 independent events thus: (a+b)-(a*b)

    Therefore for (A or B or C)...
    probtemp = ((A+B)-(A*B))
    probtemp = (probtemp+C)-(probtemp*C)

    For which I get a final answer of 0.867818.

    This isn't very elegant really, assuming this is the right result, is there a nicer way to calculate OR probabilities for a list of events (eg without having to iterate through an array, acumulating the probability as I go)?

    The internet really doesn't do a good job of explaining this kind of thing, not taht i've seen anyway, does anyone know any good online resources for probability math?
    I don't live here any more.

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: very simple probability problem (A or B or C)

    Your formula is right (for completely unrelated events). One way to think of probabilities is as circle diagrams. If you're interested in what I mean I'll write something up.

    Using your calculation, you've got

    P(A or B or C) = P((A or B) or C) = ((a+b)-(a*b)+c)-(((a+b)-(a*b))*c)
    = (a + b + c - ab) - (ac + bc - abc)
    = a+b+c - ab-ac-bc + abc

    This pattern can be extended in general to alternately add and subtract the possible (unique) combinations of elements, via the inclusion-exclusion principle (the Wiki writeup is not good for beginners, unfortunately, though it does have a section specifically on probability). I would imagine that your algorithm is orders of complexity faster than actually using inclusion-exclusion, even if it's not very pretty.

    I find it unfortunate how badly explained probability usually is. I'm sorry, I don't have a nice site to refer you to. In the right light, probability is really simple... but only in the right light. Otherwise it's incredibly obtuse.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: very simple probability problem (A or B or C)

    Thank you for that, I hate having to guess at things like this, it's good to get confirmation

    I seem to remember probability as they taught it in my school as rather difficult to understand. To me it semed like just a bunch of arbitrary formulas that "you just have to use because they work". They didn't explain why they worked. I think that if they had explained why then it would have made more sense to everyone at the time. I still find it difficult but at least I'm making some headway at the moment, even if I forget it all by next week

    Thanks for your help
    I don't live here any more.

  4. #4
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: very simple probability problem (A or B or C)

    I decided to formalize my notion of probability with circles. I was able to derive the first few weeks of an intro probability course (depending on the difficulty) in a couple pages. I ran out of room to state Bayes' theorem, but it's a very simple extension of what I did derive. It also shows relatively rigorously how your (a+b)-ab formula came into being, if you combine results 1 and 3. The Inclusion-Exclusion principle just extends the formula I give [P(A or B) = P(A) + P(B) - P(A and B)] by adding many circles instead of just 2.




    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  5. #5
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: [RESOLVED] very simple probability problem (A or B or C)

    Some might say that the probability of one or more events occurring is 1- (probability of none of them occurring).

    The probability of none of them occurring is clearly just the individual probabilities multiplied: 0.86 x 0.53 x 0.29

    QED.
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  6. #6
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: [RESOLVED] very simple probability problem (A or B or C)

    Yup, there's another way to go (which can be proven with circle diagrams if you add a "universe" box with size 1 and prove a lemma about complements and independent events). That algorithm should have the same order as the original algorithm, but I suppose you might call it "cleaner".
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width