Flip A Coin - 79 Times

Settings
close

Flip coin(s) times

Features of this Coin Tosser

  • Toss a coin
  • Uses American dime for the toss
  • Also allows side landing according to the probability of 1 in 6000
  • Start and Stop the coin at your own will

Statistics of this Coin Flipper

  • Flip 1 Coin - 79 times
    Total Possible Combinations 80

    Number of combinations are calculated using the formula
    [ (2+79-1) choose (79) ] or [ 80 choose 79 ]
    where 2 is the number of sides of the coin and 79 is the number of coins.

    You can try generating all the combinations of Heads and Tails using the following combination generator
    All possible combinations of 79 coins
  • Flip 1 Coin - 79 times
    Total Possible Permutations 6.0446290980731E+23
    (around 604 sextillion)


    Number of permutations are calculated using the formula [ 2^79 ]
    where 2 is the number of sides of the coin and 79 is the number of coins.

    You can try generating all the permutations of Heads and Tails using the following permutations generator
    All possible permutations of 79 coins

Probabilities of this 79 Coin Tosser

Assuming that all the coins are fair coins and probability of getting either Heads or Tails is 1/2 or 50%

Probability of getting a Heads when flipping a coin 79 times

In technical terms, this is equivalent of getting atleast one Heads.

Probability of getting atleast one Heads is close to 1., about 100% percent.

The probability of getting atleast one Heads is calculated by multiplying all the probabilities of not getting a Heads for each coin and then subtracting the answer from 1.

P(Heads>=1)
            = 1 - [ P(H=0)Coin1 x P(H=0)Coin2 x P(H=0)Coin3 x P(H=0)Coin4 x P(H=0)Coin5 x P(H=0)Coin6 x P(H=0)Coin7 x P(H=0)Coin8 x P(H=0)Coin9 x P(H=0)Coin10 x P(H=0)Coin11 x P(H=0)Coin12 x P(H=0)Coin13 x P(H=0)Coin14 x P(H=0)Coin15 x P(H=0)Coin16 x P(H=0)Coin17 x P(H=0)Coin18 x P(H=0)Coin19 x P(H=0)Coin20 x ... ]
            = 1 - [ 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x ... ]
            
You can generate all possible permutations and combinations of 1 Coin - 79 times containing atleast one Heads using the following permutations and combinations generator All possible combinations of 79 coins with atleast one Heads All possible permutations of 79 coins with atleast one Heads

To verify the answer, you can divide the number of permutations containing atleast 1 Heads by number of total possible permutations of 79 coins.

Probability of not getting a Heads when flipping 1 Coin - 79 times

Probability of not getting any Heads is close to 0.00000000000000000000000165, about 0.00000000000000000000017% percent.

Probability of getting zero Heads is calculated by multiplying all the probabilities of not getting a Heads for each coin.

P(Heads=0)
            = P(H=0)Coin1 x P(H=0)Coin2 x P(H=0)Coin3 x P(H=0)Coin4 x P(H=0)Coin5 x P(H=0)Coin6 x P(H=0)Coin7 x P(H=0)Coin8 x P(H=0)Coin9 x P(H=0)Coin10 x P(H=0)Coin11 x P(H=0)Coin12 x P(H=0)Coin13 x P(H=0)Coin14 x P(H=0)Coin15 x P(H=0)Coin16 x P(H=0)Coin17 x P(H=0)Coin18 x P(H=0)Coin19 x P(H=0)Coin20 x ...
            = 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x ...            

Probability of getting exactly 1 Heads or 78 Tails when flipping 1 Coin - 79 times

Probability of getting exactly 1 Heads is close to 0.000000000000000000000131, about 0.000000000000000000013% percent.

You can calculate this using counting or by using the binomial distribution

Using Counting

You can think of 79 coins as spots to be filled. There are 6.0446290980731E+23 ways to fill these spots with either a Heads or Tails (all possible permutations). Now, we need to find how many of these permutations contain exactly 1 Heads. In other words, in how many different ways can we place 1 Heads in 79 spots? Or, in how many ways can we pick 1 out of 79 spots? The answer can be caclulated using the formula [ 79 choose 1 ]. So, there are 79 ways to choose 1 out of 79 spots. The probability is calculated by dividing the number of ways to pick 1 spots by the number of total permuations.

