Chance operations & probability theory

From GenerativeArt

(Difference between revisions)
Jump to: navigation, search
m (Fix formatting)
m (more format tweaks)
'''Example: What is the probability of flipping a coin and getting heads?'''
'''Example: What is the probability of flipping a coin and getting heads?'''
-
Total number of states in the ensemble = 2 (heads and tails)
+
Total number of states in the ensemble = 2 (heads and tails) <br>
Total number of states that qualify as the event in question = 1 (heads)
Total number of states that qualify as the event in question = 1 (heads)
'''Example: What is the probability of drawing an ace of spades from a shuffled deck of cards?'''
'''Example: What is the probability of drawing an ace of spades from a shuffled deck of cards?'''
-
Total number of states in the ensemble = 52 (total number of cards in the deck)
+
Total number of states in the ensemble = 52 (total number of cards in the deck) <br>
Total number of states that qualify as the event in question = 1 (the ace of spades)
Total number of states that qualify as the event in question = 1 (the ace of spades)
'''Example: What is the probability of drawing an ace from a shuffled deck of cards?'''
'''Example: What is the probability of drawing an ace from a shuffled deck of cards?'''
-
Total number of states in the ensemble = 52 (total number of cards in the deck)
+
Total number of states in the ensemble = 52 (total number of cards in the deck) <br>
Total number of states that qualify as the event in question = 4 (the ace of spades, hearts, clubs, and diamonds)
Total number of states that qualify as the event in question = 4 (the ace of spades, hearts, clubs, and diamonds)
'''Example: What is the probability of flipping a coin and getting 4 heads in a row?'''
'''Example: What is the probability of flipping a coin and getting 4 heads in a row?'''
-
Probability of the individual event = .5
+
Probability of the individual event = .5 <br>
Probability of a sequence of 4 of those events = .5 * .5 * .5 * .5 = .0625
Probability of a sequence of 4 of those events = .5 * .5 * .5 * .5 = .0625
'''Example: What is the probability of drawing 4 aces from a shuffled deck of cards?'''
'''Example: What is the probability of drawing 4 aces from a shuffled deck of cards?'''
-
For the first card -
+
For the first card: <br>
-
Total number of states in the ensemble = 52 (total number of cards in the deck)
+
Total number of states in the ensemble = 52 (total number of cards in the deck) <br>
Total number of states that qualify as the event in question = 4 (the ace of spades, hearts, clubs, and diamonds)
Total number of states that qualify as the event in question = 4 (the ace of spades, hearts, clubs, and diamonds)
Probability = 4/52 = .07692
Probability = 4/52 = .07692
-
For the second card -
+
For the second card: <br>
-
Total number of states in the ensemble = 51 (total number of cards remaining in the deck)
+
Total number of states in the ensemble = 51 (total number of cards remaining in the deck) <br>
Total number of states that qualify as the event in question = 3 (the remaining aces)
Total number of states that qualify as the event in question = 3 (the remaining aces)
Probability = 3/51 = .05882
Probability = 3/51 = .05882
-
For the third card -
+
For the third card: <br>
-
Total number of states in the ensemble = 50 (total number of cards remaining in the deck)
+
Total number of states in the ensemble = 50 (total number of cards remaining in the deck) <br>
Total number of states that qualify as the event in question = 4 (the remaining aces)
Total number of states that qualify as the event in question = 4 (the remaining aces)
Probability = 2/50 = .04
Probability = 2/50 = .04
-
For the fourth card -
+
For the fourth card: <br>
-
Total number of states in the ensemble = 49 (total number of cards remaining in the deck)
+
Total number of states in the ensemble = 49 (total number of cards remaining in the deck) <br>
Total number of states that qualify as the event in question = 4 (the remaining ace)
Total number of states that qualify as the event in question = 4 (the remaining ace)
As noted above the probability of an event is a function of the number of states in an ensemble and the number of those states which qualify as the event in question. In some situations counting the number of qualifying states is a matter of analyzing combinations.
As noted above the probability of an event is a function of the number of states in an ensemble and the number of those states which qualify as the event in question. In some situations counting the number of qualifying states is a matter of analyzing combinations.
 +
