{"id":3241,"date":"2019-05-23T12:16:58","date_gmt":"2019-05-23T10:16:58","guid":{"rendered":"https:\/\/geekosas.com\/?p=3241"},"modified":"2026-05-23T19:29:27","modified_gmt":"2026-05-23T17:29:27","slug":"how-many-people-have-to-get-infected-to-end-covid-19","status":"publish","type":"post","link":"https:\/\/geekosas.com\/index.php\/2019\/05\/23\/how-many-people-have-to-get-infected-to-end-covid-19\/","title":{"rendered":"How many people have to get infected to end COVID-19?"},"content":{"rendered":"<p>Well, given that apparently people do not get sick twice, the easy answer should be <strong>EVERYONE<\/strong>, but it&#8217;s not that simple&#8230;<\/p>\n<p>Let me explain&#8230; each sick person infects healthy people. Currently there are 30,000 sick and 4,000 infected in the last day (approximately), so we can say that daily we have a contagion rate of $ \\frac{4000}{30000} \\simeq 13.3\\% $ which we will call $ \\lambda $.<\/p>\n<p>Then we can set up a simple model of the form:<br \/>\n$ \\Delta e<em>t = \\lambda e<\/em>{t-1} &#8211; r_{t-1} $, where the sick remain ill for 14 days.<br \/>\nwhere:<\/p>\n<ul>\n<li>$e_t$ sick at time t.<\/li>\n<li>$r_t$ recovered at time t.<\/li>\n<li>$t$ some day.<\/li>\n<\/ul>\n<p>Note that if $ (1+\\lambda)^d &#8211; 1 &lt; 1 $, where $d$ is the number of days the illness lasts, the number of sick begins to decrease instead of increase (you can modify the code to test).<\/p>\n<p>The above is a process which, if we simulate with the following code in Python (yes, in Python) for a period of 365 days:<\/p>\n<pre><code class=\"language-python\">import pandas as pd\nimport seaborn as sns\npd.set_option(&#039;display.max_rows&#039;, 500)\npd.set_option(&#039;display.max_columns&#039;, 500)\npd.set_option(&#039;display.width&#039;, 100)\ne_t0 = 100.0\nl = 0.133\ndias_sim = 365\ndias_enf = 14\nsim = [[e_t0]]\nfor t in range(1,dias_sim):\n    #print(t)\n    sim_t = sim[t-1].copy()\n    sim_t.insert(0,l*sum(sim_t))\n    sim_t = sim_t[0:dias_enf]\n    sim.append(sim_t)\nsim = [sum(x) for x in sim]\nsim = pd.DataFrame({&#039;dia&#039;:range(1,dias_sim+1),&#039;enfermos&#039;:sim})\nsns.set(style=&quot;darkgrid&quot;)\nsns.lineplot(x=&quot;dia&quot;, y=&quot;enfermos&quot;,data=sim)<\/code><\/pre>\n<p>it gives us a sick curve as follows:<br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.geekosas.com\/wp-content\/uploads\/2020\/05\/exponencial-1.png?ssl=1\" alt=\"\" \/><br \/>\nreaching 40,000,000,000,000,000 sick in just one year. That is because it does not consider that there is a population limit. To account for that, we modify the model to consider a population limit and assume that no one gets sick twice (there are cases, but few&#8230;).<\/p>\n<p>The assumption of this new model is that the probability of infecting another person decreases linearly as fewer people remain immunized.<br \/>\n$ \\Delta e<em>t = \\frac{ps<\/em>{t-1}}{p} \\lambda * e<em>{t-1} &#8211; r<\/em>{t-1} $ where:<\/p>\n<ul>\n<li>$ps_t$ is the healthy population that has never been sick<\/li>\n<li>$p$ is the total population<\/li>\n<\/ul>\n<p>We simulate with the following code for a population of 10,000,000 inhabitants:<\/p>\n<pre><code class=\"language-python\">import pandas as pd\nimport seaborn as sns\npd.set_option(&#039;display.max_rows&#039;, 500)\npd.set_option(&#039;display.max_columns&#039;, 500)\npd.set_option(&#039;display.width&#039;, 100)\ne_t0 = 100.0 #initial sick\np = 10000000.0 #population\nl = 0.133 # lambda\ndias_sim = 365 #days to simulate\ndias_enf = 14 # days sick\nps = [p - e_t0] # healthy population\nsim = [[e_t0]]\nfor t in range(1,dias_sim):\n    #print(t)\n    sim_t = sim[t-1].copy()\n    sim_t.insert(0,ps[t-1]\/p*l*sum(sim_t))\n    ps.append(ps[t-1] - sim_t[0])\n    sim_t = sim_t[0:dias_enf]\n    sim.append(sim_t)\nsim = [sum(x) for x in sim]\nsim = pd.DataFrame({&#039;dia&#039;:range(1,dias_sim+1),\n                    &#039;enfermos&#039;:sim,\n                    &#039;sanos&#039;:ps})\nsns.set(style=&quot;darkgrid&quot;)\nsns.lineplot(x=&quot;dia&quot;, y=&quot;enfermos&quot;,data=sim)<\/code><\/pre>\n<p>which gives us a sick curve as follows:<br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.geekosas.com\/wp-content\/uploads\/2020\/05\/limite-pob.png?ssl=1\" alt=\"\" \/><br \/>\nWe can see immediately that it looks more like the curves we see in the media. This is because if we call $ \\hat{\\lambda} = \\frac{ps}{p} \\lambda $, it is a term that decreases over time, so at some day $ (1+\\hat{\\lambda})^d &#8211; 1 &lt; 1 $, reducing the number of sick.<\/p>\n<p>But we still haven&#8217;t answered how many have to get sick to stop the pandemic. That is a matter of plotting the evolution of <strong>ps<\/strong>.<br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.geekosas.com\/wp-content\/uploads\/2020\/05\/sanos.png?ssl=1\" alt=\"\" \/><br \/>\nWe see that approximately 75% of people have to get sick for the population to become immunized.<\/p>\n<p>Now, we cannot change the number of days the illness lasts, but we can change the contagion rate $\\lambda$ with social distancing. Let&#8217;s see how the curve looks for different contagion rates.<\/p>\n<pre><code class=\"language-python\">import pandas as pd\nimport seaborn as sns\npd.set_option(&#039;display.max_rows&#039;, 500)\npd.set_option(&#039;display.max_columns&#039;, 500)\npd.set_option(&#039;display.width&#039;, 100)\ne_t0 = 100.0 #initial sick\np = 10000000.0 #population\nlambdas = [0.07, 0.085, 0.1 , 0.133,0.15] # lambdas\ndias_sim = 365*2 #days to simulate\ndias_enf = 14 # days sick\nsimulaciones = pd.DataFrame()\nfor l in lambdas:\n    ps = [p - e_t0] # healthy population\n    sim = [[e_t0]]\n    for t in range(1,dias_sim):\n        #print(t)\n        sim_t = sim[t-1].copy()\n        sim_t.insert(0,ps[t-1]\/p*l*sum(sim_t))\n        ps.append(ps[t-1] - sim_t[0])\n        sim_t = sim_t[0:dias_enf]\n        sim.append(sim_t)\n    sim = [sum(x) for x in sim]\n    sim = pd.DataFrame({&#039;dia&#039;:range(1,dias_sim+1),\n                        &#039;enfermos&#039;:sim,\n                        &#039;sanos&#039;:ps,\n                        &#039;lambda&#039;: l})\n    simulaciones = simulaciones.append(sim)\nsns.set(style=&quot;darkgrid&quot;)\nsns.lineplot(x=&quot;dia&quot;, y=&quot;sanos&quot;,data=simulaciones,style=&#039;lambda&#039;)\nsns.lineplot(x=&quot;dia&quot;, y=&quot;enfermos&quot;,data=simulaciones,style=&#039;lambda&#039;)<\/code><\/pre>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.geekosas.com\/wp-content\/uploads\/2020\/05\/sanos-sensibilidad.png?ssl=1\" alt=\"\" \/><br \/>\nBy lowering $\\lambda$ from 0.133 to a little less than half, 0.085, we manage to reduce the percentage that must get sick from 75% to only 30%. Considering that masks help reduce contagion per interaction from 50% to 5%, we can conclude that with everyone&#8217;s collaboration, we can control the disease.<\/p>\n<p>On the other hand, not overwhelming the health system is key. In the following graph we see the number of sick; if we halve the contagion rate, we reduce the peak of sick from 2.5 million to 0.25 million, which is one tenth.<br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.geekosas.com\/wp-content\/uploads\/2020\/05\/enfermos-sensibilidad.png?ssl=1\" alt=\"\" \/><\/p>\n<p>So while we are in crisis, stay home, and when you are allowed to go out <strong>WEAR A MASK<\/strong> \u2013 you will be doing us all a favor.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Well, given that apparently people do not get sick twice, the easy answer should be EVERYONE, but it&#8217;s not that simple&#8230; Let me explain&#8230; each <a class=\"mh-excerpt-more\" href=\"https:\/\/geekosas.com\/index.php\/2019\/05\/23\/how-many-people-have-to-get-infected-to-end-covid-19\/\" title=\"How many people have to get infected to end COVID-19?\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":2878,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-3241","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sin-categoria"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2020\/05\/covid.jpg?fit=1170%2C700&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8vjqF-Qh","jetpack-related-posts":[{"id":3238,"url":"https:\/\/geekosas.com\/index.php\/2026\/05\/12\/back-to-office-post-covid19-2\/","url_meta":{"origin":3241,"position":0},"title":"Back to Office Post-Covid19","author":"Daniel Fischer","date":"2026-05-12","format":false,"excerpt":"Before starting this article I want to thank Tristan Riquelme for giving me the idea, he is someone who always has excellent ideas about where to apply mathematical tools to real problems. Now starting with the article: Although we find a definitive cure for COVID-19, it has already created cultural\u2026","rel":"","context":"In &quot;Sin categor\u00eda&quot;","block_context":{"text":"Sin categor\u00eda","link":"https:\/\/geekosas.com\/index.php\/category\/sin-categoria\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2021\/09\/dressed_0617-780x710-1.jpg?fit=780%2C710&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2021\/09\/dressed_0617-780x710-1.jpg?fit=780%2C710&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2021\/09\/dressed_0617-780x710-1.jpg?fit=780%2C710&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2021\/09\/dressed_0617-780x710-1.jpg?fit=780%2C710&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3281,"url":"https:\/\/geekosas.com\/index.php\/2016\/05\/23\/multi-core-performance-in-r\/","url_meta":{"origin":3241,"position":1},"title":"Multi-Core Performance in R","author":"Daniel Fischer","date":"2016-05-23","format":false,"excerpt":"Introduction A few days ago, while walking around, I saw that they were selling a used HP Proliant DL360 G6. For those who don't know, it's a high\u2011performance server from 2010. Due to my interest in Data Science and BIG DATA, this toy will be useful for a diploma course\u2026","rel":"","context":"In &quot;Sin categor\u00eda&quot;","block_context":{"text":"Sin categor\u00eda","link":"https:\/\/geekosas.com\/index.php\/category\/sin-categoria\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2016\/11\/RStudio-Ball.png?fit=1000%2C1000&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2016\/11\/RStudio-Ball.png?fit=1000%2C1000&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2016\/11\/RStudio-Ball.png?fit=1000%2C1000&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2016\/11\/RStudio-Ball.png?fit=1000%2C1000&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3288,"url":"https:\/\/geekosas.com\/index.php\/2017\/05\/23\/parking-law\/","url_meta":{"origin":3241,"position":2},"title":"Parking Law","author":"Daniel Fischer","date":"2017-05-23","format":false,"excerpt":"In Chile, on February 15 (correct me if I'm wrong), the parking law was enacted, which among other things requires parking companies to: Compensate customers who are victims of theft. Prohibit fines for lost tickets. Choose one of the following two pricing methods: Charge per minute actually used. Charge per\u2026","rel":"","context":"In &quot;Sin categor\u00eda&quot;","block_context":{"text":"Sin categor\u00eda","link":"https:\/\/geekosas.com\/index.php\/category\/sin-categoria\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2017\/02\/1487175020-auno760729.jpg?fit=799%2C533&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2017\/02\/1487175020-auno760729.jpg?fit=799%2C533&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2017\/02\/1487175020-auno760729.jpg?fit=799%2C533&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2017\/02\/1487175020-auno760729.jpg?fit=799%2C533&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3339,"url":"https:\/\/geekosas.com\/index.php\/2019\/05\/23\/gender-pay-gap-in-technology\/","url_meta":{"origin":3241,"position":3},"title":"Gender Pay Gap in Technology","author":"Daniel Fischer","date":"2019-05-23","format":false,"excerpt":"The Gender Pay Gap is the difference that exists on average in the salaries of Men vs. Women. Today there are people who attribute this to discrimination, while others say it is due to the decisions that men on average make versus those of women. Since both opinions have merit,\u2026","rel":"","context":"In &quot;Sin categor\u00eda&quot;","block_context":{"text":"Sin categor\u00eda","link":"https:\/\/geekosas.com\/index.php\/category\/sin-categoria\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2019\/02\/GenderPayGap-201803070107196681-20180404082357920.jpg?fit=619%2C413&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2019\/02\/GenderPayGap-201803070107196681-20180404082357920.jpg?fit=619%2C413&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2019\/02\/GenderPayGap-201803070107196681-20180404082357920.jpg?fit=619%2C413&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3345,"url":"https:\/\/geekosas.com\/index.php\/2019\/05\/23\/deploying-a-machine-learning-cluster-on-azure-technights-6-7-2019-video-in-spanish\/","url_meta":{"origin":3241,"position":4},"title":"Deploying a Machine Learning Cluster on Azure &#8211; TechNights 6\/7\/2019 (Video in Spanish)","author":"Daniel Fischer","date":"2019-05-23","format":false,"excerpt":"https:\/\/www.youtube.com\/watch?v=mvusodXNs4U&t=9s","rel":"","context":"In &quot;Sin categor\u00eda&quot;","block_context":{"text":"Sin categor\u00eda","link":"https:\/\/geekosas.com\/index.php\/category\/sin-categoria\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2019\/07\/download.jpeg?fit=474%2C474&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3283,"url":"https:\/\/geekosas.com\/index.php\/2016\/05\/23\/call-center-agent-assignment\/","url_meta":{"origin":3241,"position":5},"title":"Call Center Agent Assignment","author":"Daniel Fischer","date":"2016-05-23","format":false,"excerpt":"Call Center Agent Assignment Call center agent assignment involves scheduling shifts to meet call demand. This problem consists of two parts: first, estimating the demand, and second, assigning agent shifts. In this article, we will focus on agent shift assignment, using R to generate solver data and GLPK to solve\u2026","rel":"","context":"In &quot;Sin categor\u00eda&quot;","block_context":{"text":"Sin categor\u00eda","link":"https:\/\/geekosas.com\/index.php\/category\/sin-categoria\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/geekosas.com\/wp-content\/uploads\/2016\/11\/Call-Centers.jpg?fit=400%2C267&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/posts\/3241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/comments?post=3241"}],"version-history":[{"count":1,"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/posts\/3241\/revisions"}],"predecessor-version":[{"id":3242,"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/posts\/3241\/revisions\/3242"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/media\/2878"}],"wp:attachment":[{"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/media?parent=3241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/categories?post=3241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekosas.com\/index.php\/wp-json\/wp\/v2\/tags?post=3241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}