LUNAR
π
Dashboard
Browse
SW12_Auftrag_EN
JUPYTER
View Source
{"cells":[{"cell_type":"markdown","id":"zI2VmiFGHQr1","metadata":{"id":"zI2VmiFGHQr1"},"source":["# Self-Study Tasks SW12 - PYTHON BASICS\n","\n","These are the self-study tasks of the semester week, which you will solve within one week in your JupyterHub environment. After completing your work, download a copy of the Jupyter notebook file locally to your laptop (Menu: File->Download).\n","\n","On ILIAS you will find the weekly scheduled assignment where you will upload your solved Jupyter notebook file. After your submission, you will receive a corresponding sample solution to the assignment. Your submission will not be corrected. Although the assignments are marked βmandatoryβ, they do not count towards your semester grades. Only the grades of the tests during the semester are relevant for this.\n","\n","We wish you every success!\n","\n","***\n","***"]},{"cell_type":"markdown","id":"iZeVh2l_XOzT","metadata":{"id":"iZeVh2l_XOzT"},"source":["# Problems on combinatorics and binomial distribution\n","## Problem 1\n","\n","1. There are three red and two blue balls in a basket. What is the probability that two red balls will be drawn **exactly** in four blind draws **with** putting back?\n","\n","2. There are three red and two blue balls in a basket. What is the probability that **at least** two red balls will be drawn in four blind draws **with** putting back?\n","\n","3. There are three red and two blue balls in a basket. What is the probability that two red balls will be drawn **exactly** in four blind draws **without** putting back?\n","\n","4. There are three red and two blue balls in a basket. What is the probability that **at least** two red balls will be drawn in four blind draws **without** putting back?"]},{"cell_type":"markdown","id":"b5b2fec7","metadata":{"id":"b5b2fec7"},"source":["## Problem 2\n","In a money game, you have drawn the following hand from a poker card deck (with 52 cards):\n","* Pik Ass\n","* Pik 2\n","* Karo Ass\n","* Karo Dame\n","* Karo 2\n","\n","You now have the option of discarding any number of cards and drawing new ones face down from the remaining 47 cards. The following winnings are possible:\n","* one pair: 2 Fr.\n","* two pairs: 5 Fr.\n","* three of a kind: 20 Fr.\n","* Full House: 50 Fr.\n","* four of a kind: 100 Fr.\n","\n","How many cards should ideally be exchanged?"]},{"cell_type":"code","execution_count":null,"id":"iF2Jta18vZWS","metadata":{"id":"iF2Jta18vZWS"},"outputs":[],"source":["g_ein_Paar = 2\n","g_zwei_Paare = 5\n","g_Drilling = 20\n","g_Full_House = 50\n","g_Vierling = 100"]},{"cell_type":"markdown","id":"AFwNk66iVsbG","metadata":{"id":"AFwNk66iVsbG"},"source":["# Problem on conditional WSK and Bayes' theorem\n","\n","A certain disease has a prevalence of 1% among the population. A blood test for this disease has a reliability of 95%: In sick people, the test is positive with a WSK of 0.95. On the other hand, the test also has a false positive rate of 5%. We define the following events:\n","* $A$: the person has the disease\n","* $B$: the test is positive\n","\n","We therefore know the following probabilities:\n","* $P(A)=0.01$\n","* $P(B\\ |\\ A)=0.95$\n","* $P(B\\ |\\ \\bar{A})=0.05$\n","\n","A randomly selected person from the population is routinely tested and the test is positive. What is the probability that this person has the disease?"]}],"metadata":{"colab":{"provenance":[]},"kernelspec":{"display_name":"Python 3 (ipykernel)","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.9.5"}},"nbformat":4,"nbformat_minor":5}