SHARE
TWEET

Untitled

a guest Oct 21st, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.  "cells": [
  3.   {
  4.    "cell_type": "markdown",
  5.    "metadata": {},
  6.    "source": [
  7.     "Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\\rightarrow$Run All).\n",
  8.     "\n",
  9.     "Make sure you fill in any place that says `YOUR CODE HERE` or \"YOUR ANSWER HERE\", as well as your name and collaborators below:"
  10.    ]
  11.   },
  12.   {
  13.    "cell_type": "code",
  14.    "execution_count": null,
  15.    "metadata": {},
  16.    "outputs": [],
  17.    "source": [
  18.     "NAME = \"Carlos Rafael Garduño Acolt\"\n",
  19.     "COLLABORATORS = \"\""
  20.    ]
  21.   },
  22.   {
  23.    "cell_type": "markdown",
  24.    "metadata": {},
  25.    "source": [
  26.     "---"
  27.    ]
  28.   },
  29.   {
  30.    "cell_type": "markdown",
  31.    "metadata": {
  32.     "deletable": false,
  33.     "editable": false,
  34.     "nbgrader": {
  35.      "checksum": "fe57a13a2ba710371e280641c9f21c35",
  36.      "grade": false,
  37.      "grade_id": "cell-90b6f68e307cf4d7",
  38.      "locked": true,
  39.      "schema_version": 1,
  40.      "solution": false
  41.     }
  42.    },
  43.    "source": [
  44.     "# CS110 Pre-class Work 4.2\n",
  45.     "\n",
  46.     "## Part A. The Hire-Assistant Problem.\n",
  47.     "\n",
  48.     "Imagine that you need to hire a new assistant. Every day an agency sends a new assistant for you to interview. If the assistant is better than your current assistant, then you fire your current assistant and you hire the better assistant. You may assume that assistant quality is uniformly distributed between 0 and 1.\n",
  49.     "\n",
  50.     "## Question 1.\n",
  51.     "Write a function, named hire_assistant, that takes applicants (a list of the numbers that represent the level of qualification of the applicants; the higher the number, the better qualified), and returns the number hires if the applicants are presented in the exact same order as the input list applicants. Note that your function should not randomize anything (or else it would be called a randomized algorithm)."
  52.    ]
  53.   },
  54.   {
  55.    "cell_type": "code",
  56.    "execution_count": 16,
  57.    "metadata": {
  58.     "deletable": false,
  59.     "nbgrader": {
  60.      "checksum": "3e823066b88c3701b5aa6feb0b29ea00",
  61.      "grade": false,
  62.      "grade_id": "cell-d011f5f4707fe41a",
  63.      "locked": false,
  64.      "schema_version": 1,
  65.      "solution": true
  66.     }
  67.    },
  68.    "outputs": [],
  69.    "source": [
  70.     "def hire_assistant(applicants):\n",
  71.     "    \"\"\"\n",
  72.     "    Return the number of assistant hired.\n",
  73.     "    Inputs:\n",
  74.     "    - applicants: a list of the numbers that represent the level of qualification of \n",
  75.     "    the applicants; the higher the number, the better qualified\n",
  76.     "    \n",
  77.     "    Outputs:\n",
  78.     "    - hires: Number of assistants hired\n",
  79.     "    \"\"\"\n",
  80.     "    hires = 0 #Starts counter for number of total hired assistants\n",
  81.     "    current = float('-inf') #Sets initial value of current assistant to -oo\n",
  82.     "    \n",
  83.     "    for i in applicants: #for-loop that will iterate over each applicant in the array\n",
  84.     "        \n",
  85.     "        if i > current: #Conditional, compares the qualification of the new applicant to the current assistant's\n",
  86.     "                        #and if the applicant's is better, then:\n",
  87.     "            current = i  #Hires new assistant\n",
  88.     "            hires +=1 #Adds one to the counter\n",
  89.     "    \n",
  90.     "    return hires #reurns number of total hired assistants\n",
  91.     "    \n",
  92.     "    raise NotImplementedError()"
  93.    ]
  94.   },
  95.   {
  96.    "cell_type": "code",
  97.    "execution_count": 15,
  98.    "metadata": {
  99.     "deletable": false,
  100.     "editable": false,
  101.     "nbgrader": {
  102.      "checksum": "1cf91a3b99ed87bfe9ea81d9a9252e16",
  103.      "grade": true,
  104.      "grade_id": "cell-66778b97ad66f71e",
  105.      "locked": true,
  106.      "points": 1,
  107.      "schema_version": 1,
  108.      "solution": false
  109.     }
  110.    },
  111.    "outputs": [],
  112.    "source": [
  113.     "assert(hire_assistant([1])==1)\n",
  114.     "assert(hire_assistant([-1, -2, -3, -4])==1)"
  115.    ]
  116.   },
  117.   {
  118.    "cell_type": "markdown",
  119.    "metadata": {
  120.     "deletable": false,
  121.     "editable": false,
  122.     "nbgrader": {
  123.      "checksum": "950e8b4c047988bb6493460be72d1bc7",
  124.      "grade": false,
  125.      "grade_id": "cell-e5d810828093b20d",
  126.      "locked": true,
  127.      "schema_version": 1,
  128.      "solution": false
  129.     }
  130.    },
  131.    "source": [
  132.     "## Question 2. \n",
  133.     "Assuming the applicants are presented in a random order, write a function that receives the number of applicants as input and returns the average number of assistants hired.\n",
  134.     "\n",
  135.     "**N.B.:** Don’t forget to run the simulation several times for each given number of applicants to better estimate the number of hires (please refer to task 3 of the Study Guide)."
  136.    ]
  137.   },
  138.   {
  139.    "cell_type": "code",
  140.    "execution_count": 283,
  141.    "metadata": {
  142.     "deletable": false,
  143.     "nbgrader": {
  144.      "checksum": "7038d9d8cc9239d5ca15f5d21aa986e3",
  145.      "grade": true,
  146.      "grade_id": "cell-b223520ca72942a0",
  147.      "locked": false,
  148.      "points": 0,
  149.      "schema_version": 1,
  150.      "solution": true
  151.     }
  152.    },
  153.    "outputs": [],
  154.    "source": [
  155.     "import random\n",
  156.     "import statistics as stats\n",
  157.     "\n",
  158.     "def experimental_hires(N):\n",
  159.     "    \n",
  160.     "    tot_hires = [] #Creates new list that will keep results of all experiments\n",
  161.     "    for i in range(1000): #Runs the simulation many times\n",
  162.     "        \n",
  163.     "        hires = 0 #Starts counter for number of total hired assistants\n",
  164.     "        current = float('-inf') #Sets initial value of current assistant to -oo\n",
  165.     "\n",
  166.     "        for i in range(N): #for-loop that will iterate over each applicant in the array\n",
  167.     "            new = random.uniform(0, 1) #Creates new applicant with random qualification in [0,1]\n",
  168.     "\n",
  169.     "            if new > current: #Conditional, compares the qualification of the new applicant to the current assistant's\n",
  170.     "                            #and if the applicant's is better, then:\n",
  171.     "                current = new  #Hires new assistant\n",
  172.     "                hires +=1 #Adds one to the counter\n",
  173.     "        tot_hires.append(hires) #Adds total hires of single experiment to list of results of all experiments\n",
  174.     "\n",
  175.     "    #print(tot_hires) #just for the fun of seeing so many numbers ;)\n",
  176.     "    return stats.mean(tot_hires) #reurns number of total hired assistants\n",
  177.     "\n",
  178.     "            \n",
  179.     "    \n",
  180.     "    raise NotImplementedError()"
  181.    ]
  182.   },
  183.   {
  184.    "cell_type": "code",
  185.    "execution_count": 284,
  186.    "metadata": {},
  187.    "outputs": [
  188.     {
  189.      "data": {
  190.       "text/plain": [
  191.        "2.924"
  192.       ]
  193.      },
  194.      "execution_count": 284,
  195.      "metadata": {},
  196.      "output_type": "execute_result"
  197.     }
  198.    ],
  199.    "source": [
  200.     "experimental_hires(10)"
  201.    ]
  202.   },
  203.   {
  204.    "cell_type": "markdown",
  205.    "metadata": {
  206.     "deletable": false,
  207.     "editable": false,
  208.     "nbgrader": {
  209.      "checksum": "7f78b31a96cb5ddc8eb534ab037d9fee",
  210.      "grade": false,
  211.      "grade_id": "cell-a55a7b3d12ef78bb",
  212.      "locked": true,
  213.      "schema_version": 1,
  214.      "solution": false
  215.     }
  216.    },
  217.    "source": [
  218.     "## Question 3.\n",
  219.     "\n",
  220.     "Use the function below, `analytical_hires(N)`, which returns the analytical expected number of hires, given the number of applicants, along with the function you created in question 2 to create a graph with two curves such that:\n",
  221.     "* The x-axis shows the total number of applicants (make sure label the x-axis)\n",
  222.     "* The y-axis shows the average number of hires (make sure label the y-axis)\n",
  223.     "* The graph contains two curves;\n",
  224.     "    * Curve 1: the theoretical performance estimates computed calls to the function `analytical_hires`.\n",
  225.     "    * Curve 2: the simulated or experimental estimates using the function you created in question 2.\n"
  226.    ]
  227.   },
  228.   {
  229.    "cell_type": "code",
  230.    "execution_count": 285,
  231.    "metadata": {
  232.     "deletable": false,
  233.     "editable": false,
  234.     "nbgrader": {
  235.      "checksum": "1e514458253b863a6c69ce09ccd2d9de",
  236.      "grade": false,
  237.      "grade_id": "cell-4092502cb05933d4",
  238.      "locked": true,
  239.      "schema_version": 1,
  240.      "solution": false
  241.     }
  242.    },
  243.    "outputs": [],
  244.    "source": [
  245.     "def analytical_hires(N):\n",
  246.     "    \"\"\"\n",
  247.     "    Return the analytical expected number of hires if there are N applicants\n",
  248.     "    Inputs:\n",
  249.     "    - N: Number of applicants\n",
  250.     "    Outputs:\n",
  251.     "    - hires: Average number of assistants hired\n",
  252.     "    \"\"\"\n",
  253.     "    # from the textbook, we know that the analytical result is \n",
  254.     "    # 1 + 1/2 + 1/3 + ... + 1/N\n",
  255.     "    hires = 0\n",
  256.     "    for n in range(N):\n",
  257.     "        hires += 1/(n+1)\n",
  258.     "    return hires"
  259.    ]
  260.   },
  261.   {
  262.    "cell_type": "code",
  263.    "execution_count": 286,
  264.    "metadata": {},
  265.    "outputs": [
  266.     {
  267.      "data": {
  268.       "text/plain": [
  269.        "2.9289682539682538"
  270.       ]
  271.      },
  272.      "execution_count": 286,
  273.      "metadata": {},
  274.      "output_type": "execute_result"
  275.     }
  276.    ],
  277.    "source": [
  278.     "analytical_hires(10)"
  279.    ]
  280.   },
  281.   {
  282.    "cell_type": "code",
  283.    "execution_count": 295,
  284.    "metadata": {
  285.     "deletable": false,
  286.     "nbgrader": {
  287.      "checksum": "055b3a48707a83f9330ab3b00c45144a",
  288.      "grade": true,
  289.      "grade_id": "cell-f9c07920c069ce20",
  290.      "locked": false,
  291.      "points": 0,
  292.      "schema_version": 1,
  293.      "solution": true
  294.     }
  295.    },
  296.    "outputs": [],
  297.    "source": [
  298.     "import matplotlib.pyplot as plt\n",
  299.     "def ana_vs_exp(N):\n",
  300.     "    \n",
  301.     "    \n",
  302.     "    analytical = [] #Creates list for analytical results\n",
  303.     "    experimental = [] #Creates list for experimental results\n",
  304.     "    \n",
  305.     "    \n",
  306.     "    for i in range(N+1): #Iterates once per different number of applicants\n",
  307.     "        \n",
  308.     "        analytical.append(analytical_hires(i)) #adds result to list\n",
  309.     "        experimental.append(experimental_hires(i)) #adds result to list\n",
  310.     "        \n",
  311.     "    \n",
  312.     "    plt.plot(analytical, color= 'blue') #plots results\n",
  313.     "    plt.plot(experimental, color = 'red')\n",
  314.     "    plt.xlabel('Number of Applicants')\n",
  315.     "    plt.ylabel('Average number of hires')\n",
  316.     "    plt.grid(True)\n",
  317.     "    plt.axis([0, N+1, 0, 4])\n",
  318.     "     \n"
  319.    ]
  320.   },
  321.   {
  322.    "cell_type": "code",
  323.    "execution_count": 296,
  324.    "metadata": {},
  325.    "outputs": [
  326.     {
  327.      "data": {
  328.       "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xd8FHX+x/HXJ4VQQhNCR5ASUKqCiIJAEFGwYEGEszdURNE7/VnOs52nIno2FD2VU1GRKJ5ygIVDioB0kI506Z1AAoGUz++PmcQ1pixsZmcTPs/HYx/ZnfnOzDvLsp9M+35FVTHGGGMAovwOYIwxJnJYUTDGGJPLioIxxphcVhSMMcbksqJgjDEmlxUFY4wxuTwvCiISLSKLRGR8PvPiRGSMiKwVkTki0tDrPMYYYwoWjj2FIcDKAubdBuxX1SbAK8DQMOQxxhhTAE+LgojUAy4B3iugSR/gQ/f5F8AFIiJeZjLGGFOwGI/X/yrwf0DFAubXBTYDqGqmiKQA1YA9gY1EZCAwEKBs2bLtTj31VM8Chyo7O5uoqMg9VWP5QhPJ+SI5G1i+UIWa75dfftmjqglFNlRVTx7ApcBb7vNuwPh82iwH6gW8XgdUK2y9iYmJGsmmTJnid4RCWb7QRHK+SM6mavlCFWo+YL4G8d3tZVnsBFwuIhuBz4DuIvJxnjZbgPoAIhIDVAb2eZjJGGNMITwrCqr6qKrWU9WGQH/gB1W9Pk+zccBN7vO+bhvroc8YY3zi9TmFPxCRZ3B2Y8YB7wOjRGQtzh5C/3DnMcYY85uwFAVVnQpMdZ8/ETA9HbgmHBmMMcYULXJPtR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fDRqCGO/1mnDtsqwHlcLpOaA80xLmztZPbbiTumASB23HXVR1oAazG7e+f3+54rcpv46/fDrzsPn8KmOX+3tVx7iiPdbcbOBbCX/jtLvhooKLfnxV7hO9hewrGV+r0BvkRcF9RbQPMU6cP+qM43SN8705fivMFlyNZVbPV6RZ5PdAcp2+YG8UZaWsOzhdzU7f9XFXdkM/2zgamqupudbpp/wRn4Jai9Ac+U6dTuC+BawLmTVLVvap6xJ3X2Z2+WVVnus8/Dpien+7AF6q6B0BVczqErAd8JyJLgYdwikeOCap61F1mF1Azn/XOA25xz++0UqePf3OSsKJgIsGrOMfmKwRMy8T9fLodhpUJmHc04Hl2wOtsnL/kc+Ttw0Vx+ny6V1Xbuo/TVDWnqKQVkO+4B28SkdY4xWaSiGzEKRADAprkl62w6QXlym/+G8BwVW0F3Imzh5Qj8L3L4vfvl7NBZ1CaLjh7YaNE5MZCMphSxoqC8Z37F24yTmHIsRFo5z7vg3OY43hdIyJR7rH9RjiHWr4D7hanq2JEJNHtAbMwc4CuIlLdPQk9AJhWxDIDcA6FNXQfdYC6ItLAnX+hOGPwlsMZUStn7+BUETk3YB0zCtnGZKCfiFRzf5dT3OmVcb7Q4bdeNgtzCGcYSNz1NAB2qeq7OL13hm38buM/KwomUryMc5w7x7s4X8RzgXMo+K/4wqzG+fL+Bqc3zHTgPWAFsFCcgdzfIZ+/lgOp06X4o8AUnB4zF6pqft0YB+qP0/9+oP+408H5sh+F0yPmWFXNGRR+JXCTiCzBGXd3RCG5lgP/AKaJyM9ATrfLTwGfi8iPwJ4icqKqe4GZ7knlYTjnVxaLyCLgauC1otZhSg/rJdWYMBORm3FOGg/OM70hMF5VW/oQyxjA9hSMMcYEsD0FY4wxuWxPwRhjTC4rCsYYY3JZUTDGGJPLioIxxphcVhSMMcbk+n/XF7WvjSNGOwAAAABJRU5ErkJggg==\n",
  329.       "text/plain": [
  330.        "<Figure size 432x288 with 1 Axes>"
  331.       ]
  332.      },
  333.      "metadata": {
  334.       "needs_background": "light"
  335.      },
  336.      "output_type": "display_data"
  337.     }
  338.    ],
  339.    "source": [
  340.     "ana_vs_exp(20)"
  341.    ]
  342.   },
  343.   {
  344.    "cell_type": "markdown",
  345.    "metadata": {
  346.     "deletable": false,
  347.     "editable": false,
  348.     "nbgrader": {
  349.      "checksum": "f5c0fc54ac7e38140eacf7a0d3877a00",
  350.      "grade": false,
  351.      "grade_id": "cell-8720f8d8a6a98422",
  352.      "locked": true,
  353.      "schema_version": 1,
  354.      "solution": false
  355.     }
  356.    },
  357.    "source": [
  358.     "## Question 4.\n",
  359.     "\n",
  360.     "Plot a graph with the x-axis showing the total number of applicants and the y-axis showing the probability that exactly one assistant is hired."
  361.    ]
  362.   },
  363.   {
  364.    "cell_type": "code",
  365.    "execution_count": 383,
  366.    "metadata": {
  367.     "deletable": false,
  368.     "nbgrader": {
  369.      "checksum": "99500575978918dad34be4dfe49fff36",
  370.      "grade": true,
  371.      "grade_id": "cell-d3fe1b7d6d175ad7",
  372.      "locked": false,
  373.      "points": 0,
  374.      "schema_version": 1,
  375.      "solution": true
  376.     }
  377.    },
  378.    "outputs": [],
  379.    "source": [
  380.     "def experimental_hires_one(N):\n",
  381.     "    \n",
  382.     "    tot_hires = [] #Creates new list that will keep results of all experiments\n",
  383.     "    for i in range(10000): #Runs the simulation many times\n",
  384.     "        \n",
  385.     "        hires = 0 #Starts counter for number of total hired assistants\n",
  386.     "        current = float('-inf') #Sets initial value of current assistant to -oo\n",
  387.     "\n",
  388.     "        for i in range(N): #for-loop that will iterate over each applicant in the array\n",
  389.     "            new = random.uniform(0, 1) #Creates new applicant with random qualification in [0,1]\n",
  390.     "\n",
  391.     "            if new > current: #Conditional, compares the qualification of the new applicant to the current assistant's\n",
  392.     "                            #and if the applicant's is better, then:\n",
  393.     "                current = new  #Hires new assistant\n",
  394.     "                hires +=1 #Adds one to the counter\n",
  395.     "        tot_hires.append(hires) #Adds total hires of single experiment to list of results of all experiments\n",
  396.     "        \n",
  397.     "    return tot_hires.count(1)/10000 #calculates probability of the event happening by dividing the number of times\n",
  398.     "                                    #the program only hires 1 assistant after running the test 10000, by total number\n",
  399.     "                                    #times the experiment was ran\n",
  400.     "\n",
  401.     "def one_assist(N):\n",
  402.     "    results = [] #creates new list to add results\n",
  403.     "    num = list(range(1, N+1)) #Creates list of integers for plot\n",
  404.     "    for i in range(1,N+1): #Iterates once per element in range\n",
  405.     "        results.append(experimental_hires_one(i))#Calculates probability of hiring only one assistant given N applicants\n",
  406.     "                                #and then adds that number to results list\n",
  407.     "        print(i, experimental_hires_one(i)) \n",
  408.     "            \n",
  409.     "    plt.plot(num, results, color =\"red\")\n",
  410.     "    plt.xlabel('Number of Applicants')\n",
  411.     "    plt.ylabel('Probability of exactly one assistant being hired')\n",
  412.     "    plt.axis([1, N, 0, 1])\n",
  413.     "    plt.grid(True)\n",
  414.     "        \n",
  415.     "    "
  416.    ]
  417.   },
  418.   {
  419.    "cell_type": "code",
  420.    "execution_count": 384,
  421.    "metadata": {},
  422.    "outputs": [
  423.     {
  424.      "name": "stdout",
  425.      "output_type": "stream",
  426.      "text": [
  427.       "1 1.0\n",
  428.       "2 0.5101\n",
  429.       "3 0.3412\n",
  430.       "4 0.2491\n",
  431.       "5 0.2021\n",
  432.       "6 0.1642\n",
  433.       "7 0.1409\n",
  434.       "8 0.1264\n",
  435.       "9 0.1073\n",
  436.       "10 0.0963\n",
  437.       "11 0.0897\n",
  438.       "12 0.0794\n"
  439.      ]
  440.     },
  441.     {
  442.      "data": {
  443.       "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEPCAYAAABY9lNGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xm8XfO9//HXO3NCIokhCJIgQSglMcaQkDoHLWpo6dWWanWgdNCLS1HaW61b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G0mcqxGBdnBOEFSr7l+8NpCRR8gIwJvt+EOlRSGsdLqlb1hewKelxzF3Al7Py7UgapZYnBfobsJekdbIO7COB+1o450jS47Lh2bIhMFTSsGz/R5TmRO5Lmsms1GrYRMvnwT4SeKDCb9wDfELS2tm9DM62r0X64w7Lq5VW8g6pgBvZdYaR5gK5jFTFuKuXPLcKnCCsI/gR6bl4yWWkP8p/B3am+X/dV/I06Q/5HcCXImIhafrUGcAjSpO5X0IT/4ouF2m2sdOAKcBjwCMR0VJp6COA3zXa9juWz/f8AHAN8ChwU0RMy7bPBD6bVZMdDFxcIa4nge8B90l6DCiVoj8b+K2kPwOvtxAnEfEG8JesQ/p8Un/Mo5L+ARxKmqfbapSruZq1I0lHkzqcT2i0fTjwh4jYpoCwzJrkFoSZmTXJLQgzM2uSWxBmZtYkJwgzM2uSE4SZmTXJCcLMzJrkBGFmZk1ygjAzsyb9f7dEg9b7qFD7AAAAAElFTkSuQmCC\n",
  444.       "text/plain": [
  445.        "<Figure size 432x288 with 1 Axes>"
  446.       ]
  447.      },
  448.      "metadata": {
  449.       "needs_background": "light"
  450.      },
  451.      "output_type": "display_data"
  452.     }
  453.    ],
  454.    "source": [
  455.     "one_assist(12)"
  456.    ]
  457.   },
  458.   {
  459.    "cell_type": "markdown",
  460.    "metadata": {
  461.     "deletable": false,
  462.     "editable": false,
  463.     "nbgrader": {
  464.      "checksum": "998ef0b673bc47c929e5543e6f86ccb2",
  465.      "grade": false,
  466.      "grade_id": "cell-2bd2500c3ca4cf02",
  467.      "locked": true,
  468.      "schema_version": 1,
  469.      "solution": false
  470.     }
  471.    },
  472.    "source": [
  473.     "## [Optional] Question 5.\n",
  474.     "Assume that an assistant is able to perform an amount of work each day that is equal to their “quality”. You have a total amount of work M that needs to be accomplished. Your costs are as follows:\n",
  475.     "* X = daily salary for the assistant,\n",
  476.     "* Y = fee to the employment agency,\n",
  477.     "* Z = retrenchment fee for the old assistant.\n",
  478.     "\n",
  479.     "Try to formulate an optimal stopping rule (ie. at what point should one stop requesting new potential hires from the agency?) Make any necessary assumptions to ensure the problem is well-formulated.\n"
  480.    ]
  481.   },
  482.   {
  483.    "cell_type": "code",
  484.    "execution_count": null,
  485.    "metadata": {
  486.     "deletable": false,
  487.     "nbgrader": {
  488.      "checksum": "43b6a51878665a39b0ede1313448eaa6",
  489.      "grade": true,
  490.      "grade_id": "cell-af2f0291eced6982",
  491.      "locked": false,
  492.      "points": 0,
  493.      "schema_version": 1,
  494.      "solution": true
  495.     }
  496.    },
  497.    "outputs": [],
  498.    "source": [
  499.     "# YOUR CODE HERE\n",
  500.     "raise NotImplementedError()"
  501.    ]
  502.   },
  503.   {
  504.    "cell_type": "markdown",
  505.    "metadata": {
  506.     "deletable": false,
  507.     "editable": false,
  508.     "nbgrader": {
  509.      "checksum": "b0c67a7805b6596f1ba87521c45df302",
  510.      "grade": false,
  511.      "grade_id": "cell-92211f5b42929c46",
  512.      "locked": true,
  513.      "schema_version": 1,
  514.      "solution": false
  515.     }
  516.    },
  517.    "source": [
  518.     "## Part B. The Hat Check Problem.\n",
  519.     "\n",
  520.     "There is a coat check at a party, where an attendant stores everyone’s hat while they attend the party. The attendant receives the N hats from everyone attending (all attendees come with a hat). Unfortunately, the coat check attendant forgets which hat belongs to whom. Rather than admitting a mistake, the attendant simply returns random hats back to the party goers. \n",
  521.     "What is the average number of correct hats returned? Here are some guiding questions to help you to simulate this problem. \n",
  522.     "\n",
  523.     "## Question 1. \n",
  524.     "Knowing that everyone’s hats are unique and every guest has a hat. Do you need to generate a random sample in a similar way as what you did for the hiring assistant problem? "
  525.    ]
  526.   },
  527.   {
  528.    "cell_type": "markdown",
  529.    "metadata": {
  530.     "deletable": false,
  531.     "nbgrader": {
  532.      "checksum": "259c6115bee56676178f28ab36d6db2f",
  533.      "grade": true,
  534.      "grade_id": "cell-e786799fc4eb1499",
  535.      "locked": false,
  536.      "points": 0,
  537.      "schema_version": 1,
  538.      "solution": true
  539.     }
  540.    },
  541.    "source": [
  542.     ">It could be. However we have to be really careful here, generating random numbers as different hats could lead to many guests having the same hat (as the same number can be randomly generated and added to the list more than once. As long as we have a different numbers that represents each relationship hat-person we are fine."
  543.    ]
  544.   },
  545.   {
  546.    "cell_type": "markdown",
  547.    "metadata": {
  548.     "deletable": false,
  549.     "editable": false,
  550.     "nbgrader": {
  551.      "checksum": "c9f8182f3dd59f572cb797f373fb7464",
  552.      "grade": false,
  553.      "grade_id": "cell-e2f68e2bd4c2d099",
  554.      "locked": true,
  555.      "schema_version": 1,
  556.      "solution": false
  557.     }
  558.    },
  559.    "source": [
  560.     "## Question 2. \n",
  561.     "Which of the following commands do you think is the Pythonic way to implement that? \n",
  562.     "```\n",
  563.     "import numpy as np\n",
  564.     "n = 100 #the number of party attendants `\n",
  565.     "```\n",
  566.     "**Command 1. **\n",
  567.     "```\n",
  568.     "hat_list = [np.random.integers(0,n) for i in range(n)]`\n",
  569.     "```\n",
  570.     "**Command 2.**\n",
  571.     "```\n",
  572.     "hat_list = list(range(n)) \n",
  573.     "np.random.shuffle(hat_list) \n",
  574.     "```\n",
  575.     "**Command 3.**\n",
  576.     "```\n",
  577.     "hat_list = np.random.sample(n)\n",
  578.     "```"
  579.    ]
  580.   },
  581.   {
  582.    "cell_type": "markdown",
  583.    "metadata": {
  584.     "deletable": false,
  585.     "nbgrader": {
  586.      "checksum": "b5e83025692b2772640e9e58f0f36af1",
  587.      "grade": true,
  588.      "grade_id": "cell-b8da78e72c1c0738",
  589.      "locked": false,
  590.      "points": 0,
  591.      "schema_version": 1,
  592.      "solution": true
  593.     }
  594.    },
  595.    "source": [
  596.     ">I would go with command 2, as it is a great way to make sure we have all different numbers and they are not in any particular number. \n",
  597.     "\n",
  598.     ">Furthermore, command 1 and 3 could have repeated elements. Command 1 is not a valid way of creating a for-loop, and I doubt that np.random.integers exists, but if otherwise, it would create way more elements than we need (a new list of n elements per guest = each guest brings n hats)."
  599.    ]
  600.   },
  601.   {
  602.    "cell_type": "markdown",
  603.    "metadata": {
  604.     "deletable": false,
  605.     "editable": false,
  606.     "nbgrader": {
  607.      "checksum": "ec25d5c32cc709928fa50666f21d9808",
  608.      "grade": false,
  609.      "grade_id": "cell-8915979a0b8cf6ce",
  610.      "locked": true,
  611.      "schema_version": 1,
  612.      "solution": false
  613.     }
  614.    },
  615.    "source": [
  616.     "## Question 3.\n",
  617.     "Now write a function `hat_check(N)` that has: \n",
  618.     "* Input: N the number of party attendants. \n",
  619.     "* Output: the number of hats correctly returned despite the fact that hats are randomly handed back to the guests.\n",
  620.     "\n",
  621.     "You should use the command you picked for question 2. "
  622.    ]
  623.   },
  624.   {
  625.    "cell_type": "code",
  626.    "execution_count": 341,
  627.    "metadata": {
  628.     "deletable": false,
  629.     "nbgrader": {
  630.      "checksum": "c37f6cdc2ca8cbb92644fa2746445779",
  631.      "grade": true,
  632.      "grade_id": "cell-c8499aeb1b1d76c7",
  633.      "locked": false,
  634.      "points": 0,
  635.      "schema_version": 1,
  636.      "solution": true
  637.     }
  638.    },
  639.    "outputs": [],
  640.    "source": [
  641.     "import numpy as np\n",
  642.     "def hat_check(N):\n",
  643.     "    \n",
  644.     "    hat_list = list(range(N))  #Generates hats\n",
  645.     "    np.random.shuffle(hat_list) #Shuffles list - the employee does not remember which belongs to whom\n",
  646.     "    \n",
  647.     "    matches = 0 #Creates counter for matches hat-person\n",
  648.     "    \n",
  649.     "    for i in range(N): #Iterates once per guest\n",
  650.     "        if i == hat_list[i]: #Compares hat and guest, if they are the same, it's a match!\n",
  651.     "            matches += 1\n",
  652.     "    return matches\n",
  653.     "    \n"
  654.    ]
  655.   },
  656.   {
  657.    "cell_type": "code",
  658.    "execution_count": 356,
  659.    "metadata": {},
  660.    "outputs": [
  661.     {
  662.      "data": {
  663.       "text/plain": [
  664.        "1"
  665.       ]
  666.      },
  667.      "execution_count": 356,
  668.      "metadata": {},
  669.      "output_type": "execute_result"
  670.     }
  671.    ],
  672.    "source": [
  673.     "hat_check(1000)"
  674.    ]
  675.   },
  676.   {
  677.    "cell_type": "markdown",
  678.    "metadata": {
  679.     "deletable": false,
  680.     "editable": false,
  681.     "nbgrader": {
  682.      "checksum": "1ff8b95312de63513a2107ffb7ab9d5a",
  683.      "grade": false,
  684.      "grade_id": "cell-086d4cc0fc5b0155",
  685.      "locked": true,
  686.      "schema_version": 1,
  687.      "solution": false
  688.     }
  689.    },
  690.    "source": [
  691.     "## Question 4.\n",
  692.     "\n",
  693.     "Plot a curve with the x-axis showing the total number of party attendants and the y-axis showing the average number of hats correctly returned. As always, remember to run several trials. "
  694.    ]
  695.   },
  696.   {
  697.    "cell_type": "code",
  698.    "execution_count": 377,
  699.    "metadata": {
  700.     "deletable": false,
  701.     "nbgrader": {
  702.      "checksum": "c4d1251529b962f3d3ce28f6ac9f244e",
  703.      "grade": true,
  704.      "grade_id": "cell-597031ea2a5a512a",
  705.      "locked": false,
  706.      "points": 0,
  707.      "schema_version": 1,
  708.      "solution": true
  709.     }
  710.    },
  711.    "outputs": [],
  712.    "source": [
  713.     "import statistics as stats\n",
  714.     "def av_matches(N):\n",
  715.     "    runs = [] #Creates list for data from running the simulation several times per different number of guests\n",
  716.     "    results = [] #Creates list of averages\n",
  717.     "    \n",
  718.     "    for i in range(N+1): #Iterates over each different number of guests\n",
  719.     "        \n",
  720.     "        for j in range(1000): #Runs the simulation 1000 times\n",
  721.     "            runs.append(hat_check(i)) #Adds results of simulations to list\n",
  722.     "            \n",
  723.     "        results.append(stats.mean(runs)) #Gets average of runs list and adds it to the overall results\n",
  724.     "        \n",
  725.     "    print(results)\n",
  726.     "    \n",
  727.     "    plt.plot(results, color =\"red\")\n",
  728.     "    plt.xlabel('Number of Guests')\n",
  729.     "    plt.ylabel('Average # of hats correctly returned')\n",
  730.     "    plt.axis([0, N, 0, 1])\n",
  731.     "    plt.grid(True)"
  732.    ]
  733.   },
  734.   {
  735.    "cell_type": "code",
  736.    "execution_count": 380,
  737.    "metadata": {},
  738.    "outputs": [
  739.     {
  740.      "name": "stdout",
  741.      "output_type": "stream",
  742.      "text": [
  743.       "[0, 0.5, 0.6753333333333333, 0.748, 0.8042, 0.8405, 0.8642857142857143, 0.878875, 0.8962222222222223, 0.9048, 0.917, 0.925, 0.932076923076923, 0.9343571428571429, 0.9368, 0.9406875, 0.9452352941176471, 0.951, 0.9547368421052631, 0.95785, 0.9580952380952381]\n"
  744.      ]
  745.     },
  746.     {
  747.      "data": {
  748.       "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEKCAYAAADuEgmxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xe4FeW5/vHvDaIIoqJiodgpahKjIrYUsRJjLDmaoEajJnKSWFJOiqYYj8kvxZxEjbEbNRo9SoqCCYkaA3oSG/aCeytiw4YVBCkCz++Pd5YsNrvM3nvNKnB/rmuuWTNrZtazl8t5mHnfeV5FBGZmZnn0qHUAZmbWOJw0zMwsNycNMzPLzUnDzMxyc9IwM7PcnDTMzCy3wpKGpMslzZL0WBvvS9KvJU2X9IikHYuKxczMKqPIK40rgTHtvP8JYGg2jQMuLDAWMzOrgMKSRkTcAbzZziYHA1dFcjewrqRNiorHzMy6b7UafvYg4IWy5ZnZupdbbihpHOlqhN69e++06aabViXA7li6dCk9etR/k5HjrJxGiBEcZ6U1SpxPPvnk6xExoLvHqWXSUCvrWq1pEhGXAJcADB8+PJqbm4uMqyKmTJnCnnvuWeswOuQ4K6cRYgTHWWmNEqek5ypxnFqmx5nAkLLlwcBLNYrFzMxyqGXSmAgck/Wi2hWYHREr3JoyM7P6UdjtKUn/C+wJbCBpJvBDoBdARFwETAIOAKYD7wLHFRWLmZlVRmFJIyKO6OD9AE4s6vPNzKzy6r/J38zM6oaThpmZ5VbLLrdmZlZu6VKYPx/efRfmzUvzd9+FhQshIk2w7HVb61pbrhAnDTOzzlq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Bv2brFZL/frGDb6mXvLSx7vbRseSnLX123rKETpBpcJ0fEh7Npi4goJZ15bcTXlcG/HieNCpc+OOJQUvvDetmq9/++TO+yz/pdWXzDI+KMSAPobA9MAU4ELmv5gVlCG0WqhnoI8PcuxG2rOCcNq3sR8SYwnpQ4Sp4l/Ysb0ghlvbpw6MMl9cjaObYEmkkVPr+sVGoaScOySqXtuQf4uKQNskbyI4DbO9jnWmAPSQeVretT9vpZsqSiNF77Ftn624DDJG2YvbeepM2yzgI9IuJPwA9YlpDeIQ0BWhpvYZ1IZeW/Rhq7wqxT3KZhjeKXpCq3JZcCEyTdSzqRtnUV0J5m0sl9I1LV0gWSLiPdwnogu4J5jdaHyXxfRLws6TRgMulKYFJEtFaGunyf+Vnj+68knQO8SjrB/zjb5E8su002lVTZlYiYJun7pHaTHqQKrCcC84ErsnUAp2XzK0kN8fNJY5VMyHpuiVY6GJh1xFVuzcwsN9+eMjOz3Jw0zMwsNycNMzPLzUnDzMxyc9IwM7PcnDTMzCw3Jw0zM8vt/wPxj5foxTd3HAAAAABJRU5ErkJggg==\n",
  749.       "text/plain": [
  750.        "<Figure size 432x288 with 1 Axes>"
  751.       ]
  752.      },
  753.      "metadata": {
  754.       "needs_background": "light"
  755.      },
  756.      "output_type": "display_data"
  757.     }
  758.    ],
  759.    "source": [
  760.     "av_matches(20)"
  761.    ]
  762.   },
  763.   {
  764.    "cell_type": "markdown",
  765.    "metadata": {
  766.     "deletable": false,
  767.     "editable": false,
  768.     "nbgrader": {
  769.      "checksum": "aad5d529ed9af56148bfc12691cdb950",
  770.      "grade": false,
  771.      "grade_id": "cell-f74b2078132a5177",
  772.      "locked": true,
  773.      "schema_version": 1,
  774.      "solution": false
  775.     }
  776.    },
  777.    "source": [
  778.     "## [Optional] Question 5.\n",
  779.     "As $N$ tends to infinity, the number of correct hats returned tends towards a well-known statistical distribution. State the distribution with all its parameters. Plot several samples using your code. Does the empirical distribution match your theoretical prediction?"
  780.    ]
  781.   },
  782.   {
  783.    "cell_type": "markdown",
  784.    "metadata": {
  785.     "deletable": false,
  786.     "nbgrader": {
  787.      "checksum": "33f94a80e6d5d9c371e6c39790bd67eb",
  788.      "grade": true,
  789.      "grade_id": "cell-32fe26c1d99fdd2a",
  790.      "locked": false,
  791.      "points": 0,
  792.      "schema_version": 1,
  793.      "solution": true
  794.     }
  795.    },
  796.    "source": [
  797.     "YOUR ANSWER HERE"
  798.    ]
  799.   }
  800.  ],
  801.  "metadata": {
  802.   "kernelspec": {
  803.    "display_name": "Python 3",
  804.    "language": "python",
  805.    "name": "python3"
  806.   },
  807.   "language_info": {
  808.    "codemirror_mode": {
  809.     "name": "ipython",
  810.     "version": 3
  811.    },
  812.    "file_extension": ".py",
  813.    "mimetype": "text/x-python",
  814.    "name": "python",
  815.    "nbconvert_exporter": "python",
  816.    "pygments_lexer": "ipython3",
  817.    "version": "3.7.0"
  818.   }
  819.  },
  820.  "nbformat": 4,
  821.  "nbformat_minor": 2
  822. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top