In: Computer Science
I AM USING R PROGRAMMING LANGUAGE / R- CODE
**Problem 3 (5 pts) - similar to Pr. 44 page 243 in text** Consider tossing **four** fair coins. There are 16 possible outcomes, e.g `HHHH,HHHT,HHTH,HTHH,THHH, ...` possible outcomes. Define `X` as the random variable “number of heads showing when four coins are tossed.” Obtain the mean and the variance of X. Simulate tossing three fair coins 10,000 times. Compute the simulated mean and variance of X. Are the simulated values within 2% of the theoretical answers?
Hint: to find the theoretical values use `dbinom (x= , size = , prob = )`
**Solution:**YOUR CODE HERE:
```{r}
```