P (H=1)
                = Ways to pick 1 out of 79 spots / Total permutations of 79 coins
                = (79 choose 1) / (2^79)                
                = 79 / 6.0446290980731E+23                

Using Binomial Distribution

In Binomial Distribution, we look for k number of successful events in n number of trials where p is the probability of each successful event. Here, a successful event means getting a Heads and an event means a coin flip.

To get exactly 1 Heads, we need k=1 successful events out of total n=79 events. Each event has a probability p=1/2 of occuring.

Probability of k=1 successful events is then calculated as follows.
P(k=1)
                = (n choose k) pk (1-p)n-k
                = (79 choose 1) (1/2)1 (1/2)79-1
                = (79 choose 1) (1/2)79
                = 79 x (1/6.0446290980731E+23)
                

You can generate all possible permutations and combinations of 1 Coin - 79 times containing exactly 1 Heads using the following permutations and combinations generator All possible combinations of 79 coins with exactly 1 Heads All possible permutations of 79 coins with exactly 1 Heads

To verify the answer, you can divide the number of permutations containing exactly 1 Heads by number of total possible permutations.

Probability of getting exactly 40 Heads or 39 Tails when flipping 1 Coin - 79 times

Probability of getting exactly 40 Heads is close to 0.0889, about 8.89% percent.

You can calculate this using counting or by using the binomial distribution

Using Counting

You can think of 79 coins as spots to be filled. There are 6.0446290980731E+23 ways to fill these spots with either a Heads or Tails (all possible permutations). Now, we need to find how many of these permutations contain exactly 40 Heads. In other words, in how many different ways can we place 40 Heads in 79 spots? Or, in how many ways can we pick 40 out of 79 spots? The answer can be caclulated using the formula [ 79 choose 40 ]. So, there are 5.3753604366668E+22 ways to choose 40 out of 79 spots. The probability is calculated by dividing the number of ways to pick 40 spots by the number of total permuations.

P (H=40)
                = Ways to pick 40 out of 79 spots / Total permutations of 79 coins
                = (79 choose 40) / (2^79)                
                = 5.3753604366668E+22 / 6.0446290980731E+23                

Using Binomial Distribution

In Binomial Distribution, we look for k number of successful events in n number of trials where p is the probability of each successful event. Here, a successful event means getting a Heads and an event means a coin flip.

To get exactly 40 Heads, we need k=40 successful events out of total n=79 events. Each event has a probability p=1/2 of occuring.

Probability of k=40 successful events is then calculated as follows.
P(k=40)
                = (n choose k) pk (1-p)n-k
                = (79 choose 40) (1/2)40 (1/2)79-40
                = (79 choose 40) (1/2)79
                = 5.3753604366668E+22 x (1/6.0446290980731E+23)
                

You can generate all possible permutations and combinations of 1 Coin - 79 times containing exactly 40 Heads using the following permutations and combinations generator All possible combinations of 79 coins with exactly 40 Heads All possible permutations of 79 coins with exactly 40 Heads

To verify the answer, you can divide the number of permutations containing exactly 40 Heads by number of total possible permutations.

Probability of getting exactly 78 Heads or 1 Tails when flipping 1 Coin - 79 times

Probability of getting exactly 78 Heads is close to 0.000000000000000000000131, about 0.000000000000000000013% percent.

You can calculate this using counting or by using the binomial distribution

Using Counting

You can think of 79 coins as spots to be filled. There are 6.0446290980731E+23 ways to fill these spots with either a Heads or Tails (all possible permutations). Now, we need to find how many of these permutations contain exactly 78 Heads. In other words, in how many different ways can we place 78 Heads in 79 spots? Or, in how many ways can we pick 78 out of 79 spots? The answer can be caclulated using the formula [ 79 choose 78 ]. So, there are 79 ways to choose 78 out of 79 spots. The probability is calculated by dividing the number of ways to pick 78 spots by the number of total permuations.

P (H=78)
                = Ways to pick 78 out of 79 spots / Total permutations of 79 coins
                = (79 choose 78) / (2^79)                
                = 79 / 6.0446290980731E+23                

Using Binomial Distribution

In Binomial Distribution, we look for k number of successful events in n number of trials where p is the probability of each successful event. Here, a successful event means getting a Heads and an event means a coin flip.

To get exactly 78 Heads, we need k=78 successful events out of total n=79 events. Each event has a probability p=1/2 of occuring.

