Results 1 to 9 of 9

Math Help - Nested Summations

  1. #1
    Newbie
    Joined
    Mar 2009
    Posts
    20

    Nested Summations

    Dear all,
    I have found a formula for the probability of winning a simple card game, however that formula has a summation nesting depth of 7 (i.e. 8 summations in total) and the computation time is astronomical. Consequently it is not possible, as it presently stands, to find a figure for the probability.

    Simpler versions of the formula, with smaller nesting depths, take less time to compute (obviously) but the following should give you an idea of how tough this is for my computer:

    • Nesting depth 1 (2 summations): 0.33 seconds
    • Nesting depth 2 (3 summations): 7.33 seconds
    • Nesting depth 3 (4 summations): ~10 minutes
    • ...
    • Nesting depth 7 (8 summations): ~1000 years?!?

    So I seek to reduce this equation to something practical. I expect this will involve DO LOOPS?

    See attached for the formula.

    Hope you can help!

    Many thanks Mick
    Attached Thumbnails Attached Thumbnails Nested Summations-fullscreen-capture-29082009-211035.jpg  
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by sevenquid View Post
    Dear all,
    I have found a formula for the probability of winning a simple card game, however that formula has a summation nesting depth of 7 (i.e. 8 summations in total) and the computation time is astronomical. Consequently it is not possible, as it presently stands, to find a figure for the probability.

    Simpler versions of the formula, with smaller nesting depths, take less time to compute (obviously) but the following should give you an idea of how tough this is for my computer:

    • Nesting depth 1 (2 summations): 0.33 seconds
    • Nesting depth 2 (3 summations): 7.33 seconds
    • Nesting depth 3 (4 summations): ~10 minutes
    • ...
    • Nesting depth 7 (8 summations): ~1000 years?!?

    So I seek to reduce this equation to something practical. I expect this will involve DO LOOPS?

    See attached for the formula.

    Hope you can help!

    Many thanks Mick
    I think you had better tell us what it is the calculation is supposed to represent.

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Mar 2009
    Posts
    20
    See here: Card Maths Investigation

    The formula is for the probability of winning the "Single Suit" version of this game with 8 card guesses. By winning I mean getting all 8 guesses correct. The answer should be around 0.08 or 0.10 at an estimate.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Mar 2009
    Posts
    20
    Update: I reorganised the summations as 8 nested do loops (see attached) which brought the computation time down to a manageable duration, presumably due to much less RAM use. However the result suggests the formula is wrong anyway. Time for a rethink.

    Many thanks
    Attached Thumbnails Attached Thumbnails Nested Summations-fullscreen-capture-01092009-195758.jpg  
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by sevenquid View Post
    Update: I reorganised the summations as 8 nested do loops (see attached) which brought the computation time down to a manageable duration, presumably due to much less RAM use. However the result suggests the formula is wrong anyway. Time for a rethink.

    Many thanks
    Well simulation says that with optimum play the probability of gettin 8 guesses right is ~=0.099 +/- 0.001 (1 standard error)

    CB
    Last edited by CaptainBlack; September 1st 2009 at 12:55 PM. Reason: better result from more replications
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Mar 2009
    Posts
    20
    Simulation? What software are you using CaptainBlack?
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by sevenquid View Post
    Simulation? What software are you using CaptainBlack?
    Euler, but it can be done just as easily in Matlab or its free clones.

    CB
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Mar 2009
    Posts
    20
    wicked. i'll try get hold of matlab. so how do you program it in - can you effectively input the rules of a game into the program and get it to output a probability of winning? i'm a bit new to this stuff you see...
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by sevenquid View Post
    wicked. i'll try get hold of matlab. so how do you program it in - can you effectively input the rules of a game into the program and get it to output a probability of winning? i'm a bit new to this stuff you see...
    You will be effectivly programming it from scratch, the utilities that are provided are random number generators and random permutation generators. From there on you are on your own.

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Dealing with Nested Summations (Series)
    Posted in the Differential Geometry Forum
    Replies: 18
    Last Post: March 30th 2009, 01:41 PM
  2. nested interval thm in R^n
    Posted in the Calculus Forum
    Replies: 5
    Last Post: October 24th 2008, 09:00 AM
  3. Nested Quantifiers
    Posted in the Discrete Math Forum
    Replies: 5
    Last Post: October 6th 2008, 11:53 PM
  4. nested summation
    Posted in the Discrete Math Forum
    Replies: 1
    Last Post: September 20th 2008, 10:52 AM
  5. Nested Interval
    Posted in the Calculus Forum
    Replies: 4
    Last Post: September 28th 2006, 10:46 AM

Search Tags


/mathhelpforum @mathhelpforum