{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Homework 2\n", "====\n", "#### CHE 116: Numerical Methods and Statistics\n", "\n", "1/24/2019\n", "\n", "----" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 1. Combinations and Permutation\n", "\n", "**For each problem, write out the number of objects ($n$), the length of the sequence/sample ($l$), if repeats are allowed, and if you are computing permutations or combinations. 1 point for this on each problem**\n", "\n", "1. [2 points] How many ways can you rearrange the letters in the word \"Python\"?\n", "2. [2 points] How many ways can you erarrange the letters in the word \"Coffee\"?\n", "3. [2 points] You have 5 close friends and are choosing which 3 friends will be in your wedding party. How many ways could you choose your friends that will be in your wedding party?\n", "4. [3 points] You now cannot decide either how many to be in your wedding party nor which friends to choose. Assuming you could have between 0 and 5 friends in the wedding party, how many ways could you choose them?\n", "5. [2 points] Quarks can have a \"color charge\" of red, blue, or green. If you have 5 distinguishable quarks, how many perumutations of charges could the quarks have?\n", "6. [2 points] Now the quarks are indistinguishable. How many combinations of quarks could you have?\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.1\n", "\n", "$n = 6,\\, l = 6$, no repeats, permutations\n", "\n", "$$\n", "6! = 720\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.2\n", "\n", "$n=6, l=6$, no repeats, permutations\n", "\n", "$$\n", "\\frac{6!}{2!\\times2!} = 180\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.3\n", "\n", "$n = 5, l = 3$, no repeats, combination\n", "\n", "$$\n", "\\frac{5!}{3!(5 - 3)!} = 10\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.4\n", "\n", "\n", "You can answer two ways. First you could imagine telling each of your frieds yes or no they're in the wedding. Then your choosing a sequence like so: YNYYN. You would view the problem as:\n", "\n", "$n = 2\\, l = 5$, repeats, permutations\n", "\n", "$$\n", "2^{5} = 32\n", "$$\n", "\n", "You can also use the rule from lecture about adding up combinations (section 1.3):\n", "\n", "$n = 5\\, l = 0,\\ldots 5$, no repats, combinations\n", "\n", "$$\n", "2^{5} = 32\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.5\n", "\n", "$n = 3, l = 5$, repeats, permutations\n", "\n", "$$\n", "3^5 = 243\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.6\n", "\n", "$n = 3, l = 5$, repeats, combinations\n", "\n", "$$\n", "\\frac{(3 + 5 - 1)!}{5!2!} = 21\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Stereo Chemistry\n", "\n", "1. [2 points] Consider an sp3 carbon atom. What elements could be bonded to carbon to satisfy its valencey? Only choose reasonable elements you would find in typical organic molecules. \n", "2. [6 points] With one sp3 carbon atom and the elements you've chosen, how many compounds are there? You can reuse your elements as many times as needed to satisfy the valency. What role does distinguishability play? Connect distinguishability with the conecpt of enantiomers." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.1\n", "\n", "H, F, Cl, Br, I," ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.2\n", "\n", "In sp3 carbon, it is tetrahedral. If there are at least two of the same elements, then you cannot distringuish between the arrangement of elements. If you have four different elements, then you have two enantiomers which you can distinguish between. We can first calculate the number of combinations and add in the extra enantiomers separately. \n", "\n", "We have $n=5$, $l=4$, are allowing repeats and want combinations. This is:\n", "\n", "$$\n", "\\frac{(5 + 4 - 1)!}{4!(5 - 1)!} = 70\n", "$$\n", "\n", "Now this has counted each enantiomer once, but we need to count the other enantiomer. So we want to know how many combinations have all unique elements. That correponds to leaving out one element. Thus there are 5 choices. We add now these 5 other enantiomers and get \n", "\n", "$$\n", "70 + 5 = 75\n", "$$\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Medical Diagnosis\n", "\n", "**You do not need to use conditional probability to solve this problem**\n", "\n", "We are evaluating a new test to screen for Ebola that claims to identify Ebola in patients before symptoms are present . We want to use this test to quarantine probable cases to prevent the spread of Ebola. People can either not have Ebola or have Ebola and our test can be positive or negative. Let's take the random variable $E$ to indicate if the patient has Ebola and $T$ to indicate if the test is positive. We had 100 patients in our study who were at risk for Ebola. Our test indicated that 74 of the patients had Ebola and were quarantined to see if symptomps presented. After one week when symtpoms presented, we determined that 2 patients were not caught by the test and 6 of the quarantined patients presented with Ebola consistent with your test. The remianing patients did not have Ebola. Is catching 6/8, 75% of the patients with Ebola, indicate the test is effective? Answering this by completing the questions below.\n", "\n", "1. [1 point] Write out the sample space\n", "\n", "2. [1 point] What is the marginal probability of having Ebola?\n", "\n", "3. [1 point] What is the marginal probability of having a positive test result?\n", "\n", "3. [2 points] Compute $P(E = 1, T = 1)$\n", "\n", "4. [3 points] What concept did we learn that could tell us whether or not the test is effective? How could we make a numeric argument?\n", "\n", "5. [3 points] Is there compelling numerical evidence that the test is effective?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.1\n", "\n", "$\\{ (E = 0, T = 0), (E = 0, T = 1), (E = 1, T = 0), (E = 1, T = 1)\\}$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.2\n", "\n", "$P(E = 1) = 8 / 100 = 0.08$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.3\n", "$\n", "P(T = 1) = 74 / 100 = 0.74\n", "$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.4\n", "\n", "This is given in the prolbem statement:\n", "\n", "$$\n", "P(E = 1, T = 1) = \\frac{6}{100} = 0.06\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.5\n", "\n", "If the outcome of the test and presence of Ebola are *independent* that means they are unrelated. That would mean the test is not measuring the presence of Ebola. One consequence of if the test is not measuring Ebola, and thus independent, is if:\n", "\n", "$$\n", "P(E = 1, T = 1) = P(E = 1) P(T = 1)\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.6\n", "\n", "We find that\n", "$$\n", "0.08 \\times 0.74 = 0.0592\n", "$$\n", "\n", "so that we would expect 6 patients to have Ebola if we randomly quarantined 74%. Thus the test is not effective. " ] } ], "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.6.4" } }, "nbformat": 4, "nbformat_minor": 2 }