Part Zero: The ladybug on the trellis.
Part One: Pascal's Triangle
Different Patterns found therein
Binomial Distribution (x+y)^n
Plinko
Flipping a coin
OUTCOMES may overlap, but the PATTERNS are unique
Part Two: Expected Value
Sample Space with one die
Probability with one die
Sample Space with two die
Probability with two die
probability vs. sample space, and some good practice problems.
bins=c(0.9,1.9,2.9,3.9,4.9,5.9,6.9,7.9,8.9,9.9,10.9,11.9,12.9)
diceroll=c() #sum of two regular dice
for(i in 1:10000){diceroll<-c(diceroll,sum(sample(1:6,2,replace=TRUE)))}
hist(diceroll,breaks=bins,col=rgb(1,0,0,1/2))
diceroll.12=c() #this is for a 12 sided die
for(i in 1:10000){diceroll.12<-c(diceroll.12,sample(1:12,1))}
hist(diceroll.12,breaks=bins,col=rgb(0,0,1,1/4),add=T)
Part Three: Expected Value
What type of game would make sense...and at what costs?
Can you beat the house?
POWERBALL.
---
Class 17:
Homework:
Discussion of the Expected Value of a Lottery Ticket
why the difference between mean and median matters
other issues when dealing with probability
Probability Questions
Intro Question: Is it a good bet?
Roll a Die 4 Times
Roll Two Dice 24 Times
Birthday Problem
Activity One: Flipping a Coin
we are going to get very different results here: some will get ten coin flips all heads, some tails, some of us near the center
but how do we know if it's a fair coin?
BIG IDEA: when we sample, we head towards the mean. But this means that there are going to be drastic differences. sometimes, when we sample, we are going to get a result that is off from what we expect.
What does it mean to sample?
Activity Two: Sampling from the M&M sheet
we are bad at picking out boxes on our own. We used r to get the boxes for us to select. This gave us better results than we had before.
Sampling from a sheet
convenience sampling
"random" sampling
random number table
randomness from the internet
sample 10 according to r. take those values and make a graph as a class:
boxes=scan()
1 1 1 1 1 5 12 1 1 1 1 8 16 4 9 1 9 4 1 1 1 4 10 5 18 12 4 5 10 4 16 5 12 12 4 4 10 9 10 8 16 6 4 1 10 3 16 6 12 1 16 6 12 4 16 4 18 4 8 16 8 3 9 1 5 10 4 12 4 18 4 12 16 10 8 18 3 4 8 2 15 6 2 4 8 5 6 4 10 16 3 5 16 3 6 18 4 6 12 9
list=c(1:20)
plot(boxes,boxes,col="white",pch=16,xlim=c(0,20),ylim=c(0,20),xlab="mean",ylab="test number")
abline(v=mean(boxes),lwd=3)
our.values=c( ....what we got in class ...)
points(our.values,list,pch=19)
some are near the value, others are father away. obviously, this is going to happen every time we do something like this.
what we need is an acceptable RANGE that comes from our sample. This range should be small enough to be useful, but large enough for us to not be wrong.
BIG IDEA: by sampling, we create something that's "normal". Which means, we create a value that we can work with.
BIG IDEA: by using z-scores, we can determine how "confident" we want to be about our guess.
list=c(1:20)
plot(boxes,boxes,col="white",pch=16,xlim=c(0,20),ylim=c(0,20),xlab="mean",ylab="test number")
abline(v=mean(boxes),lwd=3)
sample.boxes=c()
for(i in 1:20){sample.boxes<-c(sample.boxes,mean(sample(boxes,10)))}
points(sample.boxes,list,pch=19)
z.star=1.960
sample.box.low=sample.boxes-z.star*sd(boxes)/sqrt(10)
sample.box.high=sample.boxes+z.star*sd(boxes)/sqrt(10)
segments(sample.box.low,list,sample.box.high,list,col="red")
This is going to create a list for us. but how did I come up with the numbers?
N(mean, sd/sqrt(n)) ... so I use: x +- z* (sd/sqrt(n)). This gives me a range where I believe that the true value lies.