\documentclass[10pt,letter]{exam}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tabularx,ragged2e}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepgfplotslibrary{statistics}
\begin{document}

\begin{coverpages}
\begin{center}\huge MATH 1113 - EXAM 1 SPRING 2017\\
SOLUTION
\end{center}

\begin{flushleft}\vspace{0.5in}
Friday 10 February 2017 \\
Instructor: Tom Cuchta
\end{flushleft}

\textbf{Instructions:}
\begin{itemize}
	\item  Show all work, clearly and in order, if you want to get full
	credit. If you claim something is true \textbf{you must show work backing up your claim}. I reserve the right to take off points if I cannot see how you arrived at your answer (even if your final answer is correct).
	\item Justify your answers algebraically whenever possible to ensure full credit. 	
	\item  Circle or otherwise indicate your final answers.
	\item  Please keep your written answers brief; be clear and to the point.
	\item  Good luck!
\end{itemize}
\vspace*{10pt}


\end{coverpages}

\begin{questions}

\question[2] Answer the following questions.
\begin{parts}
\part[1] Is a population or a sample being described? 
\begin{center}``The cholesterol levels of 20 patients in a hospital with 100 patients."\end{center}
\textit{Solution:} This is a sample -- the cholesterol levels of entire population of the hospital is not being described, only a part of it.
\part[1] Is a parameter or a statistic being described?
\begin{center}``In a recent year, the average math score on the ACT for all graduates was 21.1."\end{center} 
\textit{Solution:} This is a parameter -- the average was taken among \textbf{all} scores on the ACT.
\end{parts}

\question[5] Consider the following data:\\
\begin{tabular}{llllllll}
7 & 40 & 13 & 9 & 25 & 8 & 22 & 11 \\
0 & 2 & 18 & 2 & 30 & 7 & 35 & 39 \\
12 & 15 & 8 & 6 & 5 & 29 &0  & 16\\
\end{tabular}\\
Construct a frequency distribution for the data using $5$ classes. \\
\textit{Solution:} Note the range is
$$\mathrm{range}=40-0=40,$$
so we construct the frequency table as follows: \\
\begin{tabular}{l|l}
Class & Frequency \\
\hline
0--8 & 10 \\
9--16 & 6 \\
15--24 & 2 \\
25--32 & 3 \\
33--40 & 3
\end{tabular}

\question[9] Consider the following data representing the time (in seconds) of the winning time in the Kentucky Derby between 2000 and 2010: \\
\begin{tabular}{lllllllllllllll}
119.9 & 121.0 & 121.1 & 121.1 & 121.3 & 121.8 & 122.1 & 122.6 & 122.7 & 124.0 & 124.0
\end{tabular} 
\begin{parts}
\part[5] Find the median. \\
\textit{Solution:} The median -- i.e. the middle value --- is $121.8$. (We did not have to reorder this data because it was already ordered.)
\part[4] Find the mode. \\
\textit{Solution:} The mode -- i.e. the most often occurring value -- is both $121.1$ and $124.0$. 
\end{parts}
\question[6] Find the weighted mean score of the following scores from a hypothetical student in MATH 1113 at the end of the course:\\
\begin{tabular}{lll}
 & \textbf{Score} (out of 100 points) & \textbf{Percent of final grade} \\
Homework & 74 & 16 \% \\
Exam 1 & 80 & 17 \% \\
Exam 2 & 70 & 17 \% \\
Exam 3 & 68 & 17 \%  \\
Final Exam & 86 & 33 \% \\
\end{tabular} \\
\textit{Solution:} We compute the weighted mean:
$$\begin{array}{ll}
\mathrm{WeightedMean} &= \dfrac{74(0.16) + 80(0.17) + 70(0.17) + 68(0.17) + 86(0.33)}{0.16+0.17+0.17+0.17+0.33} \\
&= \dfrac{77.28}{1} \\
&= 77.28.
\end{array}$$

\question[23] Consider the following data representing the total number of votes for the office of President of the United States (in millions) for general elections from 1996 to 2012:\\
\begin{tabular}{lllll}
96.3 & 105.5 & 122.3 & 131.3 & 129.0
\end{tabular} 
\begin{parts}
\part[5] Find the range. \\
\textit{Solution:} Calculate
$$\mathrm{range}=\mathrm{max}-\mathrm{min}=131.3-96.3=35.0.$$

\part[6] Find the mean. \\
\textit{Solution:} Recall the sample mean of a sample of size $n$ is given by 
$$\overline{x} = \dfrac{\displaystyle\sum x}{n},$$
where $x$ represents our data points. Calculate the sample mean
$$\begin{array}{ll}
\overline{x} &= \dfrac{96.3+105.5+122.3+131.3+129.0}{5} \\
&= \dfrac{584.4}{5} \\
&=116.88.
\end{array}$$
\part[6] Find the sample variance. \\
\textit{Solution:} Recall that the sample variance of a sample of size $n$ is 
$$\mathrm{SampleVariance}=s^2=\dfrac{\displaystyle\sum (x-\overline{x})^2}{n-1},$$
where $x$ represents our data points and $\overline{x}$ denotes the sample mean. So we compute
$$\begin{array}{lll}
\lefteqn{\mathrm{SampleVariance}} \\
& &= \dfrac{(96.3-116.88)^2 + (105.5-116.88)^2+(122.3-116.88)^2+(131.3-116.88)^2+(129.0-116.88)^2}{5-1} \\
& &= \dfrac{(-20.58)^2 + (-11.38)^2 + (5.42)^2 + (14.42)^2+(12.12)^2}{4} \\
& &= \dfrac{423.5364 + 129.5044 + 29.3764 + 207.9364 + 146.8944}{4} \\
& &= \dfrac{937.248}{4} \\
& &= 234.312.
\end{array}$$

