Results 1 to 2 of 2

Math Help - Need help with creating a probability based Java application

  1. #1
    Newbie
    Joined
    Aug 2011
    Posts
    1

    Need help with creating a probability based Java application

    Hello everyone!

    I'm new here, and admitidly maths has never been my strong point, so I'm gonna need your help to solve a problem I'm having;

    For homework as a university student I'm told to go and program to my hearts content over the summer, I've decided to create a warhammer program that calculates the probability of a certain outcome occuring.

    So I think I should explain how the game called warhammer works;

    You roll a dice to "hit", for example to "hit" you need to score a 3 or over (3+)

    You roll a dice to "wound", for example to "wound" you need to score a 4 or over (4+)

    You roll a dice (well, the other person does) to "save", for example to "save" you need to score a 5 or over (5+)

    If the first player hits, and also wounds, the other players gets the opportunity to save it (and then nothing else happens if they save it).

    So what I have so far is those 3 events are independant of each other, so I would calculate the odds by multiplying the odds for each event occuring.

    I.e. for the example given above;

    2/3 (0.66) to hit
    3/6 (0.5) to wound
    1/3 (0.33) to save

    0.66 * 0.5 * 0.66 (the odds NOT to save it, as this is from only the attacking players perspective) = 0.2178 So 21% odds for a single attack to hit, wound, and for the other person not to save it.

    But what confuses me, is how I could calculate the probability of not just one attack (attempt at hitting and wounding e.g.) but numerous attempts at doing so. For example, say I have 3 attempts, what are the odds of at least one of those attempts being sucessfull?

    Would I multiply the 21% by another 21%? Would I just multiple the 21% by the amount of attempts the player has?

    I hope I haven't bored you and that you understand

    Thanks in advance
    Last edited by subwayhell; August 14th 2011 at 02:31 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

    Re: Need help with creating a probability based Java application

    Quote Originally Posted by subwayhell View Post
    Hello everyone!

    I'm new here, and admitidly maths has never been my strong point, so I'm gonna need your help to solve a problem I'm having;

    For homework as a university student I'm told to go and program to my hearts content over the summer, I've decided to create a warhammer program that calculates the probability of a certain outcome occuring.

    So I think I should explain how the game called warhammer works;

    You roll a dice to "hit", for example to "hit" you need to score a 3 or over (3+)

    You roll a dice to "wound", for example to "wound" you need to score a 4 or over (4+)

    You roll a dice (well, the other person does) to "save", for example to "save" you need to score a 5 or over (5+)

    If the first player hits, and also wounds, the other players gets the opportunity to save it (and then nothing else happens if they save it).

    So what I have so far is those 3 events are independant of each other, so I would calculate the odds by multiplying the odds for each event occuring.

    I.e. for the example given above;

    2/3 (0.66) to hit
    3/6 (0.5) to wound
    1/3 (0.33) to save

    0.66 * 0.5 * 0.66 (the odds NOT to save it, as this is from only the attacking players perspective) = 0.2178 So 21% odds for a single attack to hit, wound, and for the other person not to save it.

    But what confuses me, is how I could calculate the probability of not just one attack (attempt at hitting and wounding e.g.) but numerous attempts at doing so. For example, say I have 3 attempts, what are the odds of at least one of those attempts being sucessfull?

    Would I multiply the 21% by another 21%? Would I just multiple the 21% by the amount of attempts the player has?

    I hope I haven't bored you and that you understand

    Thanks in advance
    It is 1 minus the probability that all miss, and the probability that they all miss is the product of the probabilities that they individually miss.

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Calculating a new probability based on a scenario
    Posted in the Statistics Forum
    Replies: 0
    Last Post: December 10th 2009, 04:49 AM
  2. sample selection based on unequal probability
    Posted in the Statistics Forum
    Replies: 5
    Last Post: November 10th 2009, 05:58 PM
  3. Easy question about creating a probability distribution
    Posted in the Advanced Statistics Forum
    Replies: 2
    Last Post: October 15th 2009, 04:21 AM
  4. Replies: 3
    Last Post: October 16th 2008, 12:21 AM
  5. Calculus based probability book
    Posted in the Advanced Statistics Forum
    Replies: 10
    Last Post: June 9th 2007, 07:32 PM

Search Tags


/mathhelpforum @mathhelpforum