In the case of flipping coins you can think of each coin as a bit in a binary number.  When you flip a single coin you have a single bit.  In other words heads or tails is analogous to 1 or 0.  So a single coin, like a single bit, has 2 states.  Getting a head has a probability of .5 because it represents one state out of the possible 2, or 1/2= .5.
-
<SPAN STYLE="font-size: larger;"><u>Pinball Example</u></SPAN>
+
Flipping 2 coins is like working with 2 bits.  2 bits have 4 states, i.e. with 2 bits you can count from 0 to 3 (00 -> 01 -> 10 -> 11).  Of those 4 states only one has both heads (HH or 11), one state has both tails (TT or 00), and two states have a head and tails (HT and TH, or 01 and 10).  So the probability of getting both heads is 1/4 or .25.  The probability of getting a head and a tail is 2/4 or .5.  The probability of getting both tails is 1/4 or .25. 
-
In this example a ball is dropped on the top pin of a triangular arrangement of pins. The ball ends up exiting in one of several columns. The probability that a ball will end up in a given column is a function of the number of paths that lead to that column.
+
The sum of all the possible probabilities always equals 1. This is just a way of saying that when you flip some coins one of the possible outcomes will definitely happen!  In this case .25 + .5 + .25 = 1.
-
(Illustration and Applet pending)
+
 
 +
'''Example: What is the probability of flipping 4 coins and getting 2 heads and 2 tails?'''
 +
 
 +
Total number of states for 4 coins = number of states for 4 bits = 2<sup>4</sup> = 16.<br>
 +
Total number of states that includes 2 heads and 2 tails: <br>
 +
HHTT TTHH HTHT THTH HTTH THHT = 6 states<br>
 +
Probability of 2 heads and 2 tails from 4 flipped coins = 6/16 = .375.
<SPAN STYLE="font-size: larger;"><u>Pascal's Triangle</u></SPAN>
<SPAN STYLE="font-size: larger;"><u>Pascal's Triangle</u></SPAN>
-
This geometric arrangement of numbers was devised by Blaise Pascal to demonstrate and calculate the probability of a proposition that is the combination of binary events.  To construct Pascal's Triangle each number is the sum of the 2 numbers in the line above.  The resulting numbers can be viewed as the expected statistical distribution.  For example, flipping 3 coins there is only one way to get all heads or all tails, but 3 ways to get 1 tail and 2 heads (THH, HTH, HHT), and 3 ways to get 1 head and 2 tails.  
+
The geometric arrangement of numbers below was devised by Blaise Pascal to demonstrate and calculate the probability of a proposition that is a combination of binary events.  It can be used as an aid in coin flipping examples where you need to know the number of ways a given combination can occur.  (I.e. the number of permutations for a given combination).
 +
 
 +
To construct Pascal's Triangle each number is the sum of the 2 numbers in the line above.  The resulting numbers can be viewed as the expected statistical distribution.  Reading from left to right in the line for 3 coins, there is one way to get 3 heads (HHH), 3 ways to get 2 heads (HHT, HTH, THH), 3 ways to get 1 head (HTT, THT, TTH), and 1 way to get 0 heads (TTT).
-
                            1  
+
If you add up all the numbers in a line you get the sum of all the possible states or outcomes.  So for 3 coins there are 1 + 3 + 3 + 1 = 8 possible outcomes.  Note that this is consistent with using 3 bits to count from 0 to 7. 
-
                        1    1  
+
<br><tt>
-
                      1   2  1  
+
                              1  
-
                    1  3   3 1  
+
1 coin                    1  1                    sum = 2<sup>1</sup> =  2
-
                  1 4   6   4 1  
+
  2 coins                  1   2  1                  sum = 2<sup>2</sup> =  4
-
                1 5  10  10  5 1  
+
3 coins                1  3   3   1               sum = 2<sup>3</sup> =  8
-
              1 6  15 20  15 6 1  
+
  4 coins              1  4  6   4   1             sum = 2<sup>4</sup> =  16
-
            1 7  21 35 35 21 7 1  
+
  5 coins            1  5  10  10  5   1           sum = 2<sup>5</sup> =  32
-
          1 8 28 56 70 56 28 8 1
+
  6 coins          1  6  15 20  15   6   1         sum = 2<sup>6</sup> =  64
 +
  7 coins        1  7  21 35 35  21  7   1       sum = 2<sup>7</sup> = 128
 +
  8 coins      1  8  28 56 70 56  28  8   1     sum = 2<sup>8</sup> = 256
 +
