Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

last.tie

Last tie in 100 coin tosses


Description

Toss a coin 100 times and keep a running count of the number of heads and the number of tails. Record the times when the number is tied and report the last one. The distribution will have an approximate “arc-sine” law or well-shaped distribution.

Usage

data(last.tie)

Format

200 numbers between 0 and 100 indicating when the last tie was.

Details

This data comes from simulating the commands: x = cumsum(sample(c(-1,1),100,replace=T))

and then finding the last tie with

last.tie[i]<-max(0,max(which(!sign(x) == sign(x[length(x)])))).

Examples

data(last.tie)
hist(last.tie)

UsingR

Data Sets, Etc. for the Text "Using R for Introductory Statistics", Second Edition

v2.0-6
GPL (>= 2)
Authors
John Verzani <verzani@math.csi.cuny.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.