{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### <center>San Jose State University<br>Department of Applied Data Science</center>\n",
    "#  <center>DATA 220<br>Mathematical Methods for Data Analysis</center>\n",
    "### <center>Spring 2021<br>Instructor: Ron Mak</center>\n",
    "#  <center>Assignment #5<br>Probability Problem Set</center>\n",
    "#### <center>100 points total (10 points each)<br><br>Work together with your lab partner.<br>Write your solutions in one or more cells after each problem.<br>You can compute by hand, but try use Python code and Python functions.<br>You can add your own functions or other support code.<br>For each problem: <strong>Please state what distribution or principle you used.</strong><br>Always show your work.</center>\n",
    "#### <center>Due March 4, 2020 at 5:30 PM</center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### <strong>PROBLEM 1.</strong> Suppose San Jose State University accepts 75% of all applicants. What is the probability that it will accept exactly three of the next six applicants?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>\n",
    "\n",
    "#### <strong>PROBLEM 2.</strong> In DATA 220, if the probability is 0.20 that any one student will get an A, what is the probability that in a random sample of eight students in the class, exactly three of them will get A's?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>\n",
    "\n",
    "#### <strong>PROBLEM 3.</strong> You get an average rate of two visits per minute at your website. What is the probability that you will have at least one visit during a given minute?\n",
    "\n",
    "#### First solve this problem using the appropriate Python functions. Then verify your answer by writing a short program that incrementally computes the probability of up to 1 customer, up to 2 customers, ..., up to 12 customers."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>\n",
    "\n",
    "#### <strong>PROBLEM 4.</strong> An average of 3.6 students complain about each of Prof. Mak's midterms. What is the probability that no more than three students will complain about his next midterm?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>\n",
    "\n",
    "#### <strong>PROBLEM 5.</strong> A telephone political poll produced the following results regarding a proposed new law:\n",
    "<table>\n",
    "    <tr>\n",
    "        <th>Party</th>\n",
    "        <th>In favor</th>\n",
    "        <th>Not in favor</th>\n",
    "        <th>Total</th>\n",
    "    </tr>\n",
    "    <tr>\n",
    "        <td>Republican</td><td>98</td><td>54</td><td>152</td>\n",
    "    </tr>\n",
    "    <tr>\n",
    "        <td>Democrat</td><td>79</td><td>29</td><td>108</td>\n",
    "    </tr>\n",
    "    <tr>\n",
    "        <td>Total</td><td>177</td><td>83</td><td>260</td>\n",
    "    </tr>\n",
    "</table>\n",
    "\n",
    "#### What is the probability that a person on the phone favors the new law given that the person is a Democrat?\n",
    "\n",
    "#### First solve this problem by simple table inspection. Then verify your anwser by solving it using conditional probabilities."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>\n",
    "\n",
    "#### <strong>PROBLEM 6.</strong> Based on the above poll results, what is the probability that a person on the phone was a Republican, given that the person favors the new law?\n",
    "\n",
    "#### First solve this problem by simple table inspection. Then verify your anwser by solving it using conditional probabilities."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>\n",
    "\n",
    "#### <strong>PROBLEM 7.</strong> A student randomly guesses at a 12-question multiple-choice exam where each question has five choices. What is the probability that the student will correctly answer exactly six questions?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>\n",
    "\n",
    "#### <strong>PROBLEM 8.</strong> 20% of the employees of a company are college graduates. Of the college graduates, 75% are managers. Of the non-college graduates, 20% are managers. What is the probability that a randomly selected manager is a college graduate?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>\n",
    "\n",
    "#### <strong>PROBLEM 9.</strong> You receive an average of 4.2 email messages per hour. What is the probability that you will receive more than two emails in the next hour?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>\n",
    "\n",
    "#### <strong>PROBLEM 10.</strong> Alice, Bill, and Carol toss a fair coin but you don't see them do it. Then Alice reports to you that the coin came up heads, but Bill and Carol claim that it was tails. Alice tells the truth 4/5 of the time, Bill 3/5 of the time, and Carol 5/7 of the time. What is the probability that it was indeed heads?"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
