Roll a D40 die

Settings
close
dice sided add_circle

Roll times   

D40 Dice Roller

  • D40 Dice Roller
  • Rolls a D40 die
  • Lets you roll multiple dice like 2 D40s, or 3 D40s. Add, remove or set numbers of dice to roll
  • Combine with other types of dice (like D38 and D42) to throw and make a custom dice roll

Statistics of this Dice Roller

  • RollD40
  • Total Kinds of Dice1
  • Total Dice1
  • Minimum Sum1
  • Maximum Sum40
  • Lowest Dice Face1
  • Highest Dice Face40
  • Highest Dice Face of the Smallest Die40
  • D40
    Total Possible Combinations 40

    Number of combinations are calculated using the formula [ (40+1-1) choose (1) ]

    You can try generating all the combinations using the following combination generator
    All possible combinations of 1D40
  • D40
    Total Possible Permutations 40

    Number of permutations are calculated using the formula [ 40^1 ]

    You can try generating all the permutations using the following permutations generator
    All possible permutations of 1D40

Probabilities of this Dice Roller

D40

Probability of getting a 1

In technical terms this is equivalent of getting atleast one 1. This is close to 0.025, about 2.5% percent.

This is calculated by multiplying all the probabilities of not getting a 1 for each dice and then subtracting the answer from 1.

1 - (39/40)

Probability of not getting a 1

Probability of not getting any 1 is close to 0.97, about 97.5% percent.

This is calculated by multiplying all the probabilities of not getting a 1 for each dice.

39/40

Probability of getting all 1's

Probability of getting all 1's is close to 0.025, about 2.5% percent.

This is calculated by multiplying together all the probabilities of getting a 1 for each dice.

1/40

Probability of getting 1 1s

Probability of getting 1 1's is close to 0.025, about 2.5% percent.

This is calculated by multiplying together all the probabilities of getting a 1 for each dice that has a 1.

1/40

Probability of getting a 40

In technical terms this is equivalent of getting atleast one 40. This is close to 0.025, about 2.5% percent.

This is calculated by multiplying all the probabilities of not getting a 40 for each dice and then subtracting the answer from 1.

1 - (39/40)

Probability of not getting a 40

Probability of not getting any 40 is close to 0.97, about 97.5% percent.

This is calculated by multiplying all the probabilities of not getting a 40 for each dice.

39/40

Probability of getting all 40's

Probability of getting all 40's is close to 0.025, about 2.5% percent.

This is calculated by multiplying together all the probabilities of getting a 40 for each dice.

1/40

Probability of getting 1 40s

Probability of getting 1 40's is close to 0.025, about 2.5% percent.

This is calculated by multiplying together all the probabilities of getting a 40 for each dice that has a 40.

1/40

Javascript code to create this dice roller


    // code to create a D40 dice roller

    
                   
        // define the range of numbers to pick from
        var lowest = 1;             // lowest possible side of the dice
        var highest = 40;           // highest possible side of the dice
        var numbers_of_dice = 1;    // how many dice to roll     
        
        var this_roll = []; // array to store the results of this roll

        for (var j = 1; j <= numbers_of_dice; j++) {

            // loop for the number of dice

            // for each dice, generate a number between lowest and highest
            var dice_face = Math.floor(Math.random() * (highest-lowest+1) + lowest);
            this_roll.push(dice_face); //store this in the array
        }
            
        
        // print all the generated rolls
            
        for (j = 0; j < this_roll.length; j++) {

            // loop through the dice array 

            //print each dice roll value followed by a space
            document.write(this_roll[j]);
            document.write(" ");

        }
            
        
    

    /* 

    Sample output 

    

    */
    


...