This white policeman comes up to me and tells me to move on. At the time I was doing a lot of boxing and so I thought to myself, I ought to hit this motherfucker because I knew what he was doing. But instead I said, “Move on, for what? I’m working downstairs. That’s my name up there, Miles Davis,” and I pointed to my name on the marquee all up in lights.

He said, “I don’t care where you work, I said move on! If you don’t move on I’m going to arrest you.”

I just looked at his face real straight and hard, and I didn’t move. Then he said, “You’re under arrest!” He reached for his handcuffs, but he was stepping back. Now, boxers had told me that if a guy’s going to hit you, if you walk toward him you can see what’s happening. I saw by the way he was handling himself that the policeman was an ex-fighter. So I kin of leaned in closer because I wasn’t going to give him no distance so he could hit me on the head. He stumbled, and all his stuff fell on the sidewalk, and I thought to myself, Oh, shit, they’re going to think that I fucked with him or something. I’m waiting for him to put the handcuffs on, because all his stuff is on the ground and shit. Then I move closer so he won’t be able to fuck me up. A crowd had gathered all of a sudden from out of nowhere, and this white detective runs in and BAM! hits me on the head. I never saw him coming. Blood was running down the khaki suit I had on. Then I remember [journalist] Dorothy Kilgallen coming outside with this horrible look on her face — I had known Dorothy for years and I used to date her good friend, Jean Bock — and saying, “Miles, what happened?” I couldn’t say nothing. Illinois Jacquet [the saxophonist] was there, too.

It was almost a race riot, so the police got scared and hurried up and got my ass out of there and took me to the 54th Precinct where they took pictures of me bleeding and shit. So, I’m sitting there, madder than a motherfucker, right? And they’re saying to me in the station, “So you’re the wiseguy, huh?” Then they’d bump up against me, you know, try to get me mad so they could probably knock me upside my head again. I’m just sitting there, taking it all in, watching every move they make.

[…]

It makes the front pages of the New York newspapers, and they repeat the charges in their headlines. There was a picture, which became famous, of me leaving the jail with this bandage all over my head (they had taken me to the hospital to have my head stitched up), and [Davis’ wife] Frances — who had come down to see me when they were transferring me downtown — walking in front of me like a proud stallion.

When Frances had come down to that police station and saw me all beat up like that, she was almost hysterical, screaming. I think the policemen started to think they had made a mistake, a beautiful woman like this screaming over this nigger. And then Dorothy Kilgallen came down and then wrote about it in her column the next day. The piece was very negative against the police, and that was of some help to my cause.

Now I would have expected this kind of bullshit about resisting arrest and all back in East St Louis (before the city went all-black), but not here in New York City, which is supposed to be the slickest, hippest city in the world. But then, again, I was surrounded by white folks and I have learned that when that happens, if you’re black, there is no justice. None.

[…]

Around this time, people — white people — started saying that I was always “angry,” that I was “racist,” or some silly shit like that. Now, I’ve been racist towards nobody, but that don’t mean I’m going to take shit from a person just because he’s white. I didn’t grin or shuffle and didn’t walk around with my finger up my ass begging for no handout and thinking I was inferior to whites. I was living in America, too, and I was going to try to get everything that was coming to me.

**― Miles Davis (Miles: The Autobiography)**

That “incident” happened 2 weeks after “Kind of Blue” was released.

“Today, 50 years after it was released, “Kind of Blue” remains the bestselling jazz album of all time. More than 4 million copies have been sold, and the album still sells an average of 5,000 copies a week. If you have a jazz album on your shelf, odds are it’s “Kind of Blue.”

*Have you ever really listened to Miles Davis?*

On 11 March 2020, the World Health Organization officiallly declared the coronavirus (SARS-CoV-2 or COVID-19) a pandemic. But, fear not, this is not yet another opinionated response on the failing of society and the end of times. This is all about Mathematics!