Probability of k=78 successful events is then calculated as follows.
P(k=78)
                = (n choose k) pk (1-p)n-k
                = (79 choose 78) (1/2)78 (1/2)79-78
                = (79 choose 78) (1/2)79
                = 79 x (1/6.0446290980731E+23)
                

You can generate all possible permutations and combinations of 1 Coin - 79 times containing exactly 78 Heads using the following permutations and combinations generator All possible combinations of 79 coins with exactly 78 Heads All possible permutations of 79 coins with exactly 78 Heads

To verify the answer, you can divide the number of permutations containing exactly 78 Heads by number of total possible permutations.

Probability of getting all Heads when flipping 1 Coin - 79 times

Probability of getting all Heads is close to 0.00000000000000000000000165, about 0.00000000000000000000017% percent.

This is calculated by multiplying together all the probabilities of getting a Heads for each coin.

P(Heads=79)
            = P(H=1)Coin1 x P(H=1)Coin2 x P(H=1)Coin3 x P(H=1)Coin4 x P(H=1)Coin5 x P(H=1)Coin6 x P(H=1)Coin7 x P(H=1)Coin8 x P(H=1)Coin9 x P(H=1)Coin10 x P(H=1)Coin11 x P(H=1)Coin12 x P(H=1)Coin13 x P(H=1)Coin14 x P(H=1)Coin15 x P(H=1)Coin16 x P(H=1)Coin17 x P(H=1)Coin18 x P(H=1)Coin19 x P(H=1)Coin20 x ...
            = 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x ...            

Probability of getting one of a kind when flipping 1 Coin - 79 times

Probability of getting one of a kind is close to 0.00000000000000000000000331, about 0.00000000000000000000033% percent.

There are 2 ways to get one of a kind (all Heads or all Tails). The probability of getting all of any kind is then caclulated by adding the probability of getting all Heads or all Tails. Since, probabilities of getting all Heads or all Tails are the same, we can just multiply one of them by 2. So, multiplying the probability of getting all Heads by 2 will give us the probability of getting all of any kind.

 
    Probability of getting all of a kind
        = Pobability of getting all Heads + Pobability of getting all Tails 
        = 2 x Pobability of getting all Heads
        = 2 x (1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x 1/2 x ...)    
    

Javascript code to Flip a Coin - 79 times


    // Flip a Coin - 79 times
    
        
        // define the range of numbers to pick from
        var lowest = 1;             // lowest possible side of the coin // 1 for heads
        var highest = 2;           // highest possible side of the coin // 2 for tails
        var number_of_coins = 1;    // how many coin to flip
        var times = 79;              // how many times to flip

        // allow the coin to land on the side 
        // change to false if sidelanding not desired
        var allow_sidelanding = true; 

        var PROBABILITY_OF_SIDELANDING = 6000; // set the probability of sidelanding to 1 in 6000
        

        var generated_flips = [];

        
        for (var i = 1; i <= times; i++) {

            // outer loop for the number of 'times' to flip the coins       

            var this_flip = []; // array to store the results of this flip

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

                // inner loop for the number of coins

                // for each coin, generate a number between lowest and highest
                var coin_face = Math.floor(Math.random() * (highest-lowest+1) + lowest);

                // if sidelanding is allowed
                if (allow_sidelanding) {

                    // first check for sidelanding scenario with given probability
                    var edge = Math.floor(Math.random() * (PROBABILITY_OF_SIDELANDING-1+1) + 1);

                    // if sidelanding is probable, override the coin face with edge value i.e. 3
                    // i.e. if we generated a 1 when generating a number between 1 and PROBABILITY_OF_SIDELANDING
                    if (edge === 1) {
                        coin_face = 3;
                    }

                }

                this_flip.push(coin_face); //store this in the array
            }

            generated_flips.push(this_flip); // store the result of this flip in generated_flips

        }
        
        // print all the generated flips
        
        for (i = 0; i < generated_flips.length; i++) {    
            
            // loop through the outer times array
            
            for (j = 0; j < generated_flips[i].length; j++) {

                // loop through the inner coin array 

                //print each coin flip value followed by a space
                document.write(generated_flips[i][j]);
                document.write(" ");

            }

            //print a line break for each time
            document.writeln("<br>");

        }

    
    

    /* 

    Sample output 

    

    */
    


...