# [R] family question

Wed Aug 30 23:14:13 CEST 2000

```This is a standard problem in stochastic processes. The distribution of the
family size has an infinite mean. See, for example, Cox & Miller, "The theory
of stochastic processes", Methuen, 1965, example 2.8.

Ted Catchpole.

On Thu, 31 Aug 2000,
Troels Ring wrote:
> Dear friends. Please see the program below and answer if it does simulate a
> population of 1.000.000 families, each with at max 20000 children (typical
> in Denmark, you know), constructed such that each family stops having
> children when more boys than girls are present ? Equal numbers of boys and
> girls are got in the population, according to the simulation, is that
obvious ?
>
> ND <- NP <- NULL #ND - number boys, P: girls
> for (j in 1:1000000) # number of families
> {
> n1 <- n2 <- NULL
> for (i in 1:20000)  {
> n1[i] <- rbinom(1,1,0.5) # each equally likely - here number of boys
> n2[i] <- 1- n1[i] # and girls
> if(sum(n1)>sum(n2)) break
> }
> ND[j] <- sum(n1)
> NP[j] <- sum(n2)
> }
> sum(ND)/sum(NP)
> j
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--
Dr E.A. (Ted) Catchpole
School of Maths & Stats                Honorary Senior Research Fellow
University College, UNSW               Institute of Maths & Stats
Australian Defence Force Academy       University of Kent at Canterbury
Canberra, ACT 2600, Australia          Canterbury CT2 7NF, England
e-catchpole at adfa.edu.au                E.A.Catchpole at ukc.ac.uk