Title: Flipping Coins
1 Flipping Coins
- Warm-up Activity
- Six identical coins to be flipped 10 times
- Tally results (for example, HTTHTT 2 Heads)
- Clearly, results range from
- 0 Heads ? 6 Heads or 6 Tails ? 0 Tails
- Construct a Histogram
- Special Consideration
- Exercise 1 Flip and Tally
- Exercise 2 Make up random-looking results
2Class Acitivity Results
Exercise 1 Make up random-looking results
of Heads
Exercise 2 Flip and Tally
3Flipping CoinsResults
How many?
- gt sample(01,6,replaceT,probc(0.5,0.5))
- 1 1 1 1 0 1 0
- Ten Times
- NHeadslt-rep(NA,10)
- for(i in 110)
- Resultlt-sample(01,6,replaceT,probc(0.5,0.5))
- NHeadsilt-sum(Result)
-
- gt NHeads
- 1 4 3 3 3 0 2 3 4 3 3
Possible items (numbers or characters) to choose
from
gt par(labc(6,6,10),lwd2) gt hist(NHeads,breaksse
q(-.5,6.5,by1),col"salmon2") gt box()
4Probability Distributions
- Random Phenomena
- Histograms are one way to summarize probabilities
- hist(data,prpbabilityT)
- Uncertain outcomes ? Probabilities
- Examples,
- Rain Tomorrow?
- Traffic on the Turnpike
- Number of snowy days
- How do we understand variability?
- Usually compute a Mean, Expected, Average Value
and some variability around it. - Probability Density Functions (PDF) provide a
compact description of random phenomena. Normal
or Gaussian is extensively used.
Some measure of variability
Probability Density
X
Mean(m)
5Normal Distribution
This slide full of Math Expressions
- Area under the PDF (integral)
- For Normal Distribution,
- This distribution is spread over the entire
number line - A Cumulative Density Function (CDF) computes the
probability,
To come up with the Normal Distribution for your
data, need m and s
6Normal DistributionCAN R SIMPLIFY MATTERS?
- Accessing and Reading the Temperature data in to
R - ?read.table()
- locc(http//www.civil.umaine.edu/ewre/sjain/AnnT
MidlandTx.txt) - read.table(loc,skip1)-gtTdata
- For example,
- To read from a file
- read.table(c/Texas/T.txt)
- Look up header nrows options
7Summarizing DataCAN R SIMPLIFY MATTERS?
year
- Temperature data is stored in Tdata
- Tdata,2
- Recall, we need Mean and Standard Deviation to
define the Normal Distribution for the
Temperature data
Annual Temp.
8Summarizing DataCAN R SIMPLIFY MATTERS?
Sum of all temperature values, divided by the
number of values
Remove mean from all temperature values, square
them and compute the sum divide by (n-1) and
take square root
9Summarizing Data? Probabilistic Description
10Normal Distribution Computing Exceedance other
probabilities