\documentclass{article}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{eufrak}
%\numberwithin{equation}{section}

\newtheorem{theorem}{Theorem}%[section]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}


\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0in}
\begin{document}

\title{Examples of Mass Functions and Densities\footnote{\copyright 2019 Joseph C Watkins}}
\author{Worksheet 11}
\date{}
\maketitle

\begin{enumerate}
\item In this problem, we shall use {\sf R} to calculate probabilities and quantiles for random variables.
\begin{enumerate}
\item For $X$ a negative binomial with $n=5$ and $p=5/8$, find $P\{X=x\}$ for $x=0,1,\cdots, 12$. Display  these values in a plot.
\item For $Z$ a standard normal, find values for $z$ so that $P\{Z\le z\}= 0.01, 0.05, 0.25, 0.50, 0.75, 0.95, 0.99.$. Indicate these values on a plot of the distribution function for $Z$.
\item For $X$ a $\chi^2_4$ random variable find values for $x$ so that $P\{X> x\}=0.10,0.05,0.01$.
Indicate these values on a plot of the density function for $X$.
\item Create a table of the probability mass functions of a $Bin(60,1/40)$, and $Bin(600,1/400)$ and $Pois(1.5)$ random variable for $x=0,1,\cdots,6$. Compare the probability mass functions.
\end{enumerate}
\item In this problem, we shall use {\sf R} to simulate with random variables.
\begin{enumerate}
\item Simulate 1000 independent beta random variables with $\alpha=2$ and $\beta = 4$. Find the mean and variance of this sample and compare it to the actual values.
\item Use {\tt rhyper} to simulate 1000 times the drawing 10 marbles out of an urn containing 
\begin{enumerate}
\item 5 black and 15 white marbles,
\item 30 black and 90 white marbles.
\end{enumerate}
Compute the means and standard deviations for the number of white marbles from the simulations.  Compare it to the distributional answers.
\item Repeat the exercise above using the appropriate binomial random variable to simulate sampling with replacement.  Compute the mean and standard deviation of the number of white marbles and compare it to the distributional answers. 
\item Compare the means and variances for parts (b) and (c) and explain in words why they differ (or why they do not).
\end{enumerate}

\end{enumerate}

\end{document}