_{Source: https://systems.jhu.edu/research/public-health/ncov/ as of March 12th.}

Curiously enough, the numbers might help us understand all the fuss we hear about social distancing, flattening the curve, lockdowns and ultimately vaccinations.

An epidemic is a textbook example of an exponential growth. Not only an example, but its underlying principle is a centerpiece in the history of Mathematics and its discovery was fundamental for breakthroughs in Probability Theory, Mathematical Analysis, Differential Equations, Physics, Chemistry and Biology and even Pop Culture.

The idea is rather straightforward: it has do with the way a quantity changes. When the rate on which a given quantity changes is proportional to the quantity itself at any given moment, mathematicians called it exponential.

```
the rate of change is proportional to the quantity at any given time
```

Let us apply that idea on data from the beginning of the outbreak in China,

_{Source: https://systems.jhu.edu/research/public-health/ncov/ as of March 12th.}

Probably many in the past observed this behavior on how populations expand, diseases spread, biology decays or even how science progresses, but it was formally brought to life in the work on logarithms.

Later, while studying compound interest - more money you have, more money you make - Jabob Bernoulli discovered a constant ironically known as Euler’s number.

We shall have the opportunity to talk about that constant’s multiple “origins” in the future.

Coming back to the virus. In our case, having an exponential growth suggests that the larger the infectious population, quicker we will have new cases and that infectious population will grow. We pratically experience that whenever people get sick around us (or whenever all of our friends start getting pregnant at the same…no! it is not exponential…or is it?)

Scientists denote ideas using mathematical script for convenience (sometimes laziness). Let us do it then,

*I(t)*: infectious population

```
the rate of infection is proportional to the infectious population
```

Well, stating a relation of proportionality does not give us much. We still are not able to answer any questions. Is this virus dangerous? How contagious is it? Is it deadly? Are we all going to die?

We are going to formulate a model using variables and parameters to quantify *how proportial* that relation is. Using our intuition, there are two parameters we will take into account.

*$\beta$*:*contact rate*or how many people an infected person comes into contact with in given time*$\gamma$*:*recovery rate*or how many people recover in given time

The rate on which people get infected should grow the more contact they have to each other and should decay as they recover. In another words, the rate of change is *positively* proportional to $\beta$ (*contact rate*) and *negatively* proportional to $\gamma$ (*recovery rate*)

Finally, we have our equation as follows,

\[\begin{equation} \frac{dI}{dt} = \left(\beta - \gamma\right) I \end{equation}\]Now let us take some time to check if we can take some conclusions from it.

If the *recovery rate* is greater than the *contact rate*, the rate of change will always be negative, so the infection will eventually dissipate and even won’t outbreak.

On the other hand, if the *contact rate* is greater the the *recovery rate*, we will have an outbreak. Apparently, those paramaters indicate how strong an epidemic can be.

If $\gamma$ is the *recovery rate*, then $1/\gamma$ is the *infectious/recovery period* or the period of time during which an infected person is sick and then can pass it on.

Consider the product between the $\beta$ and $1/\gamma$. That gives the average number of people an infected patient will pass the infection on. For example, let us say that in a given scenario the *contact rate* is $\beta = 0.2$ and the *infectious/recovery* period is $1/\gamma = 10$ days. Then we expect that each infected patient will pass the infection onto 2 people.

In fact, that indicator is known as the *basic reproduction number*. Note that when $R_0 > 1$ the infection will be able to start spreading in a population, but not if $R_0 < 1$. So that is indeed a very important indicator.

Probably everybody has that number in their minds in the present. When trying to mitigiate the contamination, we will see how important bringing it down is in order to slow down the epidemic.

After the outbreak in China, studies found that COVID-19’s basic reproduction number is between 1.4-3.9, which means that, on avarage, a sick patient transmits the infection to 1.4 and 3.9 others. The *recovery period* is around 10 days.

We solved our equation numerically inputting different parameters to see how they play out.

_{}

We visually check how small decrements *basic reproduction number* will have a huge accumulative gain over time. That is reason why we should take agressive action, either by social distancing, avoiding and cancelling events.

We saw that the *basic reproduction number* depends on *contact rate* and *recovery rate*. Since the *recovery rate* is barely in our control - as it is typicallly a biological charateristic of the virus -, controlling the *contact rate* is our best chance to flatten the curve. That does not mean we should not invest in treatments and in the best case scenario we should bring both down.

But here is the plot twist: an epidemic is not purely exponential! Our first model assumed that the infection will spread indefinitely, the population is infinite and there is no immunity or cure.

Of course, that is nonsense. A rather evil way of think of it is that once the entire population is infected, there is none left to be infected!

Let us address that in a new model by assuming the following,

- fixed population (nobody dying, moving or being born)
- recovery and immunity

In COVID-19’s case, it is not clear how long the protection lasts. But we will assume it lasts longer than our simulated timeframe.

We will use a model that was first introduced by Anderson Ogilvy Kermack and Anderson Gray McKendrick called a compartmental model. The idea is to divide the population into group (or *compartments*) and describe how the infection moves from one to another.

Let the SIR model be as follows,

*S(t)*: susceptible but not yet infected population*I(t)*: infectious population-
*R(t)*: recovered population *$\beta$*:*contact rate*or how many people an infected person comes into contact with in given time*$\gamma$*:*recovery rate*or how many people recover in given time*N*: total population

First, the *equation S* tell us that as the population gets infected, the susceptible population becomes smaller.

Second, the *equation I* is similar to our original model’s, adding a factor of susceptibility.

Last, the *equation R* says that the recovered population is proportinal to the recovery rate.

Unfortunately, that system of differential equations is non-linear and does not have analytical solution. Fortunately, we solve it numerically with the following initial conditions,

*I(0)*= 1 (patient zero)*N*= 1.000.000 (population)

_{}

Well…We added all that math…for nothing? Wait for it and zoom out for a moment,

_{}

Now we have it!

Note that our original model gave us 1.5M for $R_0 = 4.2$, exceeding our total simulated population of 1M. That’s nonsense!

Let us see the rest of the solution,

_{}

Once more, we visually check how sensitive those systems are to the *basic reproduction number*.

Imagine that rather than each infected patient passing the infection onto other $4$ people, we could slow it down to $3$, that would result in a 25% reduction of active cases at the peak. If social distancing, from 4 to 2, the peak would be cut in more than half!

By mitigating the contamination, we will be able to not only to postpone the peak of the outbreak, but to bring the maximum number of active cases the at the peak to a lower ground and then to protect the most vulnerable by making them less susceptible and giving people the chance to get proper treatment.

_{}

Another important point to make is that our resources, like healthcare and food supply chain, are limited and not lowering the peak of infection could stress them to a point where they could not operate, leading to catastrophe.

Herd immunity (also called herd effect, community immunity, population immunity, or social immunity) is a form of indirect protection from infectious disease that occurs when a large percentage of a population has become immune to an infection, thereby providing a measure of protection for individuals who are not immune

I will let the numbers talk. Assuming that 50% of the polulation is immune/vaccinated initially,

and even in the event of the apocalypse,

That’s why Coronavirus all about Mathematics. As Euler once wrote, “nothing whatsoever takes place in the universe in which some relation of maximum and minimum does not appear.”.

*If you enjoyed this story, please feel free go the code or launch the notebook.*

If you never heard of Dask, it is parallel programming library for Python. The project was presented at SciPy 2015 by Matthew Rocklin ans is sponsored by NumFOCUS.

Dask is built on top of NumPy and Pandas and extends their familiar interfaces to larger-than-memory and parallel computing environments. Moreover, it has a promising future, as Pandas, Jupyter and scikit-learn maintainers also maintain Dask.

Dask also enables distributed computing in pure Python as opposed to Apache Spark.

This guide uses following tools,

First, we install `kubectl`

and `kops`

using Homebrew or equivalent,

Second, we give `kops`

a bucket to store the configurations.

Then we set the environment variables for `kops`

to use,

Now we choose from EC2 instance types. Note that specially when solving embarassingly parallel problems, we will not require more often than not expensive machine, rather we may take advantage of more workers.

Now we launch the cluster creation,

Now cluster is starting and it should be ready in a few minutes.

Once you are done, **REMEMBER** to tear the cluster down. Otherside you will have to pay for the uptime.

Let’s get `helm`

started,

Finally, we install the Dask Helm Chart,

After a few minutes, we check the running services,

When launching the Jupyter server, you will be prompted for a password. The default password is `dask`

.

In 1950, Russell was awarded the Nobel Prize in Literature “in recognition of his varied and significant writings in which he champions humanitarian ideals and freedom of thought”.

In this series, we will set foot on the universe of mathematical reasoning and how its theories shape and unravel the intricacy our modern world.

**Stay tuned!**

Em 20 de Maio de 2016, ocorreu o 1° Hackathon de Transparência na Unicamp, do qual eu fui um dos idealizadores. Resultados,

Em 2017, a universidade anunciou a criação oficial do seu Portal da Transparência.

Abaixo eu conto um pouco como foi organizar e participar do projeto.

]]>Knowledge is power. What are the most powerful and meaningful questions one can ask?

Unfortunately, as Adams’ *Deep Thought* super computer tells us, we don’t actually know what that questions are.

But what’s fascinating about 42?

Computers can only understand numbers. There are different numerical representations for characters, such as ASCIII and Unicode, so every machine can translate codes into readable text.

For example, **065** translates into **A** and **\f544** translates into .

In computer language, an asterisk is often used as a wildcard or sort of “whatever you want it to be” symbol.

And guess what? In the ASCII table, 42 is the designation for asterisk.

When *Deep Thought* was asked what the true meaning of life was all about, it answered as a computer would.

**Anything you want it to be.**

As you might have already noticed, voilà a humble mammal’s speculations about Life, the Universe and Everything.

*PS: Yeah! The post title was intentionally misleading. We’ll have the opportunity to talk about Hari Sheldon’s discoveries in the future.*