\part[6] Find the sample standard deviation. \\
\textit{Solution:} The sample standard deviation $s$ is given by 
$$s = \sqrt{\mathrm{SampleVariance}}.$$
We use our value from part $(c)$ and compute
$$\mathrm{SampleStandardDeviation}=\sqrt{\mathrm{SampleVariance}}=\sqrt{234.312}=15.307.$$
\end{parts}

%\question[1] Three histograms are shown. 
%\begin{parts}
%\part[1] Which has the largest standard deviation? Why?
%\part[1] Which has the lowest standard deviation? Why?
%\end{parts}

\question[12] 
\begin{parts} 
\part[6] The mean monthly utility bill for a sample of households in a city is $\$70$, with a standard deviation of $\$8$. Between what two values does about $95\%$ of the data lie? (Assume the data has a bell-shaped distribution) \\
\textit{Solution:} By the ``empirical rule", 95$\%$ of the data in a bell-shaped distribution lies within 2 standard deviations of the mean. That means the lower value is\\
$$\$70-2(\$ 8)=\$70-\$16=\$54,$$
and the upper value is
$$\$70 + 2(\$ 8) = \$ 70 + \$ 16 = \$ 86.$$
\part[6] You are conducting a survey on the number of people per household in your region. From a sample with $n=51$, the mean number of pets per household is $3$ pets and the standard deviation is $1$ pets. Using Chebychev's theorem, determine at least how many of the households have $1$ to $5$ pets. \\
\textit{Solution:} The value $1$ is two standard deivation from the mean (to the left) and the value $5$ is two standard deviations from the mean (to the right). This means we should apply Chebychev's theorem with $k=2$ to conclude that approximately
$$1 - \dfrac{1}{k^2} = 1-\dfrac{1}{4} = \dfrac{3}{4}=75\%$$
of the data lies between $1$ and $5$ pets. So the number of households with this many pets is $75\%$ of $51$, or
$$51(0.71)=38.25,$$
so $38$ or $39$ of the houses have between $1$ and $5$ pets.
\end{parts}

\question[21] Consider the data \\
\begin{tabular}{llllll}
51 & 54 & 55 & 56 & 57 \\
58 & 59 & 59 & 60 & 60 \\
61 & 62 & 63 & 63 & 70
\end{tabular}
\begin{parts}
\part[6] Find the quartiles $Q_1$, $Q_2$, and $Q_3$. \\
\textit{Solution:} The second quartile $Q_2$ is the median. Notice that the data is already ordered, and so the median will be the halfway point, which occurs at
$$Q_2=59.$$
Now $Q_1$ is the middle data point of the data to the left of $Q_2$ and has value
$$Q_1=56.$$
The third quartile $Q_3$ is the middle data point of the data to the right of $Q_2$ and has value
$$Q_3=62.$$ \\
\vfill
\part[5] Draw a box whisker plot for this data. \\
\textit{Solution:}\
 \begin{tikzpicture}
  \begin{axis}
    [
    ytick={1,2,3},
    yticklabels={},
    xtick={51,56,59,62,70},
    ]
    \addplot+[
    boxplot prepared={
      median=59,
      upper quartile=62,
      lower quartile=56,
      upper whisker=70,
      lower whisker=51
    },
    ] coordinates {};
  \end{axis}
\end{tikzpicture}

\part[5] Find the IQR. \\
\textit{Solution:} The $IQR$ is given by
$$IQR = Q_3-Q_1=62-56=6.$$
\part[5] Identify outliers. \\
\textit{Solution:} First compute
$$1.5IQR=9$$
 Outliers are data points that lie below
$$Q_1-1.5IQR = 56-9=47$$
or above
$$Q_3+1.5IQR=62+9=71.$$
No such data points exist, so this data set has no outliers.
\end{parts}

\question[5] The distribution of a set of data is approximately bell-shaped. The mean of the data is $18.7$ with a standard deviation of $3.2$. Find the $z$-score of the data point $x=19.3$.  \\
\textit{Solution:} We are told the mean $\mu=18.7$ and the standard deviation $\sigma=3.2$. The $z$ score is given by
$$\dfrac{x-\mu}{\sigma} = \dfrac{19.3-18.7}{3.2}=0.1875.$$
\question[17] A probability experiment is carried out by flipping two coins and then rolling a $4$-sided die.
\begin{parts}
\part[5] How many outcomes are in the sample space?  \\
\textit{Solution:} There are $16$: \\
\begin{tabular}{|l|l|l|}
\hline
First flip & Second flip & Die roll \\
\hline
H & H & 1 \\
H & H & 2 \\
H & H & 3 \\
H & H & 4 \\
H & T & 1 \\
H & T & 2 \\
H & T & 3 \\
H & T & 4 \\
T & H & 1 \\
T & H & 2 \\
T & H & 3 \\
T & H & 4 \\
T & T & 1 \\
T & T & 2 \\
T & T & 3 \\
T & T & 4 \\
\hline
\end{tabular}
\part[6] How many outcomes are in the event of flipping two heads and then rolling a $3$? What is the probability of this event? \\
\textit{Solution:} There is exactly one outcome in this event. Its probability is $\dfrac{1}{16}=0.0625$. 
\part[6] How many outcomes are in the event of the first coin flip being heads and rolling a number bigger than $2$? What is the probability of this event? \\
\textit{Solution:} There are four outcomes in this event, HH3, HT3, HH4, and HT4. The probability is $\dfrac{4}{16}=\dfrac{1}{4}=0.25.$
\end{parts}

\end{questions}

\end{document}