</tt>
-
To calculate the probability of a given outcome one simply takes the number of combinations that can lead to the desired result, divided by the number of possible results.  So the probability of flipping 3 coins and  getting a head and 2 tails is:  
+
To calculate the probability of a given outcome one simply takes the number of outcomes that lead to the desired result, divided by the number of possible results.  So the probability of flipping 3 coins and  getting a head and 2 tails is:  
(3) / ( 1 + 3 + 3 + 1 ) = 3/8 = .375
(3) / ( 1 + 3 + 3 + 1 ) = 3/8 = .375
-
The probability of flipping 6 coins and getting the most likely result of 3 heads and 3 tails is:
+
'''Example: What is the probability of flipping 6 coins and getting 3 heads and 3 tails?'''
-
(20) / ( 1 + 6 + 15 + 20 + 15 + 6 + 1 ) = 20/64 = .3125
+
The "6 coins" row indicates there are 20 ways to get 3 heads and 3 tails.
 +
It also indicates there are 64 possible outcomes.
 +
The probability of flipping 6 coins and getting 3 heads and 3 tails is then 20/64 = .3125
-
 
+
Note that even though the most likely result of flipping 6 coins is an equal number of heads and tails, this actually happens less than than 1/3 of the time.  An even money bet against getting 3 heads and 3 tails is a winner!
-
Note that the most likely result, an equal number of heads and tails, happens less than than 1/3 of the time when flipping 6 coins!
+
== Statistical Distributions ==
== Statistical Distributions ==
-
<SPAN STYLE="font-size: larger;">Different kinds of "random" </SPAN>
+
<SPAN STYLE="font-size: larger;">Different kinds of randomness </SPAN>
<SPAN STYLE="font-size: larger;"><u>Uniform Distributions</u></SPAN>
<SPAN STYLE="font-size: larger;"><u>Uniform Distributions</u></SPAN>
-
 
(Text and Illustration Pending)
(Text and Illustration Pending)
<SPAN STYLE="font-size: larger;"><u>The Normal or Gaussian Distribution</u></SPAN>
<SPAN STYLE="font-size: larger;"><u>The Normal or Gaussian Distribution</u></SPAN>
 +
As more and more lines are added to Pascal's Triangle the distribution approximates a "bell curve" or "normal distribution", also known as a "Gaussian distribution."  This distribution is found throughout nature.  For example height and weight measurements of a given population will approximate a normal distribution. 
-
As more and more lines are added to Pascal's Triangle the distribution approximates a "bell curve" or the normal distribution, also known as a Gaussian Distribution. This distribution is found throughout nature, for example height and weight measurements of a given population will approximate a normal distribution.
+
The reason this happens is that such natural phenomena are typically determined by a large number of factors.  In the case of the height of an individual some factors will contribute to being tall while others will contribute to being short.  Just as there are more ways to flip a mix of heads and tails than there are ways to flip all or mostly heads, there are more ways to combine these factors to lead to medium height than there are to lead to being very tall or very short.
 +
 
 +
 
 +
<SPAN STYLE="font-size: larger;"><u>Pinball Example</u></SPAN>
 +
 
 +
In this example a ball is dropped on the top pin of a triangular arrangement of pins. The ball ends up exiting in one of several columns. The probability that a ball will end up in a given column is a function of the number of paths that lead to that column.
(Additional Text and Illustrations and Applet Pending)
(Additional Text and Illustrations and Applet Pending)
<SPAN STYLE="font-size: larger;"><u>The Law of Large Numbers</u></SPAN>
<SPAN STYLE="font-size: larger;"><u>The Law of Large Numbers</u></SPAN>
-
 
+
Even though events in nature will often tend towards a normal distribution, any particular set of measures or samples will show variation.  Where sample sizes are small the general distribution in nature may not be at all apparent.  As the sample size grows the apparent distribution will incrementally grow closer to the actual distribution in all of nature.
-
Even though events in nature will often tend towards a normal distribution, any particular set of measures or samples will show variation.  Where sample sizes are small the general distribution in nature may not be at all apparent.  As the sample size grows the apparent distribution will incrementally grow closer to the actual distribution in nature.
+
== Links ==
== Links ==

Revision as of 16:39, 20 September 2008

Personal tools