All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Never consecutive (Posted on 2021-01-26) Difficulty: 4 of 5
Given d dice each with n sides, find the probability that when they are rolled at once, there are no two consecutive numbers.

This task may be quite difficult. For a warm-up, try finding the numerators for fixed d such as {1,2,3} or for fixed n such as {2,3,4}.

Note 1: I don't have a formula so much as an algorithm.
Note 2: This problem arose as an attempt to solve http://perplexus.info/show.php?pid=12342 by Larry which uses non-independent cards instead of dice.

No Solution Yet Submitted by Jer    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts simulations for comparison | Comment 2 of 7 |
Here are two runs of a set of simulations. Each row is marked with the number of sides to each die, followed by the probability, by marked number, of no two consecutive numbers, for 2 through 8 dice, also marked.

Each datum is the result of 1,000,000 trials. Three digits are shown after the decimal point as that would be the expected accuracy for a million trials; the consistency is shown for the two runs given.

>> neverConsecutive
  2   2 0.500   3 0.249   4 0.125   5 0.063   6 0.031   7 0.016   8 0.008 
  3   2 0.555   3 0.333   4 0.210   5 0.136   6 0.089   7 0.059   8 0.039 
  4   2 0.624   3 0.344   4 0.180   5 0.092   6 0.046   7 0.023   8 0.012 
  5   2 0.680   3 0.376   4 0.200   5 0.107   6 0.059   7 0.033   8 0.019 
  6   2 0.723   3 0.418   4 0.223   5 0.116   6 0.060   7 0.030   8 0.015 
  7   2 0.754   3 0.458   4 0.251   5 0.130   6 0.067   7 0.034   8 0.018 
  8   2 0.782   3 0.496   4 0.279   5 0.148   6 0.076   7 0.039   8 0.019 
  9   2 0.803   3 0.530   4 0.307   5 0.166   6 0.086   7 0.043   8 0.022 
 10   2 0.820   3 0.562   4 0.337   5 0.186   6 0.098   7 0.050   8 0.025 
>> neverConsecutive
  2   2 0.500   3 0.250   4 0.125   5 0.062   6 0.031   7 0.015   8 0.008 
  3   2 0.555   3 0.333   4 0.210   5 0.136   6 0.089   7 0.059   8 0.039 
  4   2 0.625   3 0.344   4 0.180   5 0.091   6 0.047   7 0.023   8 0.012 
  5   2 0.680   3 0.377   4 0.200   5 0.107   6 0.059   7 0.033   8 0.019 
  6   2 0.722   3 0.417   4 0.224   5 0.117   6 0.060   7 0.030   8 0.015 
  7   2 0.755   3 0.458   4 0.250   5 0.131   6 0.067   7 0.034   8 0.018 
  8   2 0.781   3 0.497   4 0.279   5 0.147   6 0.076   7 0.039   8 0.019 
  9   2 0.803   3 0.530   4 0.308   5 0.166   6 0.086   7 0.044   8 0.022 
 10   2 0.820   3 0.563   4 0.338   5 0.186   6 0.098   7 0.050   8 0.025
 
 
For 2-sided dice (a coin flip) success is getting the same side each time, which results in probabilities of 1/2, 1/4, 1/8 and 1/16 with 2, 3, 4 and 5 dice, respectively. After that it gets harder to calculate.

Curiously, although in general the more faces on each die, the higher the likelihood of avoiding consecutive numbers, in the case of four dice, 4- and 5-sided dice have less probability of avoiding them than do 3-sided dice, and with five dice, when they are 6-sided that number also joins being less probable than for 3-sided dice.

The value for four 5-sided dice looked a lot like it could represent an actual probability of 1/5, so I did a simulation of that one case with 100 million trials and indeed got 0.2000 making the case even stronger for exactly 1/5.

% clc
for sides=2:10
    fprintf('%3d ',sides)
    for  dice=2:8
        hits=0; die=zeros(1,dice);
        for trial=1:1000000
            for d=1:dice
               s=randi(sides);
               die(d)=s;
            end
            die=sort(die);
            fail=false;
            for i=1:dice-1
                if abs(die(i)-die(i+1))==1
                   fail=true; 
                end
            end
            if fail==false
               hits=hits+1;
            end
        end
        fprintf('%3d %5.3f ',dice,hits/trial)
    end
    fprintf('\n')
end

  Posted by Charlie on 2021-01-26 10:19:46
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (18)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information