<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Miguel Torres Costa</title>
 <link href="https://blog.mptc.uk/atom.xml" rel="self"/>
 <link href="https://blog.mptc.uk"/>
 <updated>2026-10-16T11:23:24+00:00</updated>
 <id>https://blog.mptc.uk</id>
 <author>
   <name>Miguel Costa</name>
   <email>miguelptcosta1995@gmail.com</email>
 </author>

 
 <entry>
   <title>Wordle</title>
   <link href="https://blog.mptc.uk/posts/Wordle"/>
   <updated>2022-01-18T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Wordle</id>
   <content type="html">&lt;p&gt;This is a solver for the &lt;a href=&quot;https://www.powerlanguage.co.uk/wordle/&quot;&gt;Wordle&lt;/a&gt; game. Write the word suggested, type back the resulting colours as a string (i.e. BBYGG means the first two tiles are black, the middle is Yellow and the last two are Green), and this will suggest you the words needed to solve the game.&lt;/p&gt;

&lt;p&gt;A newer version of this solver is at &lt;a href=&quot;https://tools.mptc.uk/wordle&quot;&gt;tools.mptc.uk/wordle&lt;/a&gt;.&lt;/p&gt;

&lt;div id=&quot;wordle&quot;&gt;
  &lt;small&gt;Loading Component&lt;/small&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Easy to State, Hard to Solve</title>
   <link href="https://blog.mptc.uk/posts/Easy-To-State-Hard-To-Solve"/>
   <updated>2021-07-01T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Easy-To-State-Hard-To-Solve</id>
   <content type="html">&lt;p&gt;Interesting problems tend to follow a pattern of being very easy to state, and hard to solve. I am sharing one as an example. Do try to solve it before reading through the solution. Enjoy!&lt;/p&gt;

&lt;h1 id=&quot;problem&quot;&gt;Problem&lt;/h1&gt;

&lt;p&gt;In how many ways can you cover a $ 3 \times n $ grid with $ 2 \times 1 $ sized dominoes?&lt;/p&gt;

&lt;h1 id=&quot;solution&quot;&gt;Solution&lt;/h1&gt;

&lt;h2 id=&quot;approach&quot;&gt;Approach&lt;/h2&gt;

&lt;p&gt;We will write the number of solutions recursively, and deduce the general formula based on this.&lt;/p&gt;

&lt;h2 id=&quot;recursions&quot;&gt;Recursions&lt;/h2&gt;

&lt;p&gt;After adding dominoes we get grids that might not be $ 3 \times n $, so let us define these three values:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$A_n$ : The number of coverings of a $ 3 \times n $ grid with an extra cell in the $n+1$ th column.&lt;/li&gt;
  &lt;li&gt;$B_n$ : The number of coverings of a $ 3 \times n $ grid with two extra adjacent cells in the $n+1$ th column.&lt;/li&gt;
  &lt;li&gt;$C_n$ : The number of coverings of a $ 3 \times (n+1) $ grid.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With these in mind, we get three key recursions:&lt;/p&gt;

\[\left\{\begin{matrix}
A_n = &amp;amp; B_{n-1}\\ 
B_n = &amp;amp; C_{n-1} + A_{n-1}\\ 
C_n = &amp;amp; B_{n-1} + C_{n-2} + A_{n}
\end{matrix}\right.\]

&lt;p&gt;Using $A_n = B_{n-1}$ to get rid of all the $A_n$ terms we get the system of equations&lt;/p&gt;

\[\left\{\begin{matrix}
B_n = &amp;amp; C_{n-1} + B_{n-2}\\ 
C_n = &amp;amp; 2 B_{n-1} + C_{n-2}
\end{matrix}\right.\]

&lt;p&gt;In order to get similar recursions, we can define $C’_n = \sqrt{2} C_n$ to get the system of equations.&lt;/p&gt;

\[\left\{\begin{matrix}
B_n = &amp;amp; \sqrt{2}C&apos;_{n-1} + B_{n-2}\\ 
C&apos;_n = &amp;amp; \sqrt{2} B_{n-1} + C&apos;_{n-2}
\end{matrix}\right.\]

&lt;p&gt;Since $B_n$ and $C’_n$ look really similar, we can try to work out this system in terms of their average value and difference, by setting&lt;/p&gt;

\[\left\{\begin{matrix}
\alpha_n = &amp;amp; \frac{B_n + C&apos;_n}{2}\\ 
\beta_n = &amp;amp; \frac{B_n - C&apos;_n}{2}
\end{matrix}\right.
\iff
\left\{\begin{matrix}
B_n = &amp;amp; \alpha_n + \beta_n\\ 
C&apos;_n = &amp;amp; \alpha_n - \beta_n
\end{matrix}\right.\]

&lt;p&gt;Substituting back in the original equations we get&lt;/p&gt;

\[\left\{\begin{matrix}
B_n = &amp;amp; \sqrt{2}C&apos;_{n-1} + B_{n-2}\\ 
C&apos;_n = &amp;amp; \sqrt{2} B_{n-1} + C&apos;_{n-2}
\end{matrix}\right.
\iff
\left\{\begin{matrix}
\alpha_n + \beta_n = &amp;amp; \sqrt{2} \left ( \alpha_{n-1} - \beta_{n-1} \right ) + \left ( \alpha_{n-2} + \beta_{n-2} \right ) \\ 
\alpha_n - \beta_n = &amp;amp; \sqrt{2} \left ( \alpha_{n-1} + \beta_{n-1} \right ) + \left ( \alpha_{n-2} - \beta_{n-2} \right ) \\ 
\end{matrix}\right.
\iff
\left\{\begin{matrix}
\alpha_n = &amp;amp; \sqrt{2} \alpha_{n-1} + \alpha_{n-2} \\ 
\beta_n = - &amp;amp; \sqrt{2} \beta_{n-1} + \beta_{n-2} \\ 
\end{matrix}\right.\]

&lt;p&gt;These 2 equations are independent of each other and relatively simple to solve :)&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;$\alpha_n$: Solving $ \alpha^2 = \sqrt{2} \alpha + 1 $ we get $ \alpha = \frac{1 \pm \sqrt{3}}{\sqrt{2}}$, which leads to the general solution $ \alpha_n = r \left ( \frac{1 +  \sqrt{3}}{\sqrt{2}} \right )^n + s \left ( \frac{1 - \sqrt{3}}{\sqrt{2}} \right ) ^n$.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;$\beta_n$: Solving $ \beta^2 = - \sqrt{2} \beta + 1 $ we get $ \beta = \frac{-1 \pm \sqrt{3}}{\sqrt{2}}$, which leads to the general solution $ \beta_n = t \left ( \frac{-1 +  \sqrt{3}}{\sqrt{2}} \right )^n + u \left ( \frac{-1 - \sqrt{3}}{\sqrt{2}} \right ) ^n$.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With these general formulas, we can get&lt;/p&gt;

\[\left\{\begin{matrix}
B_n &amp;amp; = &amp;amp; B_n &amp;amp; = &amp;amp; \alpha_n + \beta_n &amp;amp; = &amp;amp; r \left ( \frac{1 +  \sqrt{3}}{\sqrt{2}} \right )^n + s \left ( \frac{1 - \sqrt{3}}{\sqrt{2}} \right ) ^n + t \left ( \frac{-1 +  \sqrt{3}}{\sqrt{2}} \right )^n + u \left ( \frac{-1 - \sqrt{3}}{\sqrt{2}} \right ) ^n\\
C_n &amp;amp; = &amp;amp; \sqrt{2}C&apos;_n &amp;amp; = &amp;amp; \sqrt{2} \left ( \alpha_n - \beta_n \right ) &amp;amp; = &amp;amp; \sqrt{2} \left ( r \left ( \frac{1 + \sqrt{3}}{\sqrt{2}} \right )^n + s \left ( \frac{1 - \sqrt{3}}{\sqrt{2}} \right ) ^n - t \left ( \frac{-1 +  \sqrt{3}}{\sqrt{2}} \right )^n - u \left ( \frac{-1 - \sqrt{3}}{\sqrt{2}} \right ) ^n  \right )
\end{matrix}\right.\]

&lt;p&gt;The final step is to find the values of $r$, $s$, $t$ and $u$. For that we need to figure out basecases, namely:&lt;/p&gt;

\[\left\{\begin{matrix}
B_0 &amp;amp; = &amp;amp; 1\\ 
C_0 &amp;amp; = &amp;amp; 0\\ 
B_1 &amp;amp; = &amp;amp; 1\\
C_1 &amp;amp; = &amp;amp; 3
\end{matrix}\right.\]

\[\left\{\begin{matrix}
r+s+t+u &amp;amp; = &amp;amp; 1\\ 
\sqrt{2} \left ( r+s-t-u \right ) &amp;amp; = &amp;amp; 0\\ 
r  \frac{1 +  \sqrt{3}}{\sqrt{2}} + s \frac{1 - \sqrt{3}}{\sqrt{2}} + t \frac{-1 +  \sqrt{3}}{\sqrt{2}} + u \frac{-1 - \sqrt{3}}{\sqrt{2}} &amp;amp; = &amp;amp; 1\\
\sqrt{2} \left ( r  \frac{1 +  \sqrt{3}}{\sqrt{2}} + s \frac{1 - \sqrt{3}}{\sqrt{2}} - t \frac{-1 +  \sqrt{3}}{\sqrt{2}} - u \frac{-1 - \sqrt{3}}{\sqrt{2}} \right ) &amp;amp; = &amp;amp; 3
\end{matrix}\right.\]

\[\left\{\begin{matrix}
r+s &amp;amp; = &amp;amp; \frac{1}{2}\\ 
t+u &amp;amp; = &amp;amp; \frac{1}{2}\\ 
(r+s) \frac{1}{\sqrt{2}} + (r-s) \frac{\sqrt{3}}{\sqrt{2}} + (t+u) \frac{-1}{\sqrt{2}} + (t-u) \frac{\sqrt{3}}{\sqrt{2}} &amp;amp; = &amp;amp; 1\\
(r+s) - (r-s) \sqrt{3} + (t+u) - (t-u) \sqrt{3} &amp;amp; = &amp;amp; 3\\
\end{matrix}\right.\]

\[\left\{\begin{matrix}
r+s &amp;amp; = &amp;amp; \frac{1}{2}\\ 
t+u &amp;amp; = &amp;amp; \frac{1}{2}\\ 
\frac{1}{2} \frac{1}{\sqrt{2}} + (r-s) \frac{\sqrt{3}}{\sqrt{2}} + \frac{1}{2} \frac{-1}{\sqrt{2}} + (t-u) \frac{\sqrt{3}}{\sqrt{2}} &amp;amp; = &amp;amp; 1\\
1 + ((r-s)-(t-u)) \sqrt{3} &amp;amp; = &amp;amp; 3\\
\end{matrix}\right.\]

\[\left\{\begin{matrix}
r+s &amp;amp; = &amp;amp; \frac{1}{2}\\ 
t+u &amp;amp; = &amp;amp; \frac{1}{2}\\ 
(r-s) \frac{\sqrt{3}}{\sqrt{2}} + (t-u) \frac{\sqrt{3}}{\sqrt{2}} &amp;amp; = &amp;amp; 1\\
((r-s)-(t-u)) \sqrt{3} &amp;amp; = &amp;amp; 2\\
\end{matrix}\right.\]

\[\left\{\begin{matrix}
r+s &amp;amp; = &amp;amp; \frac{1}{2}\\ 
t+u &amp;amp; = &amp;amp; \frac{1}{2}\\ 
(r-s) \frac{\sqrt{3}}{\sqrt{2}} + (t-u) \frac{\sqrt{3}}{\sqrt{2}} &amp;amp; = &amp;amp; 1\\
(r-s)-(t-u) &amp;amp; = &amp;amp; \frac{2}{\sqrt{3}}\\
\end{matrix}\right.\]

\[\left\{\begin{matrix}
r+s &amp;amp; = &amp;amp; \frac{1}{2}\\ 
t+u &amp;amp; = &amp;amp; \frac{1}{2}\\ 
(r-s) + (t-u) &amp;amp; = &amp;amp; \frac{\sqrt{2}}{\sqrt{3}}\\
(r-s)-(t-u) &amp;amp; = &amp;amp; \frac{2}{\sqrt{3}}\\
\end{matrix}\right.\]

\[\left\{\begin{matrix}
r+s &amp;amp; = &amp;amp; \frac{1}{2}\\ 
t+u &amp;amp; = &amp;amp; \frac{1}{2}\\
r-s &amp;amp; = &amp;amp; \frac{1}{\sqrt{6}} + \frac{1}{\sqrt{3}}\\
t-u &amp;amp; = &amp;amp; \frac{1}{\sqrt{6}} - \frac{1}{\sqrt{3}}\\
\end{matrix}\right.\]

\[\left\{\begin{matrix}
r &amp;amp; = &amp;amp; \frac{1}{4} + \frac{1}{2 \sqrt{6}} + \frac{1}{ 2 \sqrt{3}}\\
s &amp;amp; = &amp;amp; \frac{1}{4} - \frac{1}{2 \sqrt{6}} - \frac{1}{ 2 \sqrt{3}}\\
t &amp;amp; = &amp;amp; \frac{1}{4} + \frac{1}{2 \sqrt{6}} - \frac{1}{ 2 \sqrt{3}}\\
u &amp;amp; = &amp;amp; \frac{1}{4} - \frac{1}{2 \sqrt{6}} + \frac{1}{ 2 \sqrt{3}}\\
\end{matrix}\right.\]

&lt;p&gt;Assembling all of this together we get that $C_n$ equals the sum of the four terms&lt;/p&gt;

\[C_n = 
\sqrt{2} \left ( \left ( \frac{1}{4} + \frac{1}{2 \sqrt{6}} + \frac{1}{ 2 \sqrt{3}} \right ) \left ( \frac{1 + \sqrt{3}}{\sqrt{2}} \right )^n \\
+ \sqrt{2} \left ( \frac{1}{4} - \frac{1}{2 \sqrt{6}} - \frac{1}{ 2 \sqrt{3}} \right ) \left ( \frac{1 - \sqrt{3}}{\sqrt{2}} \right ) ^n \\
- \sqrt{2} \left ( \frac{1}{4} + \frac{1}{2 \sqrt{6}} - \frac{1}{ 2 \sqrt{3}} \right ) \left ( \frac{-1 +  \sqrt{3}}{\sqrt{2}} \right )^n \\
- \sqrt{2} \left ( \frac{1}{4} - \frac{1}{2 \sqrt{6}} + \frac{1}{ 2 \sqrt{3}} \right ) \left ( \frac{-1 - \sqrt{3}}{\sqrt{2}} \right ) ^n \right )\]

&lt;p&gt;Since $C_n$ is the number of solutions of a $3 \times (n+1) $ grid, our answer is&lt;/p&gt;

&lt;h1 id=&quot;answer&quot;&gt;Answer&lt;/h1&gt;

\[\sqrt{2} \left ( \left ( \frac{1}{4} + \frac{1}{2 \sqrt{6}} + \frac{1}{ 2 \sqrt{3}} \right ) \left ( \frac{1 + \sqrt{3}}{\sqrt{2}} \right )^{n-1} \\ + \left ( \frac{1}{4} - \frac{1}{2 \sqrt{6}} - \frac{1}{ 2 \sqrt{3}} \right ) \left ( \frac{1 - \sqrt{3}}{\sqrt{2}} \right ) ^{n-1} \\ - \left ( \frac{1}{4} + \frac{1}{2 \sqrt{6}} - \frac{1}{ 2 \sqrt{3}} \right ) \left ( \frac{-1 +  \sqrt{3}}{\sqrt{2}} \right )^{n-1} \\ - \left ( \frac{1}{4} - \frac{1}{2 \sqrt{6}} + \frac{1}{ 2 \sqrt{3}} \right ) \left ( \frac{-1 - \sqrt{3}}{\sqrt{2}} \right ) ^{n-1} \right )\]

</content>
 </entry>
 
 <entry>
   <title>Mathsy Shortcuts</title>
   <link href="https://blog.mptc.uk/posts/Mathsy-Shortcuts"/>
   <updated>2021-04-18T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Mathsy-Shortcuts</id>
   <content type="html">&lt;p&gt;I have written this page to add small shortcuts and insights in reasoning that can be useful.&lt;/p&gt;

&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#geometric-mean-is-the-arithmetic-mean-of-magnitudes&quot; id=&quot;markdown-toc-geometric-mean-is-the-arithmetic-mean-of-magnitudes&quot;&gt;Geometric mean is the (arithmetic) mean of magnitudes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;geometric-mean-is-the-arithmetic-mean-of-magnitudes&quot;&gt;Geometric mean is the (arithmetic) mean of magnitudes&lt;/h3&gt;

&lt;p&gt;For a set of positive numbers $ A = \{ x_1, x_2, … ,x_n \} $ the arithmetic mean is defined as $\frac{1}{n} \sum {x_i} $ whereas the geometric mean is defined as $ \sqrt[n]{ \prod x_i} $, resulting in:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$ A $&lt;/th&gt;
      &lt;th&gt;Arithmetic Mean&lt;/th&gt;
      &lt;th&gt;Geometric Mean&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$ \{ 4,9 \} $&lt;/td&gt;
      &lt;td&gt;$6.5$&lt;/td&gt;
      &lt;td&gt;$ 6 $&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$ \{ 1,2,4,8,16 \} $&lt;/td&gt;
      &lt;td&gt;$6.2$&lt;/td&gt;
      &lt;td&gt;$ 4 $&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The Geometric Mean becomes obvious if we write all numbers as magnitudes:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$ A $&lt;/th&gt;
      &lt;th&gt;Arithmetic Mean&lt;/th&gt;
      &lt;th&gt;Geometric Mean&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$ \{ 2^2,2^{3.1699} \} $&lt;/td&gt;
      &lt;td&gt;$ 2^{2.7004} $&lt;/td&gt;
      &lt;td&gt;$ 2^{2.58496} $&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$ \{ 2^0,2^1,2^2,2^3,2^4 \} $&lt;/td&gt;
      &lt;td&gt;$ 2^{2.632268} $&lt;/td&gt;
      &lt;td&gt;$ 2^2 $&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Note that $2.58496$ is just the mean of $ \{ 2 , 3.1699 \}$, and for the second line $2$ is the mean of $ \{ 0,1,2,3,4 \}$. I have written them base $2$ but any magnitude would suffice.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>KPIs - Lag vs Lead Measures</title>
   <link href="https://blog.mptc.uk/posts/KPIs-Lag-vs-Lead-Measures"/>
   <updated>2021-04-18T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/KPIs-Lag-vs-Lead-Measures</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Performance_indicator&quot;&gt;KPIs&lt;/a&gt; have proven themselves as a way to ensure we stay on track and actually achieve our goals, be it at a business level (i.e. How many new clients are we getting each day?) or a personal level ( i.e. how many hours of exercise am I doing each week? ). As I read through &lt;a href=&quot;https://www.calnewport.com/books/deep-work/&quot;&gt;Cal Newport’s Deep Work&lt;/a&gt; he distinguishes between lead and lag measures, a big enough distinction that warrants keeping in mind while designing any KPI.&lt;/p&gt;

&lt;p&gt;Lag measures are more in line with what we want to achieve ( i.e. business profitability or exam scores ), but they are only observed after the correct decisions are made. This lag makes them less useful for driving decisions, as they only inform us on the quality of past decisions.&lt;/p&gt;

&lt;p&gt;Lead measures are usually less aligned with what we care about, but provide us with earlier information about what we care about, even if it isn’t always perfect information.&lt;/p&gt;

&lt;p&gt;In order to practice building good lag and lead measures, I have started building a few examples. In all these examples, the Lagged Measures are what I mostly care about, but the Lead Measures allow me to consistently build towards that goal, even if they don’t perfectly reflect it.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Goal&lt;/th&gt;
      &lt;th&gt;Lagged Measure&lt;/th&gt;
      &lt;th&gt;Lead Measure&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Becoming healthier&lt;/td&gt;
      &lt;td&gt;Overall tiredness during the day&lt;/td&gt;
      &lt;td&gt;Quality of the food I am eating&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Better grades&lt;/td&gt;
      &lt;td&gt;Exam scores&lt;/td&gt;
      &lt;td&gt;Time it takes to correctly complete homework&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Sucessfully launching a startup&lt;/td&gt;
      &lt;td&gt;Monthly revenue&lt;/td&gt;
      &lt;td&gt;Number of new clients every week&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Social welfare&lt;/td&gt;
      &lt;td&gt;Population satisfaction&lt;/td&gt;
      &lt;td&gt;Wealth gini coefficient&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Financial security&lt;/td&gt;
      &lt;td&gt;Passive income&lt;/td&gt;
      &lt;td&gt;Active income&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Which other examples should I add?&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Strange Attractors</title>
   <link href="https://blog.mptc.uk/posts/Strange-Attractors"/>
   <updated>2021-03-24T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Strange-Attractors</id>
   <content type="html">&lt;p&gt;This is an implementation of Numberphile’s ideas from their &lt;a href=&quot;https://www.youtube.com/watch?v=kbKtFN71Lfs&quot;&gt;Chaos Game Video&lt;/a&gt;. Click on Run Simulation below to see the magic happen!&lt;/p&gt;

&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#intro&quot; id=&quot;markdown-toc-intro&quot;&gt;Intro&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#tool&quot; id=&quot;markdown-toc-tool&quot;&gt;Tool&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#can-you-replicate-these-patterns&quot; id=&quot;markdown-toc-can-you-replicate-these-patterns&quot;&gt;Can you replicate these patterns?&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#sierpinski-triangle&quot; id=&quot;markdown-toc-sierpinski-triangle&quot;&gt;Sierpinski Triangle&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#sierpinski-tetrahedron&quot; id=&quot;markdown-toc-sierpinski-tetrahedron&quot;&gt;Sierpinski Tetrahedron&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#sudoku&quot; id=&quot;markdown-toc-sudoku&quot;&gt;Sudoku&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#big-sudoku&quot; id=&quot;markdown-toc-big-sudoku&quot;&gt;Big Sudoku&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#octogon&quot; id=&quot;markdown-toc-octogon&quot;&gt;Octogon&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#cursor&quot; id=&quot;markdown-toc-cursor&quot;&gt;Cursor&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#falcon&quot; id=&quot;markdown-toc-falcon&quot;&gt;Falcon&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#perspective&quot; id=&quot;markdown-toc-perspective&quot;&gt;Perspective&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#tic-tac-toe&quot; id=&quot;markdown-toc-tic-tac-toe&quot;&gt;Tic Tac Toe&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#trapezoid&quot; id=&quot;markdown-toc-trapezoid&quot;&gt;Trapezoid&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;intro&quot;&gt;Intro&lt;/h1&gt;

&lt;p&gt;In the plot you will see the latest point (orange) and a set of attractors. At every iteration, a random attractor is selected and the latest point becomes the midpoint between the attractor and the orange point. Repeat this thousands of times and fractals start to emerge.&lt;/p&gt;

&lt;p&gt;You can play around with the list of attractors, number of iterations per simulation and the strength of the pull towards the attractor.&lt;/p&gt;
&lt;h1 id=&quot;tool&quot;&gt;Tool&lt;/h1&gt;

&lt;div id=&quot;plot&quot;&gt;&lt;/div&gt;

&lt;div id=&quot;strange_attractors&quot;&gt;
  &lt;small&gt;Loading Component&lt;/small&gt;
&lt;/div&gt;

&lt;h1 id=&quot;can-you-replicate-these-patterns&quot;&gt;Can you replicate these patterns?&lt;/h1&gt;

&lt;h2 id=&quot;sierpinski-triangle&quot;&gt;Sierpinski Triangle&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/sierpinski_triangle.png&quot; alt=&quot;Sierpinski Triangle&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;sierpinski-tetrahedron&quot;&gt;Sierpinski Tetrahedron&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/sierpinski_tetrahedron.png&quot; alt=&quot;Sierpinski Tetrahedron&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;sudoku&quot;&gt;Sudoku&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/sudoku.png&quot; alt=&quot;Sudoku&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;big-sudoku&quot;&gt;Big Sudoku&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/big_sudoku.png&quot; alt=&quot;Big Sudoku&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;octogon&quot;&gt;Octogon&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/octogon.png&quot; alt=&quot;Octogon&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;cursor&quot;&gt;Cursor&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/cursor.png&quot; alt=&quot;Cursor&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;falcon&quot;&gt;Falcon&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/falcon.png&quot; alt=&quot;Falcon&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;perspective&quot;&gt;Perspective&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/perspective.png&quot; alt=&quot;Perspective&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;tic-tac-toe&quot;&gt;Tic Tac Toe&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/tic_tac_toe.png&quot; alt=&quot;Tic Tac Toe&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;trapezoid&quot;&gt;Trapezoid&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/strange_attractors/trapezoid.png&quot; alt=&quot;Trapezoid&quot; /&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>All horses have the same colour</title>
   <link href="https://blog.mptc.uk/posts/All-Horses-Have-The-Same-Colour"/>
   <updated>2021-03-20T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/All-Horses-Have-The-Same-Colour</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Mathematical_induction&quot;&gt;Mathematical Induction&lt;/a&gt; has 3 steps to it:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Induction Hypothesis:&lt;/strong&gt; state the identity that we want to prove.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Base Case:&lt;/strong&gt; prove that the property is true for $n=1$.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Inductive Step:&lt;/strong&gt; show that if the property is true for $n$, then it must be true for $n+1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This works because the base case shows the property holds for $n=1$. Then we apply the inductive step to show that it holds for $n=2$, which implies that it holds for $n=3$, and so forth for all positive integers. As such, I will show the following statement:&lt;/p&gt;

&lt;h3 id=&quot;all-horses-have-the-same-colour-pattern&quot;&gt;All horses have the same colour pattern&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Induction Hypothesis:&lt;/strong&gt; Any set of $n$ horses $ h_1, h_2,… h_n  $ have the same colour pattern.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Base Case:&lt;/strong&gt; For $n=1$ we have a single horse, so there can be only one colour pattern.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Inductive Step:&lt;/strong&gt; Assume that the statement is true for $n$. Take the set $h_1, h_2,…, h_n, h_{n+1} $ with $n+1$ horses. By our hypothesis the set of horses $h_1,…,h_n$ has a single colour pattern, and the set $h_2, … , h_n, h_{n+1} $ also has a single colour pattern. Since this must be the colour pattern of their intersection set $h_2,…h_n$, then the entire set of $n+1$ horses has the same colour.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All three elements of mathematical induction are fulfilled. Can you spot the logical error?&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>MasterMind - Game</title>
   <link href="https://blog.mptc.uk/posts/MasterMind-Game"/>
   <updated>2021-03-10T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/MasterMind-Game</id>
   <content type="html">&lt;h1 id=&quot;goal&quot;&gt;Goal&lt;/h1&gt;

&lt;p&gt;This is a rendition of the old game Master Mind. Specify the length of the alphabet and the number of hidden characters to get started. When submitting a guess, you will get crosses X for every correct guess in the correct position, zeroes O for correct guesses in the wrong position, and dashes - for the remaining guesses.&lt;/p&gt;

&lt;p&gt;Best of luck!&lt;/p&gt;

&lt;div id=&quot;mastermind_game&quot;&gt;
  &lt;small&gt;Loading Component&lt;/small&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Asset Division</title>
   <link href="https://blog.mptc.uk/posts/Asset-Division"/>
   <updated>2021-03-06T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Asset-Division</id>
   <content type="html">&lt;h1 id=&quot;goal&quot;&gt;Goal&lt;/h1&gt;
&lt;p&gt;During inheritance procedures or other events of distribution of shared wealth, finding a satisfactory distribution can be challenging. Below we try to solve the issue based uniquely on the people involved and a list of items to be distributed, assuming that all have equal rights over the shared items.&lt;/p&gt;

&lt;p&gt;A newer version of this tool is at &lt;a href=&quot;https://tools.mptc.uk/split&quot;&gt;tools.mptc.uk/split&lt;/a&gt;.&lt;/p&gt;

&lt;h1 id=&quot;technical-note&quot;&gt;Technical Note&lt;/h1&gt;

&lt;p&gt;Assuming that each person has a dollar value for each item, not necessarily equal to the other members, the fact that there is a distribution accepted by everyone is assured by &lt;a href=&quot;https://en.wikipedia.org/wiki/Sperner%27s_lemma&quot;&gt;Sperner’s Lemma&lt;/a&gt;. This does not take into account possible psychological factors, such as only accepting a distribution if the other parties are not happy with it. Instead it assumes a pure profit maximizing approach.&lt;/p&gt;
&lt;h1 id=&quot;steps&quot;&gt;Steps&lt;/h1&gt;
&lt;ol&gt;
  &lt;li&gt;Type in the list of people wanting to divide the items.&lt;/li&gt;
  &lt;li&gt;Add the items, and for each item an estimated price. &lt;small&gt;This does not need to be exact nor correct as the algorithm re estimates the prices, it just helps to initialize it with sensible values.&lt;/small&gt;&lt;/li&gt;
  &lt;li&gt;Click on “Start” to freeze the above lists and start estimating.&lt;/li&gt;
  &lt;li&gt;Each round you will be shown different groupings of the items, and each person should select their favorite group each round. This will allow us to infer item valuations, and suggest the best item allocation.&lt;/li&gt;
&lt;/ol&gt;

&lt;div id=&quot;asset_division&quot;&gt;
  &lt;small&gt;Loading Component&lt;/small&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Integrating Factors</title>
   <link href="https://blog.mptc.uk/posts/Integrating-Factors"/>
   <updated>2021-01-17T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Integrating Factors</id>
   <content type="html">&lt;p&gt;Integrating factors allow us to solve equations of the form \(y&apos; + P(x)y = Q(x)\)&lt;/p&gt;

&lt;h1 id=&quot;intuition&quot;&gt;Intuition&lt;/h1&gt;

&lt;p&gt;The derivative of \(e^{R(x)}\) is \(R&apos;(x) e^{R(x)}\) . This can be used to cancel out terms when we have anything of the form \(y&apos; + R&apos;(x)y\), and we can do so by setting \(P(x) = R&apos;(x)\) . By playing around with this idea the methodology below was developed.&lt;/p&gt;

&lt;h1 id=&quot;general-solution&quot;&gt;General Solution&lt;/h1&gt;

&lt;p&gt;We know that \(y&apos; + P(x)y = Q(x)\). We want \(R&apos;(x) = P(x)\), so we define \(R(x) = \int P(x) dx\) to get \(y&apos; + R&apos;(x)y = Q(x)\). By multiplying all terms of the equation by \(e^{R(x)}\) we get&lt;/p&gt;

\[\begin{align}
Q(x) e^{R(x)} &amp;amp;= y&apos;e^{R(x)} + yR&apos;(x)e^{R(x)} \\
  &amp;amp;= y&apos;e^{R(x)} + y(e^{R(x)})&apos; \\
  &amp;amp;= (ye^{R(x)})&apos;
\end{align}\]

&lt;p&gt;By integrating both sides and then rearranging for \(y\), we get \(ye^{R(x)} = \int Q(x) e^{R(x)} dx
\Leftrightarrow y = e^{-R(x)} \int Q(x) e^{R(x)}dx\), with \(R(x) = \int P(x) dx\) as initially defined.&lt;/p&gt;

&lt;h2 id=&quot;example&quot;&gt;Example&lt;/h2&gt;

&lt;p&gt;Many examples require harder integrals than the one that follows, however this example should give you an idea of how to proceed.&lt;/p&gt;

\[y&apos; - \frac{y}{x} = x\]

&lt;p&gt;We have that \(P(x) = -\frac{1}{x}\), so \(R(x) = \int P(x) dx = - \int \frac{1}{x} dx = -\ln{x}\). Hence our Integrating Factor is \(e^{-\ln{x}} = \frac{1}{x}\), so we can rewrite our original equation by multiplying it by \(\frac{1}{x}\) as&lt;/p&gt;

\[\begin{align}
\frac{y&apos;}{x} - \frac{y}{x}\frac{1}{x} &amp;amp;= x \frac{1}{x} \\
\frac{y&apos;}{x} - \frac{y}{x^2} &amp;amp;= 1 \\
\frac{y&apos;}{x} - y \left ( \frac{1}{x} \right ) &apos; &amp;amp;= 1 \\
\left ( \frac{y}{x} \right ) &apos; &amp;amp;= 1
\end{align}\]

&lt;p&gt;Integrating both sides with respect to \(x\) we get&lt;/p&gt;

\[\frac{y}{x} = \int 1 dx = x \Leftrightarrow y = x^2\]

&lt;p&gt;Confirming it within the original equation, we indeed get \(y&apos; - \frac{y}{x} = ( x^2 ) &apos; - \frac{x^2}{x} = 2x - x = x\)&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Priority setting - should we train guide dogs for the blind?</title>
   <link href="https://blog.mptc.uk/posts/Priority-Setting"/>
   <updated>2020-10-23T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Priority-Setting</id>
   <content type="html">&lt;p&gt;&lt;em&gt;This is the first of (what I hope to be) many projects I will write about here. They are better based on tools that I think would be useful for society as a whole rather than profitable.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Should we train guide dogs for the blind? The typical answer is yes, but I have a strong reason against it: you are preventing thousands of other people from recovering from blindness by doing so. The reason for this claim is as follows: The entire process of training dogs can cost over $ 40000 USD. For the same price, we could treat thousands with &lt;a href=&quot;https://en.wikipedia.org/wiki/Anti%E2%80%93vascular_endothelial_growth_factor_therapy&quot;&gt;Anti Vascular Endothelial Growth Factor Therapy&lt;/a&gt;. So my answer is clear: I am strongly against training Guide Dogs.&lt;/p&gt;

&lt;p&gt;Whereas the case above might not hold ( I am sorry doctors if I mentioned something clearly wrong, do feel free to correct me ), I hope the broader point is clear: many movements and decisions happen at a societal level due to the awareness and emotion that they create, rather than the actual benefit that they provide to humanity. In order to align society wide benefits with popular sentiment, I am keen on building a tool that allows for direct comparison of actions against their societal benefit AND the cost of implementing them, in practice reaping the benefits of a benefit cost analysis in a simple interface.&lt;/p&gt;

&lt;p&gt;After some consideration, this is the structure that I believe would work best. Feel free to think this through yourself before reading my beliefs, I would be interested to compare them.&lt;/p&gt;

&lt;h1 id=&quot;key-ideas&quot;&gt;Key ideas&lt;/h1&gt;

&lt;p&gt;I want to show in a simple plot a comparison of the effectiveness of different actions at a society level. I could visually share a lot of information by using a 2d plot where you could hover and click to get more information about the specific measures.&lt;/p&gt;

&lt;h2 id=&quot;dimentions-available-to-show-information&quot;&gt;Dimentions available to show information.&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;x-axis&lt;/li&gt;
  &lt;li&gt;y-axis&lt;/li&gt;
  &lt;li&gt;colours (rgb could potentially provide 3 dimentions. This could prove particularly useful for person clustering, in terms of understanding which groups favor which measures.&lt;/li&gt;
  &lt;li&gt;transparency&lt;/li&gt;
  &lt;li&gt;size&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By a mix of the above I should be able to show up to 7 dimentions of data.&lt;/p&gt;

&lt;h2 id=&quot;possible-information-shared&quot;&gt;Possible information shared&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;What measures have the most positive impact on humanity?&lt;/li&gt;
  &lt;li&gt;Which measures are the most likely to happen?&lt;/li&gt;
  &lt;li&gt;How long ago was this measure proposed?&lt;/li&gt;
  &lt;li&gt;How many people are devoted / interested in this measure?&lt;/li&gt;
  &lt;li&gt;Many more things I haven’t though of but you could tell me :P&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main challenge is to actually gather the information about all measures. One possible way to do it is to build a platform.&lt;/p&gt;

&lt;h2 id=&quot;rough-action-steps&quot;&gt;Rough action steps&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;People can sign up to the platform and submit measures.&lt;/li&gt;
  &lt;li&gt;A full list of the measures would be presented, which people can favorite.&lt;/li&gt;
  &lt;li&gt;Favorited measures can be ranked on the above questions (ranking is much easier that building specific numbers).&lt;/li&gt;
  &lt;li&gt;Use the many partial orderings provided by the users into a total ordering.&lt;/li&gt;
  &lt;li&gt;Plot this information for users to in a single plot.&lt;/li&gt;
  &lt;li&gt;Submitted measures could make use of hashtags in order to allow for groupings. I would use #Portugal for measures about my home country, #Maths for measures on speeding up academic research (maybe which techniques to develop), and any others of interest.&lt;/li&gt;
  &lt;li&gt;As time passes questions could fade into the background.&lt;/li&gt;
  &lt;li&gt;Live happily ever after.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The final objective would be to end up in a situation where only &lt;a href=&quot;https://en.wikipedia.org/wiki/Pareto_efficiency&quot;&gt;Pareto Efficient&lt;/a&gt; measures end up being applied, in the sense that for any measure, if there is an alternative which is simultaneously better and easier to implement, then we should not waste time on it. Interested? Let’s make this happen :P&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Shopping Cart</title>
   <link href="https://blog.mptc.uk/posts/Shopping-Cart"/>
   <updated>2020-10-08T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Shopping-Cart</id>
   <content type="html">&lt;p&gt;Found on the web&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The shopping cart is the ultimate litmus test for whether a person is capable of self-governing.&lt;/p&gt;

  &lt;p&gt;To return the shopping cart is an easy, convenient task and one which we all recognize as the correct , appropriate thing to do. To return the shopping cart is objectively right. There are no situations other than dire emergencies in which a person is not able to return their cart. Simultaneously, it is not illegal to abandon your shopping cart. Therefore the shopping cart presents itself as the apex example of whether a person will do what is right without being forced to do it. No one will punish you for not returning the shopping cart, no one will fine you or kill you for not returning the shopping cart. You must return the shopping cart out of the goodness of your own heart. You must return the shopping cart because it is the right thing to do. Because it is correct.&lt;/p&gt;

  &lt;p&gt;A person who is unable to do this is no better than an animal, an absolute savage who can only be made to do what is right by threatening them with a law and the force that stands behind it.&lt;/p&gt;

  &lt;p&gt;The Shopping Cart is what determines whether a person is a good or bad member of society.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Pricing Information</title>
   <link href="https://blog.mptc.uk/posts/Pricing-Information"/>
   <updated>2020-09-10T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Pricing-Information</id>
   <content type="html">&lt;p&gt;Expected Opportunity Loss is a simple yet powerful way to price information, first introduced to me in Douglas’ Hubbard’s book “&lt;a href=&quot;https://www.goodreads.com/book/show/444653.How_to_Measure_Anything&quot;&gt;How To Measure Anything&lt;/a&gt;”&lt;/p&gt;

&lt;p&gt;After reading it, the concept is simple: In many situations we have to make decisions under uncertainty, and as such after the fact we will discover that we could have made a better choice, that is, we missed an opportunity. By quantifying the likelihood of uncertain events, we can understand how much we expect to miss out and either make better decisions based on this value, or gather more information.&lt;/p&gt;

&lt;p&gt;To start with an unrealistically simple event, you choose heads or tails, I flip a coin and if you got heads correct you receive $ 10€ $, if you got tails correct you receive $ 20€ $.&lt;/p&gt;

&lt;p&gt;You have to choices:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;You say Heads:&lt;/strong&gt; There’s a 50% chance you get heads, which is optimal, so you lost out nothing, and a 50% chance you get tails, which would have made you $ 20€ $ richer, so your opportunity loss is $ .5 * (0) + .5 * (20) = 10 $&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;You say Tails:&lt;/strong&gt; There’s a 50% chance you get tails, which is optimal, so you lost out nothing, and a 50% chance you get heads, which would have made you $ 10€ $ richer, so your opportunity loss is $ .5 * (0) + .5 * (10) = 5 $&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Under a regret minimization system, this makes it clear that we want to choose Tails. This should have been obvious from before, but there is something we gained from this analysis. Under our optimal choice our expected loss is $ 5€ $, so if we paid any amount smaller than $ 5€ $ to know the coin in advance, we would expect higher returns than if we didn’t take that option. In other words, knowing the outcome of this event is worth $ 5€ $ to us: any value above that and we will be missing out on some opportunity. Any value below it and we can increase our expected profits.&lt;/p&gt;

&lt;p&gt;The above is detached from reality, but instead of heads or tails suppose we are talking about presidential candidates getting elected, or investing in a new stock. Add a few zeroes to the values above and we will get a realistic price for getting information on the outcome, by doing voting polls or other mechanisms available to our situation.&lt;/p&gt;

&lt;p&gt;This can be done for any decisions made under uncertainty (as Douglas Hubbard argues in his book).&lt;/p&gt;

&lt;p&gt;I have written up this Information Pricing mechanism in my &lt;a href=&quot;https://notes.mptc.uk/Math/Probability/Expected-Opportunity-Loss&quot;&gt;notes on Expected Opportunity Loss&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>First Sign of Civilization</title>
   <link href="https://blog.mptc.uk/posts/First-Sign-Of-Civilization"/>
   <updated>2020-09-08T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/First-Sign-Of-Civilization</id>
   <content type="html">&lt;p&gt;Excerpt found on the web&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Years ago, anthropologist Margaret Mead was asked by a student what she considered to be the first sign of civilization in a culture. The student expected Mead to talk about fishhooks or clay pots or grinding stones&lt;/p&gt;

  &lt;p&gt;But no. Mead said that the first sign of civilization in an ancient culture was a femur (thigh bone ) that had been broken and then healed. Mead explained that in the animal kingdom, if you break your leg, you die. You cannot run from danger, get to the river for a drink or hunt for food. You are meat for the prowling beasts. No animal survives a broken leg long enough for the bone to heal.&lt;/p&gt;

  &lt;p&gt;A broken femur that has healed is evidence that someone has taken time to stay with the one who fell, has bound up the wound, has carried the person to safety and has tended the person through recovery. Helping someone else through the difficulty is where civilization starts, Mead said.&lt;/p&gt;

  &lt;p&gt;We are at our best when we serve others. Be civilized.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ira Byock&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Perfect Forecasting</title>
   <link href="https://blog.mptc.uk/posts/perfect-forecasting"/>
   <updated>2020-08-19T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/perfect-forecasting</id>
   <content type="html">&lt;p&gt;The chapters below are an aggregation of thoughts around the theme of forecasting, not necessarily in a ready to present form, for a problem of joint decision making. We have society wide problems we need to agree on, such as which drugs should be illegal, which laws to pass, whether to implement an Universal Basic Income, and many other potentially controversial topics, and these topics are informed on forecasts that might turn out to be or not accurate.&lt;/p&gt;

&lt;p&gt;We have played around with many&lt;/p&gt;

&lt;p class=&quot;message&quot;&gt;
  How can we aggregate multiple distinct forecasts into a single, more accurate, view.
&lt;/p&gt;

&lt;h1 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h1&gt;

&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#table-of-contents&quot; id=&quot;markdown-toc-table-of-contents&quot;&gt;Table of Contents&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#assumptions-for-this-quest&quot; id=&quot;markdown-toc-assumptions-for-this-quest&quot;&gt;Assumptions for this quest&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#event-outcomes-are-not-just-true-and-false&quot; id=&quot;markdown-toc-event-outcomes-are-not-just-true-and-false&quot;&gt;Event outcomes are not just true and false&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#we-cannot-observe-the-underlying-probability-of-events-only-the-outcome&quot; id=&quot;markdown-toc-we-cannot-observe-the-underlying-probability-of-events-only-the-outcome&quot;&gt;We cannot observe the underlying probability of events, only the outcome&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#the-value-of-better-forecasts-can-be-quantified&quot; id=&quot;markdown-toc-the-value-of-better-forecasts-can-be-quantified&quot;&gt;The value of better forecasts can be quantified&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#existing-companies-in-this-area&quot; id=&quot;markdown-toc-existing-companies-in-this-area&quot;&gt;Existing companies in this area&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#good-judgement-project&quot; id=&quot;markdown-toc-good-judgement-project&quot;&gt;Good Judgement Project&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#foretold&quot; id=&quot;markdown-toc-foretold&quot;&gt;Foretold&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#metaculus&quot; id=&quot;markdown-toc-metaculus&quot;&gt;Metaculus&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#augur&quot; id=&quot;markdown-toc-augur&quot;&gt;Augur&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#forecastapp-aka-facebook&quot; id=&quot;markdown-toc-forecastapp-aka-facebook&quot;&gt;Forecastapp aka Facebook&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#the-future&quot; id=&quot;markdown-toc-the-future&quot;&gt;The Future&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;assumptions-for-this-quest&quot;&gt;Assumptions for this quest&lt;/h1&gt;

&lt;p&gt;The quest for perfect forecasting started a few years back, with a few assumptions from my side:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;All future events can be assigned a likelihood of happening, between 0% and 100%&lt;/li&gt;
  &lt;li&gt;Due to different backgrounds and contexts, incompatible perspectives exist about the likelihood of many of these events.&lt;/li&gt;
  &lt;li&gt;The above can still be aggregated into a single “best” forecast using the correct system.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;event-outcomes-are-not-just-true-and-false&quot;&gt;Event outcomes are not just true and false&lt;/h1&gt;

&lt;p&gt;Before we start talking about perfect forecasting, we should understand what problems we would like to forecast. These could be statements such as:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Facebook will go bankrupt before 2050&lt;/li&gt;
  &lt;li&gt;A baby will be born outside of Earth before 2100&lt;/li&gt;
  &lt;li&gt;A debt financial bubble will burst before 2025&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These all seem rather trivial to check if they are true or not, however imagine the respective situations:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Facebook incorporates under a parent company, similar to Google and Alphabet, which acquires WhatsApp, Instagram and other Facebook owned companies. These surpass Facebook in size so Facebook eventually closes, but not the parent company. You could argue that technically Facebook closed, but you could also argue that the entire group just rebranded under the parent company.&lt;/li&gt;
  &lt;li&gt;Outer orbit flights become normal practice for long haul flights due to cheaper costs, and a baby is born in these flights. This is technically outside Earth’s atmosphere, but Earth is still the closest space body, making the outcome unclear.&lt;/li&gt;
  &lt;li&gt;A financial bubble bursts, but the origin is unclear.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From this there are 2 main action points I take in order to make:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Event outcomes always have a grey area, so they might be true, false or unclear. We need to take this into account when building forecasting metrics.&lt;/li&gt;
  &lt;li&gt;For better forecasting, it is worthwhile spending some time working out and removing the grey areas, by specifying terms and possible outcomes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;we-cannot-observe-the-underlying-probability-of-events-only-the-outcome&quot;&gt;We cannot observe the underlying probability of events, only the outcome&lt;/h1&gt;

&lt;p&gt;Assume everyday I launch a die, and we forecast the statement&lt;/p&gt;
&lt;p class=&quot;message&quot;&gt;
  The die will show the number 6 up
&lt;/p&gt;
&lt;p&gt;For practical purposes this can’t be predicted with certainty. What we can do is still make the forecast that this statement has a $ \frac{1}{6} \approx 16.6 \% $ probability of being true. However after the event, we will either observe that the statement is true or not, we cannot observe the underlying probability.&lt;/p&gt;

&lt;p&gt;As such overconfidence might be rewarded or punished based on chance. What we can ensure is that after enough of these events we can distinguish the best and worst forecasts by using reward functions that incentivize honesty. These are called &lt;a href=&quot;https://en.wikipedia.org/wiki/Scoring_rule#Proper_scoring_rules&quot;&gt;Proper scoring rules&lt;/a&gt;.&lt;/p&gt;

&lt;h1 id=&quot;the-value-of-better-forecasts-can-be-quantified&quot;&gt;The value of better forecasts can be quantified&lt;/h1&gt;

&lt;p&gt;The best book on this topic is &lt;a href=&quot;https://hubbardresearch.com/publications/how-to-measure-anything-book/&quot;&gt;How to Measure Anything: Finding the Value of Intangibles in Business&lt;/a&gt; by Douglas W. Hubbard. Most of the book is spent on showing that all events that we care about can be measured, and convincingly so. A single chapter was dedicating to pricing information into a lot of detail. I have &lt;a href=&quot;https://notes.mptc.uk/Math/Probability/Expected-Opportunity-Loss&quot;&gt;notes on Expected Opportunity Loss&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The key idea can be made clear by using an example. Assume that quantum computers might become a reality, and you can decide to invest on a startup in that area. For simplicity reasons, we will assume the 4 possible outcomes listed below, with full certainty of Return on Investment:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt; &lt;/th&gt;
      &lt;th&gt;Quantum computers are created before 2025&lt;/th&gt;
      &lt;th&gt;Quantum computers are not created before 2025&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;You invest in a Quantum computer company&lt;/td&gt;
      &lt;td&gt;You get 10 million EUR in return&lt;/td&gt;
      &lt;td&gt;You lose 1 million EUR (your initial investment)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;You don’t invest in a quantum computer company&lt;/td&gt;
      &lt;td&gt;You neither lose nor get money&lt;/td&gt;
      &lt;td&gt;You neither lose nor get money&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Further, the probability of Quantum Computers being created before 2025 is $p$.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;If we invest in a Quantum Computer company, the Expected Loss is given by $p(0) + (1-p)(1) = (1-p)$ million EUR.&lt;/li&gt;
  &lt;li&gt;If we don’tinvest, the expected loss is given by $ p(10) + (1-p)(0) = 10p $ million USD&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As such we should invest iff $p&amp;gt;\frac{1}{11}$, as can be seen by this table of Opportunity Losses in million EUR:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$p$&lt;/th&gt;
      &lt;th&gt;$0$&lt;/th&gt;
      &lt;th&gt;$\frac{1}{11}$&lt;/th&gt;
      &lt;th&gt;$\frac{1}{2}$&lt;/th&gt;
      &lt;th&gt;$1$&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;If we invest&lt;/td&gt;
      &lt;td&gt;$1€$&lt;/td&gt;
      &lt;td&gt;$\frac{10}{11}€$&lt;/td&gt;
      &lt;td&gt;$\frac{1}{2}€$&lt;/td&gt;
      &lt;td&gt;$0€$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;If we don’t invest&lt;/td&gt;
      &lt;td&gt;$0€$&lt;/td&gt;
      &lt;td&gt;$\frac{10}{11}€$&lt;/td&gt;
      &lt;td&gt;$\frac{10}{2}€ = 5€$&lt;/td&gt;
      &lt;td&gt;$10€$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The key idea is that whenever a decision is made under uncertainty, you will lose money by making a non optimal decision. The Expected Opportunity Loss can be measured, and be reduced by reducing uncertainty around the unknown variables. As such say that currently $p=\frac{1}{2}$. By the optimal table the optimal decision is to invest, with an expected opportunity loss of half a million EUR. This means that for the possibilition to know now whether Quantum computers will be created before 2025 or not, any price below half a million EUR will still give us a profit. This is the price of perfect information for this unknown.&lt;/p&gt;

&lt;p&gt;Note that this is a simplified example of a much more complex world: Not only do we have to take into account way more variables, we also often don’t have the possibility of fully reducing uncertainty, we can only get better measurements. Hubbard built a successful life around these measurements, and you can read more in my &lt;a href=&quot;https://notes.mptc.uk/Math/Probability/Expected-Opportunity-Loss&quot;&gt;notes on Expected Opportunity Loss&lt;/a&gt;.&lt;/p&gt;

&lt;h1 id=&quot;existing-companies-in-this-area&quot;&gt;Existing companies in this area&lt;/h1&gt;

&lt;p&gt;At this point the opportunity in this area consists in building a platform for anyone to submit statements of interest for themselves, and other users to submit forecasts. With this we can rank users according to their forecasting abilities, and use this metrics to build smart aggregate forecasts.&lt;/p&gt;

&lt;h2 id=&quot;good-judgement-project&quot;&gt;Good Judgement Project&lt;/h2&gt;

&lt;p&gt;Arguably &lt;a href=&quot;https://goodjudgment.com/&quot;&gt;Good Judgement Project (gjp)&lt;/a&gt; are the first to the field, with the findings from their results being detailed in the book &lt;a href=&quot;https://www.goodreads.com/book/show/23995360-superforecasting?ac=1&amp;amp;from_search=true&amp;amp;qid=q7eXoBLCRh&amp;amp;rank=1&quot;&gt;Superforecasting: The Art and Science of Prediction&lt;/a&gt;. The biggest shortcoming from gjp is that they filter all their questions for forecasting, and as such it is harder for users to submit questions they find interesting.&lt;/p&gt;

&lt;h2 id=&quot;foretold&quot;&gt;Foretold&lt;/h2&gt;

&lt;p&gt;The backend and flexibility of inputs on &lt;a href=&quot;https://www.foretold.io&quot;&gt;foretold&lt;/a&gt; is impressive, however they lack an intuitive User Interface. As such the existing user base has stagnated.&lt;/p&gt;

&lt;h2 id=&quot;metaculus&quot;&gt;Metaculus&lt;/h2&gt;

&lt;p&gt;With the biggest user base, &lt;a href=&quot;https://www.metaculus.com&quot;&gt;Metaculus&lt;/a&gt; has existed since 2015 and focuses on building questions with very well defined outcomes, covering many different &lt;a href=&quot;https://www.metaculus.com/questions/categories/&quot;&gt;categories&lt;/a&gt;. Since their approval process for new questions is incredibly thorough, they’ve built a backlog of non yet accepted questions that only promises to grow.&lt;/p&gt;

&lt;h2 id=&quot;augur&quot;&gt;Augur&lt;/h2&gt;

&lt;p&gt;Most of the forecasting platforms above have to conform to laws in their areas. &lt;a href=&quot;https://www.augur.net/&quot;&gt;Augur&lt;/a&gt; does not for the same reason that &lt;a href=&quot;https://bitcoin.org&quot;&gt;Bitcoin&lt;/a&gt; does not: They are decentralized peer 2 peer networks. Instead of focusing on forecasts, Augur creates pair of coins for each statement, which trade independently of each other. However, one coin is only worth anything if the statement is true, and the other coin follows the reverse. As such these coins are traded on the basis of expected values, and we can extract forecasts from the market based on this idea.&lt;/p&gt;

&lt;p&gt;Since no company controls Augur (similarly to how no company controls Bitcoin), then Augur does not need to worry about any issues with insider trading, assassination markets or other nefarious systems that arise if platforms are left unregulated.&lt;/p&gt;

&lt;h2 id=&quot;forecastapp-aka-facebook&quot;&gt;Forecastapp aka Facebook&lt;/h2&gt;

&lt;p&gt;The latest entrant to the group, Facebook has launched &lt;a href=&quot;https://forecastapp.net/&quot;&gt;forecastapp&lt;/a&gt; to crowdsource forecasts. Given their dominance in the social network world this makes it easier for them to gather forecasters, however their existing page on forecasting is still very simple so in beta testing, meaning that it is still unclear how the platform will evolve.&lt;/p&gt;

&lt;h1 id=&quot;the-future&quot;&gt;The Future&lt;/h1&gt;

&lt;p&gt;There’s an opportunity here to improve this platform. Can you do it?&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Hardest Logic Puzzle Ever</title>
   <link href="https://blog.mptc.uk/posts/The-Hardest-Logic-Puzzle-Ever"/>
   <updated>2020-07-25T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/The-Hardest-Logic-Puzzle-Ever</id>
   <content type="html">&lt;p&gt;I was recently given &lt;a href=&quot;https://en.wikipedia.org/wiki/The_Hardest_Logic_Puzzle_Ever&quot;&gt;“The Hardest Logic Puzzle Ever”&lt;/a&gt;, which can be stated as follows:&lt;/p&gt;

&lt;p&gt;Three gods A, B, and C are called, in no particular order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are da and ja, in some order. You do not know which word means which.&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;h3 id=&quot;finding-the-solution&quot;&gt;Finding the solution&lt;/h3&gt;

&lt;p&gt;The first step in finding a solution is to know whether a solution exists or not. We start with having three goods, \((A,B,C)\), and we want to know which of the following triplets represents the gods:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;\((True, False, Random)\).&lt;/li&gt;
  &lt;li&gt;\((True, Random, False)\).&lt;/li&gt;
  &lt;li&gt;\((False, True, Random)\).&lt;/li&gt;
  &lt;li&gt;\((False, Random, True)\).&lt;/li&gt;
  &lt;li&gt;\((Random, True, False)\).&lt;/li&gt;
  &lt;li&gt;\((Random, False, True)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So our \(3\) questions need to be able to distinguish \(6\) different possibilities. Since each question has \(2\) possible responses, we would have \(2*2*2=8\) possible outcomes.&lt;/p&gt;

&lt;h3 id=&quot;but-we-cant-distinguish-the-words-for-yes-and-no-doesnt-that-reduce-the-answers-we-are-able-to-distinguish-in-half-since-if-we-swap-all-of-the-das-and-jas-we-would-get-the-same-information&quot;&gt;But we can’t distinguish the words for yes and no. Doesn’t that reduce the answers we are able to distinguish in half, since if we swap all of the da’s and ja’s we would get the same information?&lt;/h3&gt;

&lt;p&gt;Not exactly. We are told what are the words for yes and no. Even though we don’t know which is which, we can use that information to get a yes/no answer even without knowing which is the word for yes and the word for no. As an example, suppose that I am asking whether the number \(2\) is prime. Then I could ask: &lt;em&gt;“If I ask is the number \(2\) prime and does da mean no, would you give the same answer to both questions?”&lt;/em&gt;. Looking at the True/False gods and the possibilities da=yes / da=no, we get that their answers will be:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;True God, da=yes&lt;/th&gt;
      &lt;th&gt;True God, da=no&lt;/th&gt;
      &lt;th&gt;False God, da=yes&lt;/th&gt;
      &lt;th&gt;False God, da=yes&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Is the number $2$ prime?&lt;/td&gt;
      &lt;td&gt;da (yes)&lt;/td&gt;
      &lt;td&gt;ja (yes)&lt;/td&gt;
      &lt;td&gt;ja (no) &lt;/td&gt;
      &lt;td&gt;da (no)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Does da mean no?&lt;/td&gt;
      &lt;td&gt;ja (no) &lt;/td&gt;
      &lt;td&gt;ja (yes) &lt;/td&gt;
      &lt;td&gt;da (yes) &lt;/td&gt;
      &lt;td&gt;da (no) &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Would you answer both questions above equally?&lt;/td&gt;
      &lt;td&gt;ja (no) &lt;/td&gt;
      &lt;td&gt;ja (yes) &lt;/td&gt;
      &lt;td&gt;da (yes) &lt;/td&gt;
      &lt;td&gt;da (no) &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;We don’t have access to whether the given answer means yes or no, but from the above it is clear that the True God answers ja, and the False da, to a clearly true statement. If We swap the question &lt;em&gt;“Is \(2\) prime?”&lt;/em&gt; for a false statement such as &lt;em&gt;“Is \(4\) prime?”&lt;/em&gt;, both the 1st and 3rd rows would swap their da’s and ja’s, so the True God would now answer da and the False God would answer ja.&lt;/p&gt;

&lt;p&gt;As such, by appending the last part &lt;em&gt;“If I asked you if \(P\) is true and if does da mean no, would you give the same answer?”&lt;/em&gt;, then I can act as if ja means yes and da means no.&lt;/p&gt;

&lt;p&gt;Therefore we can skip the part about da/ja all together, and assume we get the usual English answers yes and no from our Gods.&lt;/p&gt;

&lt;h3 id=&quot;awesome-but-what-about-the-random-god&quot;&gt;Awesome, but what about the Random God?&lt;/h3&gt;

&lt;p&gt;The random God can indeed be a problem: The True / False Gods give us a lot of information (1 bit to be exact) whenever we ask a question, however The Random God introduces noise to the system. In particular when we ask the first question, because of the \(1/3\) probability of there being a random God, we only get \(1 \frac{1}{3} + 1 \frac{1}{3} + 0 \frac{1}{3} = \frac{2}{3}\) bits of information from our first question. As such instead of getting \(3\) bits from \(3\) questions, we only get \(2+\frac{2}{3} \approx 2.66\) bits. This however is still larger than the \(log_2(6) = 2.58\) bits of information needed to know which God is which, so it would still be possible to solve this question.&lt;/p&gt;

&lt;h3 id=&quot;what-do-you-mean-bits-of-information&quot;&gt;What do you mean bits of information?&lt;/h3&gt;

&lt;p&gt;This was a concept introduced by &lt;a href=&quot;https://en.wikipedia.org/wiki/Claude_Shannon&quot;&gt;Claude Shannon&lt;/a&gt; in his thesis &lt;a href=&quot;http://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf&quot;&gt;A Mathematical Theory of Communication&lt;/a&gt;. Make sure to check out his documentary &lt;a href=&quot;https://thebitplayer.com/&quot;&gt;The Bit Player&lt;/a&gt; if you want to learn more about the man behind the myth :) One of the key ideas introduced in that paper is a measure of information ( i.e. &lt;a href=&quot;https://en.wikipedia.org/wiki/Entropy&quot;&gt;Entropy&lt;/a&gt; ) and can be measured in bits, which stands for binary digits. Each yes/no answer provides a bit of information, however that depends on the uncertainty of getting a yes/no answer. If we know that in Portugal it rains only 5% of the time, you telling me that it is not raining tomorrow does not give as much information as if there was a 50 / 50 chance of rain: Even without knowing the outcome I already could have made a very good guess to start with.&lt;/p&gt;

&lt;p&gt;In the problem we are facing, we have \(6\) options, and, as per Shannon’s work, this means we need \(log_2(6) = 2.58\) bits of information. Each bit of information allows us to decrease the number of possible outcomes in half (or the ceiling of half), so with 1 bit we can go from \(6\) options to \(3\), another bit allows us to go to from \(3\) to \(\left \lceil 1.5 \right \rceil  = 2\), and the last bit from \(2\) to \(1\) possibility (the final answer).&lt;/p&gt;

&lt;h3 id=&quot;alright-so-how-do-we-go-from-here-to-an-answer&quot;&gt;Alright, so how do we go from here to an answer?&lt;/h3&gt;

&lt;p&gt;Everything above was done to ensure we weren’t spending time on an impossible question, as many logic problems end up being. We need to ask \(3\) questions that will filter our options to \(1\). We need to ask an initial question which will give us 4 possible outcomes: the reason for that is that, looking at the possible orderings, there are \(2\) in \(6\) people that will answer truthfully, the same for lying, but then the \(2\) options answered randomly can fall in any of the 2 cases above).&lt;/p&gt;

&lt;p&gt;Let us start with asking the question &lt;em&gt;“Is 2 prime?”&lt;/em&gt; to the first God. Since we know this to be true, we can distinguish True and False Gods, but not Random. As such if the answer is yes we get the possible orderings&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;\((True, False, Random)\).&lt;/li&gt;
  &lt;li&gt;\((True, Random, False)\).&lt;/li&gt;
  &lt;li&gt;\((Random, True, False)\).&lt;/li&gt;
  &lt;li&gt;\((Random, False, True)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;where as if it false, we get the possible orderings&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;\((False, True, Random)\).&lt;/li&gt;
  &lt;li&gt;\((False, Random, True)\).&lt;/li&gt;
  &lt;li&gt;\((Random, True, False)\).&lt;/li&gt;
  &lt;li&gt;\((Random, False, True)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In both cases we get \(4\) options. Since we have 2 questions left, we need to ensure that at each point we reduce the number of possibilities in half. There is a problem though: In every column above there is at least one row containing the Random God. The reason this is problematic is because we will not be able to distinguish the Random God from the most common God in that column, and as such there is always the possibility that we will end up with three options after getting the answer to our question.&lt;/p&gt;

&lt;p&gt;What we need is a way of getting \(4\) options, similar to the above, but Random God free columns. The only way to find such a question is to play around with possible questions to ask, and eventually I was able to find such a question: &lt;em&gt;“Are you sitting in the cycle order True, False, Random?”&lt;/em&gt;, or in other words, are you in one of the three following orderings?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;\((True, False, Random)\).&lt;/li&gt;
  &lt;li&gt;\((False, Random, True)\).&lt;/li&gt;
  &lt;li&gt;\((Random, True, False)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s look at the different answers:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;\((True, False, Random)\): The answer is yes, and since we ask a True God we get yes.&lt;/li&gt;
  &lt;li&gt;\((True, Random, False)\). The answer is no, and since we ask a True God we get no.&lt;/li&gt;
  &lt;li&gt;\((False, True, Random)\). The answer is no and since we ask a False God we get yes&lt;/li&gt;
  &lt;li&gt;\((False, Random, True)\). The answer is yes, and since we ask a False God we get no.&lt;/li&gt;
  &lt;li&gt;\((Random, True, False)\). Random God, so anything goes.&lt;/li&gt;
  &lt;li&gt;\((Random, False, True)\). Random God, so anything goes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hence, if we get the answer yes, the possibilities are&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;\((True, False, Random)\).&lt;/li&gt;
  &lt;li&gt;\((False, True, Random)\).&lt;/li&gt;
  &lt;li&gt;\((Random, True, False)\).&lt;/li&gt;
  &lt;li&gt;\((Random, False, True)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And if the answer is no, the possibilities are&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;\((True, Random, False)\).&lt;/li&gt;
  &lt;li&gt;\((False, Random, True)\).&lt;/li&gt;
  &lt;li&gt;\((Random, True, False)\).&lt;/li&gt;
  &lt;li&gt;\((Random, False, True)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We see that in the first case we can ask the 2nd God the remaining questions, knowing that they will not be random, and in the second case we can ask the 3rd God similarly. As such our job becomes much easier: We first ask the definitely non random God &lt;em&gt;“Is 2 Prime?””&lt;/em&gt; This will allows us to half the number of possibilities by telling us whether we are talking to the True or False God. Once we know that we will end up in one of the 4 possibilities:&lt;/p&gt;

&lt;h4 id=&quot;case-a&quot;&gt;Case A&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;\((False, True, Random)\).&lt;/li&gt;
  &lt;li&gt;\((Random, True, False)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;case-b&quot;&gt;Case B&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;\((True, False, Random)\).&lt;/li&gt;
  &lt;li&gt;\((Random, False, True)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;case-c&quot;&gt;Case C&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;\((False, Random, True)\).&lt;/li&gt;
  &lt;li&gt;\((Random, False, True)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;case-d&quot;&gt;Case D&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;\((True, Random, False)\).&lt;/li&gt;
  &lt;li&gt;\((Random, True, False)\).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of those can be solved by asking the Gods we know with certainty whether the first God is random, and then we adjust the answer to the fact that we are talking to the True or False God.&lt;/p&gt;

&lt;h3 id=&quot;so-were-done-hurray&quot;&gt;So we’re done, hurray!&lt;/h3&gt;

&lt;p&gt;Pretty much. We skipped the da / ja instead of yes / no answers, so let’s just make our answer proper.&lt;/p&gt;

&lt;h3 id=&quot;the-answer&quot;&gt;The answer&lt;/h3&gt;

&lt;p&gt;By using the trick &lt;em&gt;“If I asked you if \(P\) is true and if does da mean no, would you give the same answer?”&lt;/em&gt;, we can act as if da means yes for the statement &lt;em&gt;“Is \(P\) true?”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;We ask the first God:
&lt;em&gt;“If I asked if you are sitting in the cycle order True/False/Random and if da means no, would you give the same answer?”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If the answer is da (yes), we end up with the certainty of a non random God in the 2nd position. Similarly, ja (no) gives us a definitely non random God in the third position.&lt;/p&gt;

&lt;p&gt;Then we discover if the God is True or False by asking &lt;em&gt;“If I asked if \(2\) is prime and if da means no, would you give the same answer?”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Lastly we know the other Gods by finalizing with &lt;em&gt;“If I asked if the first God is the Random God and if da means no, would you give the same answer?”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Remark: Notice that in the solution above we never figure out if da means yes or no. This is impossible given the current setting: If we were to figure out not only the gods positions, which contains \(log_2(6) = 2.58\) bits of information, but also if da=yes for a total of \(2.58+1 = 3.58\) bits of information, we would need more than three binary questions which only give us \(3\) bits of information.&lt;/em&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Online Mafia Rule book</title>
   <link href="https://blog.mptc.uk/posts/Online-Mafia-Rulebook"/>
   <updated>2020-04-02T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Online-Mafia-Rulebook</id>
   <content type="html">&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#game-overview&quot; id=&quot;markdown-toc-game-overview&quot;&gt;Game Overview&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#requirements&quot; id=&quot;markdown-toc-requirements&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#setup&quot; id=&quot;markdown-toc-setup&quot;&gt;Setup&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#characters&quot; id=&quot;markdown-toc-characters&quot;&gt;Characters&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#practical-notes&quot; id=&quot;markdown-toc-practical-notes&quot;&gt;Practical notes&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#mafia-20-ongoing&quot; id=&quot;markdown-toc-mafia-20-ongoing&quot;&gt;Mafia 2.0 (Ongoing)&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#original-roles&quot; id=&quot;markdown-toc-original-roles&quot;&gt;Original Roles&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#players-15-alive&quot; id=&quot;markdown-toc-players-15-alive&quot;&gt;Players (15 alive)&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#1st-day-message&quot; id=&quot;markdown-toc-1st-day-message&quot;&gt;1st day message&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#1st-day-votes&quot; id=&quot;markdown-toc-1st-day-votes&quot;&gt;1st day votes&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#2nd-day-message&quot; id=&quot;markdown-toc-2nd-day-message&quot;&gt;2nd day message&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#2nd-day-votes&quot; id=&quot;markdown-toc-2nd-day-votes&quot;&gt;2nd day votes&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#3rd-day-message&quot; id=&quot;markdown-toc-3rd-day-message&quot;&gt;3rd day message&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#3rd-day-votes&quot; id=&quot;markdown-toc-3rd-day-votes&quot;&gt;3rd day votes&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#4th-day-message&quot; id=&quot;markdown-toc-4th-day-message&quot;&gt;4th day message&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#mafia-10-finished-game&quot; id=&quot;markdown-toc-mafia-10-finished-game&quot;&gt;Mafia 1.0 (Finished Game)&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#original-roles-1&quot; id=&quot;markdown-toc-original-roles-1&quot;&gt;Original Roles&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#dead-people&quot; id=&quot;markdown-toc-dead-people&quot;&gt;Dead People&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#1st-day-message-1&quot; id=&quot;markdown-toc-1st-day-message-1&quot;&gt;1st day message&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#1st-day-final-vote-count&quot; id=&quot;markdown-toc-1st-day-final-vote-count&quot;&gt;1st day final vote count&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#2nd-day-message-1&quot; id=&quot;markdown-toc-2nd-day-message-1&quot;&gt;2nd day message&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#2nd-day-final-vote-count&quot; id=&quot;markdown-toc-2nd-day-final-vote-count&quot;&gt;2nd day final vote count&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#3rd-day-message-1&quot; id=&quot;markdown-toc-3rd-day-message-1&quot;&gt;3rd day message&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#3rd-day-final-vote-count&quot; id=&quot;markdown-toc-3rd-day-final-vote-count&quot;&gt;3rd day final vote count&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#4th-day-message-1&quot; id=&quot;markdown-toc-4th-day-message-1&quot;&gt;4th day message&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#4th-day-final-vote-count&quot; id=&quot;markdown-toc-4th-day-final-vote-count&quot;&gt;4th day final vote count&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#5th-day-message&quot; id=&quot;markdown-toc-5th-day-message&quot;&gt;5th day message&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#5th-day-final-vote-count&quot; id=&quot;markdown-toc-5th-day-final-vote-count&quot;&gt;5th day final vote count&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#6th-day-message&quot; id=&quot;markdown-toc-6th-day-message&quot;&gt;6th day message&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#6th-day-final-vote-count&quot; id=&quot;markdown-toc-6th-day-final-vote-count&quot;&gt;6th day final vote count&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#7th-day-message&quot; id=&quot;markdown-toc-7th-day-message&quot;&gt;7th day message&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;game-overview&quot;&gt;Game Overview&lt;/h2&gt;

&lt;p&gt;There is a narrator that will guide the game. Everyone else will be randomly split into 2 teams: the Mafia and the Townspeople. The Mafia All know each other and want to pretend to be townspeople while killing of the townspeople one by one. The Townspeople want to discover who among them are part of the Mafia.&lt;/p&gt;

&lt;h3 id=&quot;requirements&quot;&gt;Requirements&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;WhatsApp Group Chat&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;setup&quot;&gt;Setup&lt;/h3&gt;

&lt;p&gt;The moderator randomly distributes the characters (listed below). There are 2 stages, day and night, which keep alternating until everyone from one of the side dies. The game starts in the day phase, in order to avoid having some character die before they have an opportunity to play.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Night:&lt;/strong&gt; Each of the characters practice the role they were assigned. The essential role that can never be missed is the one performed by the mafia: They choose a townsperson to kill. During this phase the WhatsApp Group will have messages disabled.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Day:&lt;/strong&gt; The narrator announces all the events that happened during the night. After that, messages are enabled and the townspeople start debating in the chat about who they think the mafia are or are not, based on everything that happened during nighttime. As people debate each selects the person they want to see lynched, and once someone gets a majority they are selected to be lynched. The narrator announces the character they were assigned, and we move to the night. When someone dies they are removed from the chat to keep it clear who is still playing, and to avoid comments from the departed :P&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;characters&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;MAFIA:&lt;/strong&gt; You are Mafia. Do not ask questions about your role in the group, only to me directly. Every night you and your mates will select someone to kill. That person dies unless the doctor chose to save that person.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;GODFATHER:&lt;/strong&gt; You are the godfather. Do not ask questions about your role in the group, only to me directly. Every night you and your mates will select someone to kill. That person dies unless the doctor chose to save that person. If you don’t decide together on who to kill, you have the final vote. If the cop investigates you during the night, he sees you as a normal victim.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;RECRUITER:&lt;/strong&gt; You are the recruiter, playing for the mafia. Do not ask questions about your role in the group, only to me directly. Once in the game you can propose another player to be recruited with a personalized text. That player can either chose to join you and the mafia, or reject the offer. They will not know who you are.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;LURKER:&lt;/strong&gt; You are the lurker, and play for the mafia. Do not ask questions about your role in the group, only to me directly. Every night you can lurk around someone’s home, and you will know everything that happened with them.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;DETECTIVE:&lt;/strong&gt; You are the detective. Do not ask questions about your role in the group, only to me directly. Every night you can choose a person to investigate, and i will tell you if that person is mafia or not. The godfather appears as a normal person.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;DOCTOR:&lt;/strong&gt; You are the doctor. Do not ask questions about your role in the group, only to me directly. Every night you choose someone to save. If that is the person the mafia chose to kill, that person does not die.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;PROSTITUTE:&lt;/strong&gt; You are the prostitute. Do not ask questions about your role in the group, only to me directly. Every night you chose someone to spend the night with. Any special powers that person might have used don’t take effect.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;DRUNK:&lt;/strong&gt; You are the town drunk. Do not ask questions about your role in the group, only to me directly. Every night you chose someone to drink with. That person knows they got drunk, and any special powers they had are not used. Neither of you remember the previous night.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;BAKER:&lt;/strong&gt; You are the best character anyone could be, the baker! Do not ask questions about your role in the group, only to me directly. Every night you chose a person and send them a cake, with any description your sick little head can think of. Game cues, plain insults, everything is welcomed :D I hope it wasn’t too obvious that I love this character. The cake you send will be seen by the entire town.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;AGORAPHOBE:&lt;/strong&gt; You are the agoraphobe. Do not ask questions about your role in the group, only to me directly. Due to your fear of the mafia, every day you can choose to hide in someone else’s home. If so, actions target at you will not take effect, but whathever happens to the person you are with will happen to you too.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;TOWNSPEOPLE:&lt;/strong&gt; You are a towns person. Do not ask questions about your role in the group, only to me directly. Even though you have no special powers at night, your role is to find the mafia: Interpret everything that happened during the day to figure out who is telling the truth and who is manipulating the game.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;TRAITOR:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;practical-notes&quot;&gt;Practical notes&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Couples in the group. Do not reveal your character to each other. That kind of ruins the game.&lt;/li&gt;
  &lt;li&gt;Votes must be written in this chat with two equal signes, such as : “== I Miguel vote to lynch “, and nowhere else. This is done in order to make vote counting easier (i.e. I can just search for “==” to count the votes). Messages without == do not count as votes.&lt;/li&gt;
  &lt;li&gt;People who haven’t voted yet count as having voted in themselves.&lt;/li&gt;
  &lt;li&gt;Votes cannot be removed, only changed to another person. (i.e. I can’t say I take may vote away from person X, but I can say that I vote now for person Y, in fact removing my previous vote).&lt;/li&gt;
  &lt;li&gt;I will be counting the votes. If there is a majority that person gets killed and the role is revealed.&lt;/li&gt;
  &lt;li&gt;The first person to vote is a personal hero of mine for kick starting the votes.&lt;/li&gt;
  &lt;li&gt;If after 2 days there is no majority, I will lock the possible lynchees to those who already have votes from others. After that every day I will be removing the least voted person until one is left.&lt;/li&gt;
  &lt;li&gt;Don’t worry about knowing all the game rules, just vote and see how it flows :P&lt;/li&gt;
  &lt;li&gt;If you want to ask questions about your role or anything that might reveal your character, ask the question to me personally. I will post the answer in the group chat for everyone to read.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;mafia-20-ongoing&quot;&gt;Mafia 2.0 (Ongoing)&lt;/h2&gt;
&lt;p&gt;We are currently in the day phase. Since there are 20 players, we need 11 votes on the same person for that person to die.&lt;/p&gt;

&lt;h3 id=&quot;original-roles&quot;&gt;Original Roles&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;1 Godfather (Mafia)&lt;/li&gt;
  &lt;li&gt;1 Lurker (Mafia)&lt;/li&gt;
  &lt;li&gt;1 Recruiter (Mafia)&lt;/li&gt;
  &lt;li&gt;2 Normal Mafia&lt;/li&gt;
  &lt;li&gt;1 Detective&lt;/li&gt;
  &lt;li&gt;1 Doctor&lt;/li&gt;
  &lt;li&gt;1 Drunk&lt;/li&gt;
  &lt;li&gt;2 Bakers&lt;/li&gt;
  &lt;li&gt;1 Agoraphobe&lt;/li&gt;
  &lt;li&gt;8 Townspeople&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;players-15-alive&quot;&gt;Players (15 alive)&lt;/h3&gt;

&lt;p&gt;Players with their role in parenthesis are dead.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Albert (agoraphobe)&lt;/li&gt;
  &lt;li&gt;Alexander (townsperson)&lt;/li&gt;
  &lt;li&gt;Ananth&lt;/li&gt;
  &lt;li&gt;Brigi (drunk)&lt;/li&gt;
  &lt;li&gt;Cheyenne&lt;/li&gt;
  &lt;li&gt;Claudia&lt;/li&gt;
  &lt;li&gt;Daria (townsperson)&lt;/li&gt;
  &lt;li&gt;David&lt;/li&gt;
  &lt;li&gt;João (townsperson)&lt;/li&gt;
  &lt;li&gt;Julian&lt;/li&gt;
  &lt;li&gt;Juul&lt;/li&gt;
  &lt;li&gt;Keith&lt;/li&gt;
  &lt;li&gt;Lennaert&lt;/li&gt;
  &lt;li&gt;Mar&lt;/li&gt;
  &lt;li&gt;Nadine&lt;/li&gt;
  &lt;li&gt;Natalia (mafia)&lt;/li&gt;
  &lt;li&gt;Pedro (townsperson)&lt;/li&gt;
  &lt;li&gt;Raluca (townsperson)&lt;/li&gt;
  &lt;li&gt;Ricardo&lt;/li&gt;
  &lt;li&gt;Sharon (townsperson)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;1st-day-message&quot;&gt;1st day message&lt;/h3&gt;

&lt;p&gt;Welcome everyone to мафия town. For those wondering what it is like to live here, have a quick peek at https://www.youtube.com/watch?v=EhdneGEWU98 . We know that among us there are villains and there are heroes, but do we know who is who? We assemble in our main square to discuss it, in the hopes that together we will not perish!&lt;/p&gt;

&lt;h3 id=&quot;1st-day-votes&quot;&gt;1st day votes&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;(11) Daria: Daria, Nadine, Joao, Albert, Claudia, Lennaert, Ananth, Pedro, Julian, Cheyenne, Sharon&lt;/li&gt;
  &lt;li&gt;(4) João: Raluca, Ricardo, Sharon, Mar&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;2nd-day-message&quot;&gt;2nd day message&lt;/h3&gt;

&lt;p&gt;Good morning good town of мафия. Apologies in advance for the unusually long night: this was due to a missing villager Brigi. Did she go missing because she trusts her mafia members to make decisions on her behalf? Is she bored of her role as a goodie do good townsperson? We don’t know. What we know is that we found ALBERT dead in the town square, his body choped up to pieces. It seems fitting of his role. Albert was the AGORAPHOBE. His fear of the mafia was justified. If only he had hidden this night in someone else’s place he would be here with us today. The town goes to the bakery for a warm coffee and cake to enjoy the first days of snow in the city and with it there is a gift. Curious, the town sees a label: “To Joao”. He does the honors of getting his rightful gift, a huge Dobos cake with a single phrase: “Life gives you a new opportunity”. Will the town have the possibility to play around and throw snow balls and build snowmans or will the mafia ruin another innocent life? While pondering this we find a second cake, directed to Ananth, stating “next party we will clean 😂”. Do we have two bakers in this town?!?
With Albert dead and Brigi missing, we are as clueless as ever as to who the mafia is. Good luck!&lt;/p&gt;

&lt;h2 id=&quot;2nd-day-votes&quot;&gt;2nd day votes&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;(6) Joao: Pedro, Claudia, Natalia, Nadine, Mar, Julian&lt;/li&gt;
  &lt;li&gt;(4) Pedro: Ananth, Lennaert, Cheyenne, Joao&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;3rd-day-message&quot;&gt;3rd day message&lt;/h2&gt;

&lt;p&gt;A new day begins and the community is absolutely gutted, devastated. They lynched someone with conviction but it was a huge mistake.
Not only that, Brigi was finally found after she left town, but she was found in tiny little pieces in our town square. She was the town DRUNK. Was her death the result of some inebriated misadventure with the mafia? We do not know.
Town goes to the bakery to burn their sorrows with sugar. The baker is crying, feels guilty for this error, with a face full of tears she has a gift in her hands.
The label says: “To Ananth”. Ananth opened the box and the town can see there is a cake with the shape of… Joao’s head! It was hard to recognize him and it’s full of blood, friends started to cry and there is a message: “Don’t forget me, we need justice”&lt;/p&gt;

&lt;h2 id=&quot;3rd-day-votes&quot;&gt;3rd day votes&lt;/h2&gt;

&lt;p&gt;(8) Pedro: Mar, Keith, Lennaert, Ananth, Ricardo, Pedro, Cheyenne, Julian
(2) Keith: Cheyenne, Claudia&lt;/p&gt;

&lt;h2 id=&quot;4th-day-message&quot;&gt;4th day message&lt;/h2&gt;

&lt;p&gt;There is no time for condolences. This has been a silent and vacant city and it will be a mafia town soon if we do not do anything. Natalia has left us and Sharon has been killed.&lt;/p&gt;

&lt;p&gt;People woke up today and they are heading to a protest in front of the detective’s office. All the community is coming out and villagers are very angry, they are asking for help. They look at each other trying to find answers.&lt;/p&gt;

&lt;p&gt;There is a proposal for a new security law, which has to be approved by the mayority. All members have to write a public statement to explain which is their role and indicate 3 suspicious people with their reason by the end of the day to ensure mafia is removed and they live in a safe place. Will the town approve this law?&lt;/p&gt;

&lt;p&gt;Suddenly people throughout the street were swivelling around to see an angry scarlet envelope that appears on Lennaert’s door, it is a Howler cake. The physical temperature of the Howler begins to rapidly increase upon delivery and it will explode if left unopened for too long. Is it true Lennaert is detective? Will the power of the Howler reveals a secret? He comes out and once opened the letter cake booms with the voice of the baker which is magnified beyond all belief. The message says: We’re gonna die. We need a proof that you are sincere, don’t lie, we dont trust anyone now. We don’t want to think you can be part of the mafia.&lt;/p&gt;

&lt;h2 id=&quot;mafia-10-finished-game&quot;&gt;Mafia 1.0 (Finished Game)&lt;/h2&gt;

&lt;p&gt;The current phase is daytime. Since there are 15 players, we need 8 votes on the same person for that person to die.&lt;/p&gt;

&lt;h3 id=&quot;original-roles-1&quot;&gt;Original Roles&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;3 Mafia&lt;/li&gt;
  &lt;li&gt;1 Godfather&lt;/li&gt;
  &lt;li&gt;1 Detective&lt;/li&gt;
  &lt;li&gt;1 Doctor&lt;/li&gt;
  &lt;li&gt;1 Prostitute&lt;/li&gt;
  &lt;li&gt;2 Bakers&lt;/li&gt;
  &lt;li&gt;6 Townspeople&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;dead-people&quot;&gt;Dead People&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Istvan Meszaros (Baker)&lt;/li&gt;
  &lt;li&gt;Cheyenne (Townsperson)&lt;/li&gt;
  &lt;li&gt;Nadine (Townsperson)&lt;/li&gt;
  &lt;li&gt;Ananth (Mafia)&lt;/li&gt;
  &lt;li&gt;Fons (Mafia)&lt;/li&gt;
  &lt;li&gt;Pedro (Townsperson)&lt;/li&gt;
  &lt;li&gt;Agnes (Mafia)&lt;/li&gt;
  &lt;li&gt;David (Prostitute)&lt;/li&gt;
  &lt;li&gt;Tushita (Baker)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;1st-day-message-1&quot;&gt;1st day message&lt;/h3&gt;

&lt;p&gt;Welcome everyone to the town of dies-ville. This is where people come to die. The sun rises and we are shocked to find something unusual. In the center of our little plaza there is a dead body. We look at it, disgusted, and it is the body of Zoltan! He left us but his death was not in vain, because with his death comes the awareness that there are criminals among us. We must ensure they do not survive. As such, in this ironically sunny day, we must select someone to die. Will it be you?&lt;/p&gt;

&lt;h3 id=&quot;1st-day-final-vote-count&quot;&gt;1st day final vote count&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;(8) &lt;strong&gt;Istvan Meszaros:&lt;/strong&gt; Istvan, Antunes, Pedro, Fons, Nadine, Ananth, Claudia, Agnes&lt;/li&gt;
  &lt;li&gt;(2) &lt;strong&gt;Antunes:&lt;/strong&gt; Cheyenne, Tushita&lt;/li&gt;
  &lt;li&gt;(2) &lt;strong&gt;Ananth:&lt;/strong&gt; Luiza, Anastasia&lt;/li&gt;
  &lt;li&gt;(1) &lt;strong&gt;Agnes:&lt;/strong&gt; David&lt;/li&gt;
  &lt;li&gt;(1) &lt;strong&gt;Fons:&lt;/strong&gt; Andi&lt;/li&gt;
  &lt;li&gt;(1) &lt;strong&gt;Pedro:&lt;/strong&gt; Mar&lt;/li&gt;
  &lt;li&gt;(1) &lt;strong&gt;Andi:&lt;/strong&gt; Pedro&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;2nd-day-message-1&quot;&gt;2nd day message&lt;/h3&gt;

&lt;p&gt;Good morning everyone! A beautiful sunset rises upon this blood shed town only for us to walk into our plaza and see… no one died! What a beautiful day it is indeed. The town goes to the bakery to enjoy it’s death free night, and with it there is a gift. Curious, the town sees a label: “To Pedro”. Pedro does the honors of getting his rightful gift, a lovely middle finger up shaped cake with a single phrase: “Stay at home or die”. Will Pedro give into this threat and follow his quarantine despite the advice of one of the worlds greats, Mr Dolan Trump, or will he rebel and jeopardize everything by venturing into the outdoors? For now, the time has come to look into lynching a mobster. Will we repeat the mistake from our previous day just to find out that we lynched one of our own?&lt;/p&gt;

&lt;h3 id=&quot;2nd-day-final-vote-count&quot;&gt;2nd day final vote count&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;(8) &lt;strong&gt;Cheyenne:&lt;/strong&gt; Tushita, Fons, Joao, Andi, Ananth, Luiza, Agnes, Claudia&lt;/li&gt;
  &lt;li&gt;(5) &lt;strong&gt;Ananth:&lt;/strong&gt; Nadine, Cheyenne, Mar, David, Pedro&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;3rd-day-message-1&quot;&gt;3rd day message&lt;/h3&gt;

&lt;p&gt;Good morning everyone! A sad day arises, not only because of the CoViD hovering over everyone’s heads, but also because the doctor has failed us this night in his endeavors. The honorable Nadine Helmi was found  hanging by her neck at her home. An house search found nothing. No detective network to get information, no magical doctor pills to bring the dead back to life, nothing. Nadine was a TOWNSPERSON. At least we have a cake to console ourselves with. We all move to the bakery and we have a cake addressed to Ananth. It is heart shaped. Love is in the air. Ananth goes for it, butterflies in his stomach as he wonders who the mystery cake sender is. He can’t wait to get to know her (damn, does he hope it is not an him). He goes for the cake and his dreams shatter. Magic takes over the cake the second Ananth touches it, changing it’s color to the darkest black anyone has ever seen. From within the black, 3 words pop up in blood red: “YOU ARE WRONG”. Ananth cries.&lt;/p&gt;

&lt;h3 id=&quot;3rd-day-final-vote-count&quot;&gt;3rd day final vote count&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;(8) &lt;strong&gt;Ananth:&lt;/strong&gt; Pedro, Claudia, Luiza, Joao, Andi, Tushita, Anastasia, Ananth&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;4th-day-message-1&quot;&gt;4th day message&lt;/h3&gt;

&lt;p&gt;Good morning everyone! A new day dawns upon our faces, with the hope of a Mafia killed but the near certainty of another victim falling pray to the mafia. Our doctor did a wonderful job the previous night, can he repeat his prowess? We wake up in hope only to see cut toe in our town plaza. A body part is a seal of something dark, but a toe? Pedro shows up with another toe. João finds a finger. Anastasia a ear. The town goes around finding chopped up body parts like it’s easter. We assemble the puzzle pieces and start building the full picture. After a fun day out playing puzzles and doing picnic, wefind the puzzle solves to be Mar. She was dead, and not only did we solve the puzzle of her body pieces, we also solved the puzzle of her role. She was a TOWNSPERSON. For the picnic, we all had a cake, as usual. This time, it was addressed to João, with the shape of a dead horse’s head. Fitting&lt;/p&gt;

&lt;h3 id=&quot;4th-day-final-vote-count&quot;&gt;4th day final vote count&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;(6) &lt;strong&gt;Fons:&lt;/strong&gt; Pedro, João, Claudia, Andrea, Tushita, David&lt;/li&gt;
  &lt;li&gt;(3) &lt;strong&gt;João:&lt;/strong&gt; Fons, Agnes, Luiza&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;5th-day-message&quot;&gt;5th day message&lt;/h3&gt;

&lt;p&gt;Good morning beautiful people of dies-ville. Another day arises in this death torn town, having had a short night after so many deaths. Wait. It isn’t death torn today. We arrive in town and nobody is dead. Could it be true? Have the mafia taken an holiday? Have they hidden their body too well for us to find it? Turns out they just hidden it, in an attempt to be discreet Pedro’s body was hidden under the Plaza’s marble floor, his body crushed between the dirt below and the marble above. Pedro was a TOWNSPERSON. As such, we relocate to the bakery. I could describe the cake, but today the baker’s words surpass my writing skills. As such, I will provide you with a direct quotation:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It’s a beautiful cake with a smiley face which smells heavenly and makes the receiver share it with everyone in town. It makes everyone think of their favorite memories and will always remake/refill itself making it an endless/never ending cake. After finishing their first slice, people realize their mouth is dripping blood. Turns out that the cake has turned to blood and it hass written “liar liar pants on fire, next time you won’t get an orgasm”.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Have a good day everyone!&lt;/p&gt;

&lt;h3 id=&quot;5th-day-final-vote-count&quot;&gt;5th day final vote count&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;(5) &lt;strong&gt;Agnes:&lt;/strong&gt; Claudia, Andi, João , Tushita, Anastasia&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;6th-day-message&quot;&gt;6th day message&lt;/h3&gt;

&lt;p&gt;Good morning people. Easter is not a time for misery and death: it is a time to be reborn and where we can cherish our closed ones, praise their well being and hope that no evil exists. Fate decided that was to be the case in dies-ville as well. No one died. No one suffered. All is good. We went to a bakery to celebrate.We get our cake. It’s a cake with a magnifying glass, classic Sherlock Holmes hat, his smoking pipe. there are a bunch of jumbled letters written all over it. The moment João touches the cake, it rearranges and says “ Your wish is fulfilled, but you suck as a cake detective”. What is the baker trying to say?&lt;/p&gt;

&lt;h3 id=&quot;6th-day-final-vote-count&quot;&gt;6th day final vote count&lt;/h3&gt;
&lt;p&gt;-(4) &lt;strong&gt;David:&lt;/strong&gt; Claudia, Anastasia, Andi, João
-(1) &lt;strong&gt;Anastasia:&lt;/strong&gt; Luiza&lt;/p&gt;

&lt;h3 id=&quot;7th-day-message&quot;&gt;7th day message&lt;/h3&gt;

&lt;p&gt;Good morning sweet people of dies-Ville. After a long exhausting night where everyone was doubting each other, wondering: Are you the godfather, the godfather did not stop in his relentless search to KILL OFF EVERYONE, So who did the godfather kill? Poor Tushita. We found her fallen forward on the street, single shot to her chest and her jaw dislocated. We can’t be sure how it happened, but I believe it was something &lt;a href=&quot;https://www.youtube.com/watch?v=sI6i0DXJYc0&quot;&gt;like this&lt;/a&gt; . She didn’t leave us without baking her last cake though, as Tushita was the BAKER. It’s a chocolate cake for Andi which says “let’s end this now”. What did Tushita mean by this?&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Marginal Losses</title>
   <link href="https://blog.mptc.uk/posts/Marginal-Losses"/>
   <updated>2019-06-25T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Marginal-Losses</id>
   <content type="html">&lt;p&gt;While reading &lt;a href=&quot;https://www.vox.com/energy-and-environment/2017/6/15/15796202/map-carbon-pricing-across-the-globe&quot;&gt;this article&lt;/a&gt; one paragraph struck me:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The idea is simple. Sometimes markets produce negative impacts that are not accounted for in market prices. The market participants who produce the impacts do not pay for them; society absorbs the costs. (Air pollution is a good example.) These “externalities,” costs external to markets, are considered a form of market failure.&lt;/em&gt;&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;p&gt;Ĩn the case of environmental costs many solutions have arisen, the most famous of them being carbon taxes and the cap and trade system. However developing them was the result of results tailored for industries polluting the atmosphere. In a more general setting, can you improve markets such that these externalities are taken into account without the need for ad hoc fixes such as specially design taxes and other mechanisms?&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Intelligence, Money, Fun</title>
   <link href="https://blog.mptc.uk/posts/intelligence-money-fun"/>
   <updated>2019-02-03T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/intelligence-money-fun</id>
   <content type="html">&lt;p&gt;&lt;em&gt;Text serendipitously found in the web&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I asked my dad if I have ever made him cry in front of me before, because I don’t remember ever seeing him cry. He said, &lt;em&gt;“Once”&lt;/em&gt;. He told me that when I was 3 years old, he laid out a pen, a dollar, and a toy of some sort in front of me. He wanted to see which one I would pick. I think that a lot of Chinese people do that… It represents what you’ll value most when you grow up. Like the pen is intelligence, money, is well, money, and the toy is fun.&lt;/p&gt;

  &lt;p&gt;He was just doing it out of curiosity and boredom. It was interesting for him to see which one I’d pick anyway. He said that I just sat there and stared at the items. He sat across from me and waited patiently. According to him, I crawled towards them, he held his breath, and I pushed everything aside and went right into his arms. He didn’t realize that he was one of the choices. And that was the first, and the only time I made him cry.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Salem Witch Trials</title>
   <link href="https://blog.mptc.uk/posts/Salem-Witch-Trials"/>
   <updated>2019-01-28T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Salem-Witch-Trials</id>
   <content type="html">&lt;p&gt;Found on the Web&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;One of my friends told me about a powerful lesson in her daughter’s high-school class this winter. They’re learning about the Salem Witch Trials, and their teacher told them they were going to play a game.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;“I am going to come around and whisper to each of you whether you’re a witch or a normal person. Your goal is to build the largest group possible that does NOT have a witch in it. At the end, any group found to include a witch gets a failing grade.”&lt;/em&gt;&lt;/p&gt;

  &lt;p&gt;The teens dove into grilling each other. One fairly large group formed, but most of the students broke into small, exclusive groups, turning away anyone they thought gave off even a hint of guilt.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;“Okay”&lt;/em&gt;, the teacher said. &lt;em&gt;“You’ve got your groups. Time to find out which ones fail. All witches, please raise your hands.”&lt;/em&gt;&lt;/p&gt;

  &lt;p&gt;No one raised a hand.&lt;/p&gt;

  &lt;p&gt;The kids were confused and told him he’d messed up the game.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;“Did I? Was anyone in Salem an actual witch? Or did everyone just believe what they had been told?”&lt;/em&gt;&lt;/p&gt;

  &lt;p&gt;And that is how you teach kids how easy it is to divide a community.&lt;/p&gt;

  &lt;p&gt;Keep being welcoming, beautiful people. Shunning, scapegoating and dividing destroy far more than they protect. We are all in this together.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Magnitudes</title>
   <link href="https://blog.mptc.uk/posts/Magnitudes"/>
   <updated>2018-08-30T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Magnitudes</id>
   <content type="html">&lt;p&gt;Someone might have a million GBP in the bank. There are over 7 billion people in the world. The US current debt is over a trillion USD dollars. What do all these numbers have in common? They sound like a lot. But when reading about them, that is the only similarity. Even though a company being worth a million or a billion dollars makes a huge difference, it is very hard for someone to perceive the difference on first notice since the idea of a million, a billion and a trillion are not used in our daily life.&lt;/p&gt;

&lt;h2 id=&quot;so-what-are-you-suggesting&quot;&gt;So what are you suggesting?&lt;/h2&gt;

&lt;!--excerpt ends here--&gt;

&lt;p&gt;There is a way around this problem. We have well-developed intuitions about smaller numbers since they appear frequently in our life. Hence, we can convert the giant numbers above to smaller numbers by thinking of magnitudes, or even simpler, how many digits the number has.&lt;/p&gt;

&lt;h2 id=&quot;and-what-do-i-do-with-that&quot;&gt;And what do I do with that?&lt;/h2&gt;

&lt;p&gt;Now that we have numbers written in magnitudes, we can easily compare them. For example, if our unit is euros, we can consider which items are in each magnitude:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Cost of a meal, public transportation ticket&lt;/li&gt;
  &lt;li&gt;Clothing&lt;/li&gt;
  &lt;li&gt;Furniture, rent, plane tickets&lt;/li&gt;
  &lt;li&gt;Family holiday&lt;/li&gt;
  &lt;li&gt;Car&lt;/li&gt;
  &lt;li&gt;House, wealth of smaller companies&lt;/li&gt;
  &lt;li&gt;Launch of a reusable space rocket&lt;/li&gt;
  &lt;li&gt;Airplane&lt;/li&gt;
  &lt;li&gt;World population&lt;/li&gt;
  &lt;li&gt;Ethereum’s Market Cap&lt;/li&gt;
  &lt;li&gt;Cost of the British National Health Service&lt;/li&gt;
  &lt;li&gt;Value of assets managed by the world’s largest hedge fund.&lt;/li&gt;
  &lt;li&gt;National debt of the United States.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every time we see a new number, we can think about where it lies in this magnitude list and compare it to what we already know. That way when we see that a million dollars were spent on a new car fleet for government officials, hopefully we’ll realize that a million is about the correct value for such a fleet, instead of being outraged at the sound of a million dollars being spent by the government in something apparently unnecessary.&lt;/p&gt;

&lt;p&gt;Can you build a detailed magnitude list for yourself?&lt;/p&gt;

&lt;p&gt;Edit: This &lt;a href=&quot;https://www.youtube.com/watch?v=0YzvupOX8Is&quot;&gt;Ted-Ed Video&lt;/a&gt; shows this concept in action. Enjoy!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>上海</title>
   <link href="https://blog.mptc.uk/posts/Shanghai"/>
   <updated>2018-08-29T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Shanghai</id>
   <content type="html">&lt;p&gt;Shanghai. In truth I am currently in Beijing’s Capital International Airport, sitting down at a Starbucks, pondering about the last two months, and waiting for the second leg of my flight home, which will leave me in Amsterdam before I’ll be able to on-board the last flight to Porto.&lt;/p&gt;

&lt;p&gt;A few months back an email popped up in my inbox. It advertised a summer in China spent teaching. I have only tutored before and had no experience of teaching. They covered the transport costs and paid a modest amount for the experience, so it looked promising nonetheless. Without thinking much about the topic, I sent my CV. Soon I had my first phone call in order to explain why I was interested in this opportunity, and what were my thoughts about teaching. Since I have heard many things about the educational system in Asia, I wanted to see it first hand, and having teaching experience would be a quick way of quickly grasping the differences between the Western and Oriental educational styles. So I moved on to the second interview (with the &lt;a href=&quot;https://tomrocksmaths.com&quot;&gt;naked mathematician&lt;/a&gt;) in which I was challenged to present a topic of my choosing in 10 minutes. It was fun preparing a lesson in detail, and it was a good way of them assessing my ability to teach. In the end, the lesson went smoothly and I got my offer to join this program. After some struggling with the Portuguese Embassy in London I finally got my passport and Visa in order to fulfill my summer plans.&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;h2 id=&quot;i-think-we-know-all-we-want-to-from-your-application-process-but-what-about-the-internship-itself&quot;&gt;I think we know all we want to from your application process, but what about the internship itself?&lt;/h2&gt;

&lt;p&gt;The internship would take place between the 2nd July and the 21st August. I booked my flights so that I would arrive three days earlier, in order to explore Shanghai before work starts. During my flight I saw for the first time the Eiffel Tower. It was a shame that I saw it from the window of a plane, but I am confident I will see it in person sometime soon. The long flight continued all the way to Shanghai and for the first time I would see China. Without a working phone and without understanding a word of Chinese, my first goal was to find my way to the school Campus. I had the address, I got myself into a taxi and just gave the driver the written address. We were driving for over an hour (which I didn’t expect), and the driver tried to make conversation on occasion. It was hilarious given that he didn’t speak English neither did I speak Chinese. At one point we managed to discuss how I was going to pay, to which I showed him my debit card, which I discovered isn’t that useful to pay for taxis, so after he complained for a while we stopped at an ATM, I got the cash, and we continued the trip. I made it alive to Campus, and met part of the staff, which received me very well.&lt;/p&gt;

&lt;h2 id=&quot;that-seems-like-a-good-start-to-the-summer&quot;&gt;That seems like a good start to the summer&lt;/h2&gt;

&lt;p&gt;It was, and upon arriving I was surprised at how huge and well protected the campus was, having security guards, barbed wire and cameras everywhere. At first it felt like I should be worried about being robbed in the streets around us, but soon I found out my concerns were not justified. Even though I arrived 3 days earlier in order to explore Shanghai, my lack of discipline regarding JetLag resulted in me sleeping most of the day and being wide awake during night. During those 3 days staff was bringing me breakfast to my room, and on Sunday I was awake but sleepy 15 minutes before Catherine brought me breakfast. Since I knew I was almost falling asleep, I left the door wide open so that she could just leave my breakfast in and I would eat it as soon as I woke up. I ended up not waking up until 6 PM, by which point breakfast was no longer something I could eat. Thankfully the next day the remaining interns (as we called ourselves) arrived and my sleep scheduled adapted to what I had to do.&lt;/p&gt;

&lt;h2 id=&quot;so-who-are-these-interns&quot;&gt;So who are these interns?&lt;/h2&gt;

&lt;p&gt;The full group was me, Adam, Andrew, George, Issac (not to be confused with Isaac), Nayan, Maria and Jian. The eight of us would be responsible for preparing lessons and taking care of all the teaching for the following 3 weeks. This would prove to be a fun challenge. I ended up spending most of my time with George, who was both my room mate and my maths mate. I don’t think I could have had a better coworker: both hardworking and undoubtedly prepared, we made every class work smoothly and efficiently. It was fun working with him and the others. We had a small working place in the office, which was in fact a classroom with the tables rearranged to look like an office. All the interns and remaining staff worked together there and we would end up spending many late nights preparing materials together, listening to music, playing games and just having chit chat until it was time to go to bed.&lt;/p&gt;

&lt;h2 id=&quot;thats-a-very-lame-introduction-of-the-interns&quot;&gt;That’s a very lame introduction of the interns.&lt;/h2&gt;

&lt;p&gt;It is, so here’s more.&lt;/p&gt;

&lt;p&gt;Adam played the guitar and sang surprisingly well, almost as well as me, but the thing that always surprised me was his pop culture references. Always spot on.&lt;/p&gt;

&lt;p&gt;Andrew had the girl fan-base that Issac wish he had. I could introduce both of them better, but I prefer to leave the reader with just that idea.&lt;/p&gt;

&lt;p&gt;Nayan was an half native since he studied in Shanghai during high school. He introduced me to many of the local flavors I wanted to taste, and always had the drinking games prepared to have everyone say more than they should. The games worked well. Mostly.&lt;/p&gt;

&lt;p&gt;Maria was always keen on exploring Shanghai and making the most of this summer, wanting to always make the best of each situation.&lt;/p&gt;

&lt;p&gt;Jian was cool and calm. He had the vibe of someone who has everything he needs to be happy sorted, and didn’t need others to approve of his condition. I aspire to share in that way of being as much as he transpired to have it.&lt;/p&gt;

&lt;h2 id=&quot;that-seems-decent-but-i-havent-heard-about-any-teaching-yet-did-you-actually-do-any-work-during-the-summer&quot;&gt;That seems decent, but I haven’t heard about any teaching yet. Did you actually do any work during the summer?&lt;/h2&gt;

&lt;p&gt;We did, so let’s start in order. During the first week we met our inductee, Dara, who was responsible for introducing us to the program and making sure we had all the information we needed to do our work properly. It was a crash course both on getting us all to know each other by asking silly questions such as “Would you rather be hairy all over or bald?”, and actual work, but it turned out to be just what we needed to get started, and her energy transpired to us, making it all work. Little did we know how much we would miss having someone responsible for keeping the interns up to date, a need which hopefully will be satisfied in following years.&lt;/p&gt;

&lt;h2 id=&quot;good-to-know-you-had-a-good-inductee-but-that-is-not-your-work-what-did-you-do&quot;&gt;Good to know you had a good inductee, but that is not your work. What did you do?&lt;/h2&gt;

&lt;p&gt;My responsibilities consisted of preparing teaching materials, teaching, correcting / rating personal statements and occasionally do presentations to the students. So let us go through them.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Teaching:&lt;/strong&gt; We were given some materials used in previous years, but other than the topics and some rough guidelines we ended up preparing a lot of the materials ourselves. This worked well because we ended up knowing exactly how to teach the material. It turns out that to teach a topic, it does not suffice to know it well, you need to imagine what is like not knowing it, and how to best introduce it to someone who has no idea what you are talking about. It is a great exercise in understanding the fundamentals of a topic, and I recommend teaching as an exercise to everyone. There are other parts which are more classroom related, but after this summer I stand with a belief I had before, which is that the greatest gift a teacher can give a student is curiosity. I can go through hours of boring practice, after which a student will be proficient at a topic, more so than experts in the area, and yet leave with a feeling of disgust for the topic, never wanting to see it again. However if you successfully fire up their curiosity, they’ll be engaged for a long time trying to understand how it works, getting a better understanding than an ordinary student would get. I was satisfied to have one of my students write to me, at the end of camp, that “I love how your eyes twinkle when you meet an interesting problem”. Sharing that mathematics, or any subject, is still interesting after four years spent not doing much else is what I wanted to convey to my students: any topic can be interesting if you approach it in the right way, and I am glad I could contribute to that part.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Personal Statements:&lt;/strong&gt; This was the boring part. I feel, maybe wrongly, that in mathematics personal statements aren’t very important since there is so much that interviewers can test you after twelve years of learning. Nonetheless, it was part of the application process for University and part of my responsibilities to help my students with the entirety of their application to University, so I helped. Even though this was the least enjoyable part of the work, it was more bearable to see all the cases of Chinglish and the hilarity that ensues. I will not share specific examples since these references concern privately written personal statements, but consider that after two months of me trying to learn Chinese, I still can’t pronounce the difference between 吗 (question marker), 马(horse) and 妈 (mother). I can only imagine  the funny sentences that I might have said to my students. If any of my students is reading this and thinking that they made such mistakes, I just want you to believe one thing: life is full of mistakes and mistakes is something to be proud of. That is how you learn and grow, and as long as you work hard not to make the same mistake twice, you are good to go. As a side note, it took me six months upon the start of University to understand the difference between saying “hill” and “ill” since in Portugal we don’t have the “h” sound. After many weird looks and giggles from other people, eventually I improved my English and now I understand and control the two sounds. But this improvement only happens if you don’t shy away from making mistakes. So go ahead, make a fool of yourself, and know that even if people laugh at such silly mistakes, they are harmless and you are learning a lot in the process.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;you-forgot-to-talk-about-the-presentations&quot;&gt;You forgot to talk about the presentations.&lt;/h2&gt;

&lt;p&gt;They are not that interesting.&lt;/p&gt;

&lt;h2 id=&quot;fair-so-what-else-did-you-do&quot;&gt;Fair, so what else did you do?&lt;/h2&gt;

&lt;p&gt;We explored Shanghai a lot! We went to the Bund, the Pearl, had hotpot, KTV, and traveled outside Shanghai during weekends too. But first let me explain KTV since I’ve never seen it before. KTV is basically karaoke with no one but a group of friends in a small room. This sounds simple enough, maybe similar to sing star in a friend’s house, but it is so much more than that in Shanghai, with entire floors dedicated to KTV rooms, with a wide selection of songs and an environment that is hard to recreate in a friend’s house. We ended up doing it several times, including for mine and Issac’s birthday, and in the last day with my first batch of students.&lt;/p&gt;

&lt;h2 id=&quot;what-about-outside-shanghai&quot;&gt;What about outside Shanghai?&lt;/h2&gt;

&lt;p&gt;We visited Suzhou, Hangzhou, Beijing and the Shaolin Temple. Those were some four amazing visits. We saw temples, climbed mountains, walked the Great Wall of China, explored the forbidden city, revisited history in Tiananmen Square, scared old ladies, immersed ourselves in nature and in cities. So much was done and felt in such a short period of time, it is hard to describe all that we did.&lt;/p&gt;

&lt;h2 id=&quot;wait-wait-wait-scared-old-ladies&quot;&gt;Wait, wait, wait. Scared old ladies?&lt;/h2&gt;

&lt;p&gt;Yes. This is a funny albeit short story. On our trip to Beijing we rented an airbnb for four nights. The apartment was awesome, I was particularly fond of the stains in the bed cover, the shower that wasn’t physically divided from the the rest of the bathroom and it would flood the entire bathroom every time one of us showered, let alone all six of us :P Anyhow, before all of this, we went to building 401 in a certain street in Beijing, and our room was 1605 (16th floor, 5th room). The corridor looked interesting, feeling like we were playing slender man in real life and our goal was to find home. We arrived at our room at midnight. Since it was so late our host just said that the key was in the door, and for us to walk in. We tried opening the door, to no result. We knocked, but no one answered. We tried to find the key under the carpet, but it wasn’t there. We found a small bell on the side and eventually a lady came to the rescue. It was late at night so, understandably, she didn’t open the door. The conversation went something along these lines:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Lady:&lt;/strong&gt;Hey.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Us:&lt;/strong&gt; Hey.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Lady:&lt;/strong&gt;Who are you?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Us:&lt;/strong&gt; We booked an airbnb for tonight and this is the airbnb we booked. Can you open the door?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Lady:&lt;/strong&gt;No you are not staying here for the night.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Us:&lt;/strong&gt; We booked it online and paid for it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Lady:&lt;/strong&gt;This is my home.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Us:&lt;/strong&gt; But we booked it online, we have the booking receipt here.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Lady:&lt;/strong&gt;No, this is my house, I’m not letting anyone inside.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By this point we asked Jian to check the booking. Turns out building 401 was the owner’s building, we were sleeping in 406. Our bad. Without her ever opening the door, we apologized, and went into the correct building where indeed the key was on the inside of the door, the door not being locked. For a while we wondered what went through the ladies mind. 7 foreigners, young and able, knocking on her door at half past midnight demanding to get in cause that was our apartment for the next four nights. I hope she managed to sleep that day, but i am not sure she did.&lt;/p&gt;

&lt;h2 id=&quot;poor-lady&quot;&gt;Poor lady.&lt;/h2&gt;

&lt;p&gt;Looking at the bright side we might have spiced up her life. That’s always good :D&lt;/p&gt;

&lt;h2 id=&quot;not-by-scaring-people&quot;&gt;Not by scaring people.&lt;/h2&gt;

&lt;p&gt;Fair. Anyhow, we explored China a lot and we learnt a lot in the process.&lt;/p&gt;

&lt;h2 id=&quot;such-as&quot;&gt;Such as?&lt;/h2&gt;

&lt;p&gt;I’ve mostly been talking about what I did as a tourist, but we also got to experience what it is like to live in China. The first thing that many might notice is the lack of toilets as we know them in Europe. Instead, we have squat toilets, which consist of a hole on the floor. A fancy whole, built exclusively for the purpose, but a whole on the floor nonetheless. Surprisingly enough, I honestly think I am going to miss squat toilets. They are equally useful, and nowhere nearly as much of an issue as I thought at first. And my legs got stronger too. And better for bowel movements. They are better all around. Maybe I should get myself one back home :D&lt;/p&gt;

&lt;p&gt;Secondly, WeChat and Alipay. They are everywhere. All of your finances managed on your phone, everything centralized. This is a sensitive point if you consider how much control the government has about all your spendings, but from the point of view of a tourist who used the app for two months, it is so practical. No money to handle, just a bar code and everything follows swiftly. All payments to friends, shops, wages, everything. It is so much more convenient. And then there are the apps inside that make it all even more useful, most of which sadly I didn’t use. Renting bikes, where 1 euro allowed you to ride for 7 hours, or movie tickets, or ordering food, or anything. It was like looking into the future. I wonder what it would take to bring the tech back home, because I definitely enjoyed having it at my fingertips.&lt;/p&gt;

&lt;p&gt;Thirdly, and probably the most obviously, the language barrier. I’ve been to Mozambique, Panama, Brazil, and a few European countries. What they all had in common was that the population was generally fluent in either Portuguese, Spanish or English. Any of these are enough for me to get around easily, but in China I had none of them. You might find the occasional English speaker, and definitely there were many of them in the program, but that was not the general observation outside the confinements of campus. It was a new experience to me struggling to convey simple messages, and having to signal for most things I wanted. I’d like to say my Chinese helped, but other than very basic things I failed at communicating. I need to practice more.&lt;/p&gt;

&lt;p&gt;As an interesting side story, today on Beijing’s airport I started talking to one of the security guards at one of the checkpoints. She kept asking for something I didn’t understand. I gave her my passport, which she refused. My boarding ticket, which she also refused. At a certain point she just gave up and told me to continue through the checkpoint. I believe I got through a checkpoint without the proper checks just because she thought “I’m tired of trying to speak, I’ll just let him go”. I still have no idea what she was asking for.&lt;/p&gt;

&lt;h2 id=&quot;is-this-all&quot;&gt;Is this all?&lt;/h2&gt;

&lt;p&gt;Definitely not. I mentioned a 3 week camp which I taught, but after that one we moved to a new one, where we were joined by more interns: Adina, Cam, Henry, Leo, and Richard smells. Henry ended up working a lot with me and George, and was a great addition to the team. And the students liked him a lot, which me and George always wondered about. Obviously we weren’t jealous of it. Obviously. He saved me from a lot of work in the last day. I needed him to take over a class last minute, even after me and George confirmed that he wouldn’t have to, and he did so smoothly. What a guy. That together with his keenness on being a good teacher made him a pleasure to work with. I remember one day him teaching modular arithmetics. Since he studied computer science, he wasn’t as fluent in some parts as much as a mathematician, so I explained those and the attention and effort he showed then is something that a teacher wants to see in every student, and it makes teaching worthwhile. Seeing him doing all that so that he could do his job to the best of his abilities was a delight.&lt;/p&gt;

&lt;h2 id=&quot;we-get-it-you-liked-working-with-george-and-henry-the-mathematicians-but-thats-boring-say-interesting-stuff&quot;&gt;We get it, you liked working with George and Henry, the mathematicians, but that’s boring. Say interesting stuff.&lt;/h2&gt;

&lt;p&gt;Fair. I liked the bunch.&lt;/p&gt;

&lt;p&gt;Leo was the party animal, which was harder for me to relate since I’m not as fond of clubbing, but his random trivia was consistently interesting, and always left me with the question “What possibly reason could there be for him to know such random things?”.&lt;/p&gt;

&lt;p&gt;I particularly enjoyed Adina because the two of us remained strong when climbing the mountain near the Shaolin Temple. For hours we walked and walked, making it to the top and enjoying the views that, in the end, only five of the interns went up to see. she was good company during that long walk.&lt;/p&gt;

&lt;p&gt;Cam’s smile was interesting since all the students agreed that it was a fake smile. I did not see it as fake, and he himself claims that was not a thing ever before, but his students disagreed. I can only wonder what sort of smiles he had during class that transpired such fakeness. I really wish I had gone to his classes.&lt;/p&gt;

&lt;p&gt;Richard. Smells.&lt;/p&gt;

&lt;h2 id=&quot;so-far-you-only-told-us-about-the-interns-did-you-work-with-noone-else&quot;&gt;So far you only told us about the interns. Did you work with noone else?&lt;/h2&gt;

&lt;p&gt;We did. There was a second inductee, Tom, but I ended up spending little time with him since his responsibility was the new interns. We had Yao Yao and Potter who did an amazing job of coordinating camp with so little to go on. Kudos to them. We had Flora who made sure all the interns were well taken care of. And all the staff who worked wonders to make sure everything went well, be it Alex with IT, Betty with finances, Catherine with accommodation and weekend trips, and everyone else who worked in the background. But there’s a group of people that us interns are specially grateful to. The Teaching Assistants, or, as we called them, the TAs. They were there to reduce the teacher’s workload, by supervising students in the morning and evenings, by marking the students work, and doing anything needed in the moment (Thank you Cindy, Helen and HD! ).&lt;/p&gt;

&lt;h2 id=&quot;so-they-helped-you-with-the-workload&quot;&gt;So they helped you with the workload?&lt;/h2&gt;

&lt;p&gt;Yes, but also with all the breaks and jokes and stories that made the entire program enjoyable. Tia and her bear, or should I say beer, which I took very good care of, but in the end got torn apart and lost somewhere dark. Alice and her curiosity about Measure Theory. I feel like a nerd describing the “good times” as me teaching mathematics on top of the teaching I already had to do. But then again, maths is fun, so there’s that. There’s all the songs we sang in KTV. Tia’s brother was a delight. I miss you, 小胖.&lt;/p&gt;

&lt;h2 id=&quot;cool-glad-to-know-you-enjoyed-something-else-other-than-work&quot;&gt;Cool, glad to know you enjoyed something else other than work&lt;/h2&gt;

&lt;p&gt;There’s another thing! I do enjoy my maths, but I enjoy sports a lot. I might not enjoy aimless exercise, and by aimless I mean exercising in solitude, but be it football, handball, basketball, or any clash of physical prowess gets my interest, and as such I really enjoyed our late evening basketball and football matches. But most of all, I ended wrestling as well. I haven’t done that in ages, but by chance me and Issac ended up wrestling to see who got the middle bed in the Shaolin temple. I need to wrestle more often. Maybe I should try boxing. Also, winning felt good :D&lt;/p&gt;

&lt;h2 id=&quot;youre-just-saying-this-to-tell-us-that-you-won-when-wrestling&quot;&gt;You’re just saying this to tell us that you won when wrestling?&lt;/h2&gt;

&lt;p&gt;Obviously winning is great, but I genuinely enjoy exhausting myself physically. Do you not agree?&lt;/p&gt;

&lt;h2 id=&quot;i-do-i-do-what-else-did-you-do&quot;&gt;I do, I do. What else did you do?&lt;/h2&gt;

&lt;p&gt;I watched the students in the Shaolin temple learn martial arts, and do double back flips as if it was the most natural thing in the world. I was amazed by the theater session they showed us where their stage was the entire mountain. Seriously, there were people and lights all over the mountain, from top to bottom. I still don’t understand how they created the illusion that a building, which was just in front of my eyes, rose from the floor. No way they actually raised an entire building, but it was there, and it was going up. I went to Shanghai’s concert hall, which was gorgeous, even though the performance was a bit disappointing: I feel like the pianist butchered some great classics. I spent an afternoon reading in Pudong’s library, which is bigger than any I’ve seen before ( Thank you Flora for taking me to so many different places and being great company for my last two days in Shanghai ). I had dinner with the rest of CamExpress at the rotating restaurant in the Pearl, which oversees the never ending city. I watched national productions, namely “Dying to Survive”, which was a lot more emotional than the movies I’m used to watch. The weight of that movie was balanced by the lightheartedness of the comedy Mr Billionaire, which made me laugh all the way.&lt;/p&gt;

&lt;h2 id=&quot;that-is-a-long-list&quot;&gt;That is a long list.&lt;/h2&gt;

&lt;p&gt;It is. And there is much more. They were a packed couple months. I experienced a lot. Both work wise and personally. I made friendships that will last. There was conflict. But life is about taking the good and the bad.&lt;/p&gt;

&lt;h2 id=&quot;are-you-trying-to-get-a-moral-out-of-this&quot;&gt;Are you trying to get a moral out of this?&lt;/h2&gt;

&lt;p&gt;I wasn’t planning on, but I kind of feel like I must now. Because there is always bad and good in any situation, and we only appreciate the good after feeling the bad. We assess our well being by comparison. So there can be enjoyment in bad situations. There’s a choice between getting angry and frustrated at whatever bad comes our way, or making the most of it, and taking it as a learning experience. And whenever that bad happens, instead of spending your energy on frustration, it can be used constructively by working on it. By thinking on what can be done to improve the situation. By thinking on what can be done to make sure that it never happens again. By making sure you helped to solve another one of the many problems in this world. Because, in the end, “life is misery with a few dots of happiness”.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Echo Chambers</title>
   <link href="https://blog.mptc.uk/posts/Echo-Chambers"/>
   <updated>2018-02-23T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Echo-Chambers</id>
   <content type="html">&lt;p&gt;Social Networks are meant to provide users with social updates, be it from friends or from the media. Given the information overload we can’t afford to read everything, and as such the platforms (Facebook, Twitter and many others) choose what we should read on our behalf. They employ algorithms that try to find the articles we find will most likely enjoy. An honorable attempt to achieve the not so honorable goal of keeping us using their platform for as long as possible.&lt;/p&gt;

&lt;h1 id=&quot;so-how-should-we-change-it&quot;&gt;So how should we change it?&lt;/h1&gt;

&lt;!--excerpt ends here--&gt;

&lt;p&gt;The first changes I would demand are:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;The users to be aware of how the algorithms used work.&lt;/li&gt;
  &lt;li&gt;Have a selection of algorithms for the user to choose from.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Change 1 can prove itself hard from a market competition point of view: the platform with the best algorithms should have more success, but revealing them would nullify any investment on these areas. This shouldn’t prove problematic since the best algorithms are already out-there up to tuning parameters. What I mean is that companies can say that they use a certain algorithm without specifying the parameters that made it work best. A great example of this in practice is the public release of &lt;a href=&quot;https://medium.com/hacking-and-gonzo/how-reddit-ranking-algorithms-work-ef111e33d0d9&quot;&gt;Reddit’s ranking algorithms&lt;/a&gt; . I admire their initiative. Also, they cite &lt;a href=&quot;http://www.evanmiller.org/how-not-to-sort-by-average-rating.html&quot;&gt;this page&lt;/a&gt; which I found interesting for anyone doing rankings.&lt;/p&gt;

&lt;p&gt;Change 2 is easy to implement but so far it seems uncommon practice. I’m talking at least Facebook, Twitter, Instagram, Pinterest and Snapchat (following &lt;a href=&quot;article&quot;&gt;this&lt;/a&gt;). For UX purposes it makes total sense to have a default algorithm so that users don’t have to worry about how each algorithm works and, to be honest, it’s understandable that most users don’t care. However the option should be there (somewhere in settings for users that don’t). There are many reasons for these, not least of them the fact that I want to have my feed better chosen than to just see the posts that I will more likely like.&lt;/p&gt;

&lt;p&gt;Personally, my problem is echo chambers.&lt;/p&gt;

&lt;h1 id=&quot;what-are-echo-chambers&quot;&gt;What are echo chambers?&lt;/h1&gt;

&lt;p&gt;In common usage, an echo chamber is a term to any setting which feeds you back with the things that you already believe. Do you like kittens? Here’s a 2 minute video of kittens purring. Are you Pro-Life? Then we’ll send you some more Pro-Life articles. Do you want stricter immigration rules? Then we’ll send you links to people who’ve moved society towards that goal.&lt;/p&gt;

&lt;p&gt;We move from an innocent yet naive approach to social feeds to an echo chamber that feeds us with what we already believe in and prevents useful discussions. We need to discuss hard topics with the opposition. Yes, we need to be careful about politics, religion and soccer (never forget soccer), but we DO NEED to have this discussion. With tolerance and an open mind, but anything is better than avoiding this conversations and living in our own little bubbles, as if nothing else existed.&lt;/p&gt;

&lt;p&gt;The Wall Street Journal published an interesting take on echo chambers by making a &lt;a href=&quot;http://graphics.wsj.com/blue-feed-red-feed&quot;&gt;comparison of Liberal and Conservative news feeds&lt;/a&gt;. The results should cause outrage. People on both sides will leave their feeds with a feeling that everyone agrees with them, with no discussion and, more importantly, no agreement being achieved.&lt;/p&gt;

&lt;h1 id=&quot;what-do-you-propose&quot;&gt;What do you propose?&lt;/h1&gt;

&lt;p&gt;By the tone of the post so far it should come as no surprise that we need better algorithms. Being shown posts with divergent opinions from the user will definitely increase &lt;a href=&quot;https://en.wikipedia.org/wiki/Churn_rate&quot;&gt;churn rate&lt;/a&gt;, so platforms have no incentive to do it. My hopes lie in people becoming aware of the Echo Chamber problem and demanding a solution. Personally, a simple solution can be achieved: let me choose a better algorithm for sorting my feed.&lt;/p&gt;

&lt;h1 id=&quot;which-algorithm-do-you-want-to-see-implemented&quot;&gt;Which algorithm do you want to see implemented?&lt;/h1&gt;

&lt;p&gt;I call this the Explorer Algorithm. As the name hopefully implies, it is meant to explore posts that I wouldn’t normally see. Let’s imagine back to the Liberal/Conservative divide. We can divide the users into 2 clusters. Now instead of choosing the cluster that I am in, I am shown the posts ranked as if they were shown to the opposite cluster. That way I’m seeing more useful posts.&lt;/p&gt;

&lt;p&gt;This has an obvious problem. If I enjoy politics, the approach above might show me all about video games which is not what I want. I want to see divergent views on political matters. Hence we need to do some fine tuning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Iteration 2:&lt;/strong&gt; We cluster people by what they actively like/dislike, regardless of which of the 2 they choose. For example I would frequently like political posts supporting my views and dislike political posts against my views. Hence I would be clustered with people who are focused in politics. Having people clustered by topics of interest, we can redo the above. Considering only people within a topic, we cluster them according to likes/dislikes (now distinguishing the 2 events). After that I am shown the better ranked posts for the set of people outside my cluster. This way I see relevant ideas that go against my views, and with some luck I’ll learn and adapt my views for the better.&lt;/p&gt;

&lt;h1 id=&quot;cool-we-just-need-to-implement-it&quot;&gt;Cool, we just need to implement it.&lt;/h1&gt;

&lt;p&gt;Yes. That can be problematic though. Even though these ideas are socially good, they might increase churn rate as mentioned above, hence reducing the platform’s profits. It would also take some power away from the platforms to control what is shown. It is not an easy fight, but public pressure is a valuable tool at our disposal and it can be effective if we are consistent.&lt;/p&gt;

&lt;h1 id=&quot;so-what-should-i-do&quot;&gt;So what should I do?&lt;/h1&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Share your thoughts on those same platforms.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you know someone working there (or even if you don’t ) get in touch with them sharing your concerns. Only their employees can implement these changes.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you find a platform that follows these ideas start using them more, leaving a post explaining why in order to raise awareness of the issue. Do follow through with changing platforms since nothing convinces social platforms to change more than hurting their profits from advertising. So far only Reddit comes to mind having implemented the ideas above, but do share other platforms who also do so if you are aware of them.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;
</content>
 </entry>
 
 <entry>
   <title>The Public Goods Game</title>
   <link href="https://blog.mptc.uk/posts/The-Public-Goods-Game"/>
   <updated>2018-01-29T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/The-Public-Goods-Game</id>
   <content type="html">&lt;p&gt;Adapted excerpt from Dan Ariely’s Predictably Irrational&lt;/p&gt;

&lt;p&gt;This thought experiment offers an interesting example of the phenomenon of the tragedy of the commons. Imagine that I offer you and three other people £10 each, which is yours to keep. But I also give you an opportunity to make more money. You can put as much of your £10 as you want in the “group pot”. Once all the players have privately decided how much of their money to put in the group pot, all the money doubles and then is split evenly among the four participants, regardless of how much money each individual contributed. How much of your £10 would you put into the group pot? If all four of you put in £10, the group pot would double from §40 to £80, be divided four ways, and each of you would take away a nice £20.&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;p&gt;So lets So let’s say  you put in your £10, thinking that the other players will do the same. Once the pot is divided, however, you only get £15 back, not @20. What happened? It turns out that one of the other players, Bernie, decided to cheat. At the beginning of the game, Bernie realized that he would make the most money if he withheld his £10 while everyone else contributed to the central pot. So Bernie kept his £10 while the other three players placed their £10 in the central pot, making the total £30. This doubled for a total of £60, subsequently split four ways (remember, Bernie gets the proceeds of the group pot, whether or not he contributes), and each of the three contributors get £¹5. Bernie, meanwhile, makes out with £25 ( his original £10 plus £15 from the split), more than any other player.&lt;/p&gt;

&lt;p&gt;Now, let’s say you get a chance to play the same game again with the same players ( I give you all new £10 bills). How would you play this time? You don’t want to be too trusting because you know Bernie might defect again. So you only put in 4£. It turns out that the other three players feel the same way and make the same decision, making the total in the group’s pot £12 (Bernie again does not put in any money). The pot doubles to £24, which is split evenly among four people. Each of the three contributing players gets £6 (In addition to the 6£ they kept for themselves), while Bernie winds up with £16 in total.&lt;/p&gt;

&lt;p&gt;Now, your trust has been eroded. You play a few more games, but you don’t put in any of your money.Each time you end up with the 10£ you started with. You don’t lose anything, but since you don’t trust others to behave in a cooperative way (and neither do the other players), you don’t gain anything either. In contrast, if you and the others had acted cooperatively, each of you would have wound up with as much as @20 per game.&lt;/p&gt;

&lt;p&gt;Viewed this way, the Public Goods Game illustrates how we, as a society, share the public good of trust. When we all cooperate, trust is high and the total value to society is maximal. But distrust is infectious. When we see people defect by lying in their ads, proposing scams, etc., we start acting similarly: trust deteriorates, and everybody loses, including the individuals who initially gained from their selfish acts.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>From Surviving to Living</title>
   <link href="https://blog.mptc.uk/posts/From-Surviving-To-Living"/>
   <updated>2018-01-04T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/From-Surviving-To-Living</id>
   <content type="html">&lt;p&gt;Suppose a company has 2 employees Anne and John. The company values Anne’s work 2 times more than John’s work. As such the company is paying Anne £1400 and John £700. This can be seen as fair, one person having double the money to spend and be happy since they are contributing double of what others are contributing.&lt;/p&gt;

&lt;p&gt;However there is one problem: Both of them have survival costs, namely rent, food, eletricity and similar expenses. Assume that both Anne and John need £600 to survive. Subtracting survival costs, we get that Anne’s spending money is £800, but John’s is £100, like this:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;Anne&lt;/th&gt;
      &lt;th&gt;John&lt;/th&gt;
      &lt;th&gt;Ratio&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Salary&lt;/td&gt;
      &lt;td&gt;£1400&lt;/td&gt;
      &lt;td&gt;£700&lt;/td&gt;
      &lt;td&gt;2:1&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Survival Money&lt;/td&gt;
      &lt;td&gt;£600&lt;/td&gt;
      &lt;td&gt;£600&lt;/td&gt;
      &lt;td&gt;1:1&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Spending Money&lt;/td&gt;
      &lt;td&gt;£800&lt;/td&gt;
      &lt;td&gt;£100&lt;/td&gt;
      &lt;td&gt;8:1&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;In practice Anne has 8 times the spending money John has. Those are 8 times more money spent on actually improving your life quality, having dinners with friends, buying books to read, doing hobbies they love.&lt;/p&gt;

&lt;p&gt;The core idea, shared on &lt;a href=&quot;https://medium.com/@conradshaw/money-isnt-money-97722fe87025&quot;&gt;medium&lt;/a&gt; by Conrad Shaw, is that each person has survival money and spending money. Survival money is needed to remain alive, spending money is used to be happy.&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;h2 id=&quot;what-are-you-claiming&quot;&gt;What are you claiming?&lt;/h2&gt;

&lt;p&gt;My claim is that a person’s quality of life is not correctly dependent on their productivity. A small improvement in productivity leads to large quality of life improvements. In other words, if your productivity is slightly below average, then your quality of life is a lot below average.&lt;/p&gt;

&lt;h2 id=&quot;can-we-fix-the-situation&quot;&gt;Can we fix the situation?&lt;/h2&gt;

&lt;p&gt;Given the premises, we need to make sure Anne’s spending money is double John’s spending money. We have a total salary of £2100. Both Anne and John need £600 to survive, leaving us with £900 to distribute. Hence John should receive £300 (half) and Anne £600 (double).&lt;/p&gt;

&lt;p&gt;Then we would get the distribution:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;Anne&lt;/th&gt;
      &lt;th&gt;John&lt;/th&gt;
      &lt;th&gt;Ratio&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Salary&lt;/td&gt;
      &lt;td&gt;£1200&lt;/td&gt;
      &lt;td&gt;£900&lt;/td&gt;
      &lt;td&gt;4:3&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Survival Money&lt;/td&gt;
      &lt;td&gt;£600&lt;/td&gt;
      &lt;td&gt;£600&lt;/td&gt;
      &lt;td&gt;1:1&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Spending Money&lt;/td&gt;
      &lt;td&gt;£600&lt;/td&gt;
      &lt;td&gt;£300&lt;/td&gt;
      &lt;td&gt;2:1&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Now their Spending Money and their value to the company are in the right proportion.&lt;/p&gt;

&lt;h2 id=&quot;so-companies-should-take-that-into-account-when-deciding-salaries&quot;&gt;So companies should take that into account when deciding salaries?&lt;/h2&gt;

&lt;p&gt;Unfortunately that would not work well. As mentioned in the beginning, Anne’s work is twice as important as John’s work. Hence for the company we would observe something similar to:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;Anne&lt;/th&gt;
      &lt;th&gt;John&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Company worth&lt;/td&gt;
      &lt;td&gt;£1400&lt;/td&gt;
      &lt;td&gt;£700&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&apos;Fair&apos; amount&lt;/td&gt;
      &lt;td&gt;£1200&lt;/td&gt;
      &lt;td&gt;£900&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Company Profits&lt;/td&gt;
      &lt;td&gt;£200&lt;/td&gt;
      &lt;td&gt;-£200&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The company would be paying Anne below her worth but not John, so they win from hiring Anne but not John.&lt;/p&gt;

&lt;h2 id=&quot;do-you-have-an-alternative-suggestion&quot;&gt;Do you have an alternative suggestion?&lt;/h2&gt;

&lt;p&gt;Yes, taxes. After the company pays employees their worth to the company, then we have to pay taxes by filling IRS forms and all our obligations. Applying the above reasoning to all citizens, then we should get the correct spending money ratio’s.&lt;/p&gt;

&lt;h2 id=&quot;how-would-we-figure-out-how-much-each-person-has-to-pay-at-a-larger-scale&quot;&gt;How would we figure out how much each person has to pay at a larger scale?&lt;/h2&gt;

&lt;p&gt;I am going to skip the calculations, but doing them is equivalent to each person giving a percentage of their salaries to pay for everyone’s survival costs.&lt;/p&gt;

&lt;h2 id=&quot;how-would-that-work-in-practice&quot;&gt;How would that work in practice?&lt;/h2&gt;

&lt;p&gt;I will give you an example. Suppose that we have a population of 560 people with the monthly income distribution below.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Salary&lt;/th&gt;
      &lt;th&gt;Number of people&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;£0&lt;/td&gt;
      &lt;td&gt;30&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£500&lt;/td&gt;
      &lt;td&gt;100&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£750&lt;/td&gt;
      &lt;td&gt;250&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£1500&lt;/td&gt;
      &lt;td&gt;100&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£2500&lt;/td&gt;
      &lt;td&gt;50&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£5000&lt;/td&gt;
      &lt;td&gt;22&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£10000&lt;/td&gt;
      &lt;td&gt;10&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;If we assume that £400 is the needed survival money then we will need £224.000 to pay everyone, from a total of £3.712.500 available. Hence the survival money is roughly 6% of the total income seen. Doing the calculations above we get:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Initial Salary&lt;/th&gt;
      &lt;th&gt;Spending Money&lt;/th&gt;
      &lt;th&gt;Adapted Salary&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;£0&lt;/td&gt;
      &lt;td&gt;£0&lt;/td&gt;
      &lt;td&gt;£400&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£500&lt;/td&gt;
      &lt;td&gt;£470&lt;/td&gt;
      &lt;td&gt;£870&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£750&lt;/td&gt;
      &lt;td&gt;£705&lt;/td&gt;
      &lt;td&gt;£1105&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£1500&lt;/td&gt;
      &lt;td&gt;£1409&lt;/td&gt;
      &lt;td&gt;£1809&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£2500&lt;/td&gt;
      &lt;td&gt;£2349&lt;/td&gt;
      &lt;td&gt;£2749&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£5000&lt;/td&gt;
      &lt;td&gt;£4698&lt;/td&gt;
      &lt;td&gt;£5098&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£10000&lt;/td&gt;
      &lt;td&gt;£9397&lt;/td&gt;
      &lt;td&gt;£9797&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The Spending Money column is just a rescaling (by 94%) of the Initial Salary column. As such each person’s initial salary and spending money can be seen as fair.
Lastly (for those of you with higher salaries), there’s an important column missing: The percentual change in salary:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Initial Salary&lt;/th&gt;
      &lt;th&gt;Adapted Salary&lt;/th&gt;
      &lt;th&gt;Percentual Change&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;£0&lt;/td&gt;
      &lt;td&gt;£400&lt;/td&gt;
      &lt;td&gt;Infinity&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£500&lt;/td&gt;
      &lt;td&gt;£870&lt;/td&gt;
      &lt;td&gt;74%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£750&lt;/td&gt;
      &lt;td&gt;£1105&lt;/td&gt;
      &lt;td&gt;47.3%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£1500&lt;/td&gt;
      &lt;td&gt;£1809&lt;/td&gt;
      &lt;td&gt;20.6%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£2500&lt;/td&gt;
      &lt;td&gt;£2749&lt;/td&gt;
      &lt;td&gt;9.96%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£5000&lt;/td&gt;
      &lt;td&gt;£5098&lt;/td&gt;
      &lt;td&gt;1.96%&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;£10000&lt;/td&gt;
      &lt;td&gt;£9797&lt;/td&gt;
      &lt;td&gt;-2.02%&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Hence by 10 people giving 2% of their salaries we are able to guarantee enough survival money for 560 people, while keeping the spending money approppriately sized.&lt;/p&gt;

&lt;h2 id=&quot;so-we-should-just-tax-everyones-income-to-provide-for-everyones-survival&quot;&gt;So we should just tax everyone’s income to provide for everyone’s survival?&lt;/h2&gt;

&lt;p&gt;Yes and no. There are a few things that should be done before moving forward:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Trials.&lt;/strong&gt; Many &lt;a href=&quot;https://en.wikipedia.org/wiki/Basic_income_pilots&quot;&gt;Basic Income Pilots&lt;/a&gt; are already being done to better evaluate the impacts of having an UBI, from the citizen’s willingness to work and what work gets done, among other things.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Consider funding alternatives.&lt;/strong&gt; I have provided a single UBI funding idea, which I personally like but I am absolutely sure there are better ones that I have not considered. Given the variety of funding sources for governments this should not be problematic, it just needs to be considered.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Defining survival money.&lt;/strong&gt; This amount varies between geographical locations and means available (if I have my own house I usually have to pay a smaller rent than if I had a landlord trying to profit). Finding the ideal amount for a country is not trivial.&lt;/p&gt;

&lt;p&gt;Not as relevant but also important, I need to do the calculations above to actual income data and not just fictional values like the ones I created. I am curious to see what the impact would be in that case. If you read this before I have done that feel free to email me so that I do it.&lt;/p&gt;

&lt;h2 id=&quot;further-reading&quot;&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://medium.com/basic-income/universal-basic-income-the-maslow-argument-d1346fa9a9f2&quot;&gt;UBI - The Maslow Argument&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://medium.com/@conradshaw/money-isnt-money-97722fe87025&quot;&gt;Money Isn’t Money, until it is&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Maslow%27s_hierarchy_of_needs&quot;&gt;Maslow’s Hierarchy of needs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Long Term Teaching</title>
   <link href="https://blog.mptc.uk/posts/Long-Term-Teaching"/>
   <updated>2017-12-29T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Long-Term-Teaching</id>
   <content type="html">&lt;p&gt;This post is a reflection on a &lt;a href=&quot;https://blog.mptc.uk/posts/Maths&apos;-Ceiling&quot;&gt;previous post&lt;/a&gt; based on our &lt;a href=&quot;https://mathwithbaddrawings.com/2015/04/08/the-math-ceiling-wheres-your-cognitive-breaking-point/&quot;&gt;Cognitive Breaking point&lt;/a&gt;. I want to compare 2 examples on teaching. One can be called more academic, and the other less so.&lt;/p&gt;

&lt;h2 id=&quot;so-what-are-we-learning&quot;&gt;So what are we learning?&lt;/h2&gt;

&lt;p&gt;We are learning how to compute the maxima and minima of functions. And I will try to teach it in 2 different ways. My questions to you, the reader, are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Which one would you rather learn?&lt;/li&gt;
  &lt;li&gt;Which one would you rather see taught in schools?&lt;/li&gt;
&lt;/ul&gt;

&lt;!--excerpt ends here--&gt;

&lt;h3 id=&quot;alternative-1&quot;&gt;Alternative 1&lt;/h3&gt;

&lt;p&gt;This is how you compute the maxima and minima of a function \(f:[a,b] \mapsto \mathbb{R}\), with \(a,b \in \mathbb{R}\) :&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;You calculate its derivative \(g = f&apos;\)&lt;/li&gt;
  &lt;li&gt;You get the zeros of \(g = f&apos;\)&lt;/li&gt;
  &lt;li&gt;We compare the values of \(a\), \(b\), and the zeros of \(g\)&lt;/li&gt;
  &lt;li&gt;To figure out which of those points are local maxima or minima we need to calculate \(h = g&apos; = f&apos;&apos;\). If, for \(x_0 \in [a,b], h(x_0)&amp;lt;0\) then \(x_0\) is a local maxima. If \(h(x_0)&amp;gt;0\) then \(x_0\) is a local minima. If \(h(x_0) = 0\) then we call \(x_o\) a saddle point (it is neither a maxima nor a minima).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To do all of the above we need to be able to compute derivatives. When calculating derivatives the following rules apply:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
\[(cf)&apos; = cf&apos;\]
  &lt;/li&gt;
  &lt;li&gt;
\[c&apos; = 0\]
  &lt;/li&gt;
  &lt;li&gt;
\[(f \pm g)&apos; = f&apos; \pm g&apos;\]
  &lt;/li&gt;
  &lt;li&gt;
\[(fg)&apos; = f&apos;g + fg&apos;\]
  &lt;/li&gt;
  &lt;li&gt;
\[(1/f)&apos; = -\frac{f&apos;}{f^2}\]
  &lt;/li&gt;
  &lt;li&gt;
\[(x^n)&apos; = nx^{n-1}\]
  &lt;/li&gt;
  &lt;li&gt;
\[sin(x)&apos; = cos(x)\]
  &lt;/li&gt;
  &lt;li&gt;
\[cos(x)&apos; = -sin(x)\]
  &lt;/li&gt;
  &lt;li&gt;
\[f(g(x))&apos; = f&apos;(g(x))g&apos;(x)\]
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you remember all of the rules above you will be able to present any question posed in the class and exam.&lt;/p&gt;

&lt;h3 id=&quot;alternative-2&quot;&gt;Alternative 2&lt;/h3&gt;

&lt;p&gt;We are trying to find the local minima and maxima of a function \(f:[a,b] \mapsto \mathbb{R}\), with \(a,b \in \mathbb{R}\). One useful tool to do so is using derivatives. A derivative can be understood in the following way:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Picture the plot of the function \(f\)&lt;/li&gt;
  &lt;li&gt;Choose a point \(x\)&lt;/li&gt;
  &lt;li&gt;Take the line tangent to \(f\) at point \(x\)&lt;/li&gt;
  &lt;li&gt;That line has a certain gradient \(m(x)\)&lt;/li&gt;
  &lt;li&gt;This gradient is the derivative \(f&apos;(x)\)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In another words, the derivative is the gradient of change or speed of change at point x. As such we can relate this derivate to the notion of speed we built in Physics class. Now what is the second derivative? It would be the gradient of change of speed. In other words we can think of it as acceleration. It turns out that derivatives are fairly easy to calculate for most functions, but we’ll do so later on. Now, given this tool we have, we want to find out how to find the maxima and minima of \(f\). If you’re picturing a maxima of \(f\) in front of you, then we can see that the tangent line must be parallel to the \(x\) axis. Another way to think about it is, like before, think of \(x\) as time and \(f(x)\) as your position. Being in a maxima or minima equates to being the most forward or the most backwards. SInce to get there we needed positive speed and to come back we need negative speed, than at the point when \(f(x)\) is maximal we need zero speed, so we need \(f&apos;(x) = 0\).&lt;/p&gt;

&lt;p&gt;Hence the local maxima / minima is attained when \(f&apos;(x) = 0\). However there is one exception. The idea of me moving forwards then backwards from the maxima only works if I can indeed move before and after the time \(x\). In other words, if I’m at one of the endpoints \(\{ a,b \}\) the above does not apply. Hence we can have local minima/maxima when \(f&apos;(x) = 0\) or at \(\{ a,b \}\).&lt;/p&gt;

&lt;p&gt;We still need to figure out what are the maxima and what are the minima. Thinking in terms of gradients of slopes becomes hard at this point, but thinking in terms of acceleration makes things understandable. Say you are at a local maxima. Then your speed must be going from positive (moving forward) to negative (moving backwards), so your speed is decreasing, so you have negative acceleration. Hence \(f&apos;&apos;(x) &amp;lt; 0\), since we saw that \(f&apos;&apos;\) represents our acceleration. Similarly, at a local minima, \(f&apos;&apos;(x) &amp;gt; 0\). If neither is happening then we are neither at a local maxima nor minima, so we will call it a saddle point. Imagine a saddle point to be a the point where your speed is zero (just like in maxima or minima), but you are not accelerating away from your extrema. You might have gotten to an extreme and stayed there, or you might be moving forward, stop (speed is zero) and then start moving forward again, so it definitely isn’t a maxima / minima.&lt;/p&gt;

&lt;p&gt;Hence we figured out how to calculate the maxima and minima of a function \(f\) .&lt;/p&gt;

&lt;h2 id=&quot;whats-your-point-about-the-alternatives-then&quot;&gt;What’s your point about the alternatives then?&lt;/h2&gt;

&lt;p&gt;I will try to answer two questions about the above alternatives. First, which one would lead to better grades? Secondly, which one would be better for students development, however vague that might be?&lt;/p&gt;

&lt;p&gt;For ease of writing lets assume student A was exposed to alternative 1 and student B to alternative 2.&lt;/p&gt;

&lt;p&gt;Regarding the topic above, the grading method is fairly straightforward: We give functions to the students, and ask for them to tell us the local maxima and minima. Given that evaluation method, student A is most likely to provide better results. By consistent practice we trained A to give fast and correct answers. Student B, on the contrary, understands the idea of how to solve the problem but isn’t actually able to apply the tools needed to solve the problem at hand, for lack of practice. At first glance student A seems to be better of. However, lets see some time into the future. A few years later, at work, a problem pops up that can be solved by finding the maxima or minima of a function. Which one is more likely to think of using what they learned to solve the problem? Student A isn’t used to see the problem outside its well defined structure. You give him a function, you ask for the extrema, and he answers efficiently. Student B understands how the method comes about. He didn’t memorize a set of steps, he understood why they work and why they are needed. He has a mental image of how the problem must be solved. Hence, when such a problem is presented, I believe he is more likely to think of how the solving technique worked. More importantly, if he needs to adapt the problem (say, he wants to find the extreme of the acceleration, so he needs to go all the way to the 4th derivative), he is more likely to be able to adapt the problem.&lt;/p&gt;

&lt;p&gt;Foregoing my initial statement, teachers tend to teach both alternatives. First they show alternative 2 to provide understanding and context, and only then they move to alternative 1 which is the goal given. However I have a huge distaste for this approach due to to its poor long term returns. My view is that an extreme (a student A who learns exclusively via Alternative 1 and a student B who learns exclusively via alternative 2), then student B might only have Bs throughtout his studies, while A will appearingly be better by having As initially, but once the gaps and lack of understanding in his learning style start to matter he will sink into Bs, Cs, and so on. That is why I’d rather have understanding than efficiency. As Math with Bad Drawings phrased it, we (teachers) don’t want to put a ceiling on our students cognitive abilities, so we should always focus on Alternative 2. We shouldn’t even start a student on Alternative 1 if he hasn’t understood what is going on. I could go on about this, but at this point I’ll just reccoment you read Math with Bad Drawings’ &lt;a href=&quot;https://mathwithbaddrawings.com/2015/04/08/the-math-ceiling-wheres-your-cognitive-breaking-point/&quot;&gt;post&lt;/a&gt;, which reiterates how essential it is for us to value understanding over test performance.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Predicting Product Conversion Rates</title>
   <link href="https://blog.mptc.uk/posts/Predicting-Conversion-Rates"/>
   <updated>2017-12-28T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Predicting-Conversion-Rates</id>
   <content type="html">&lt;h2 id=&quot;given-the-past-success-of-a-product-how-can-we-try-to-predict-its-future-success&quot;&gt;Given the past success of a product, how can we try to predict its future success?&lt;/h2&gt;

&lt;p&gt;It seems like a harmless question and not too hard. A product which sold 20% of the times it was shown to a costumer has a 20% chance of being bought if we show it to the next costumer, right?&lt;/p&gt;

&lt;p&gt;Well, not exactly. In the above example we are using the formula \(\frac{S}{V}\), where \(S\) is the number of Sales and \(V\) the number of times a product was shown (i.e. visits). If a product has no sales yet, it is a bit unfair to say that it has zero chances of being bought.&lt;/p&gt;

&lt;h2 id=&quot;so-how-would-you-solve-that-problem&quot;&gt;So how would you solve that problem?&lt;/h2&gt;

&lt;!--excerpt ends here--&gt;

&lt;p&gt;The reasoning we will follow is the following:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Let \(X\) be a random variable representing the ‘true’ probability of a product converting. I’m using true as an intrinsic property of the product. We can also view it as the conversion rate of the product as the number of visits goes to infinity.&lt;/li&gt;
  &lt;li&gt;We will find the pdf \(f(\theta)\) of \(X\)&lt;/li&gt;
  &lt;li&gt;We will find the expectation of the product converting, i.e. \(\mathbb{E}[X]\)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of the steps above are the same as the ones on the previous post on &lt;a href=&quot;/posts/How-to-AB-Test&quot;&gt;AB Testing&lt;/a&gt;. As such I will skip the calculations and go directly to the results:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;\(X\) will follow a &lt;a href=&quot;https://en.wikipedia.org/wiki/Beta_distribution&quot;&gt;Beta distribution&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Letting \(S\) be sales and \(N = V-S\) be non-sales, i.e. visits without a sale, \(f(\theta) = \frac{\Gamma(S+N+2)}{\Gamma(S+1)\Gamma(N+1)} x^S (1-x)^N\)&lt;/li&gt;
  &lt;li&gt;
\[\mathbb{E}[X] = \int_0^1{\frac{\Gamma(S+N+2)}{\Gamma(S+1)\Gamma(N+1)} x^S (1-x)^Ndx} = \frac{S+1}{N+2}\]
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hence for a product with \(V\) visits and \(N\) observations we should expect future clients to buy the product with probability \(\frac{S+1}{N+2}\).&lt;/p&gt;

&lt;h2 id=&quot;cool-we-are-done-then&quot;&gt;Cool, we are done then.&lt;/h2&gt;

&lt;p&gt;Not yet. Depending on the market / platform where you are selling products, you might have very different conversion rates. Usually they are fairly below 50%. Lets assume for a second that all products we are selling average to a conversion rate of 10%. When a new product comes (\(S = 0\) and \(N = 0\)) then we would predict a future conversion rate of 50%, but intuitively a prediction of 10% should be better.&lt;/p&gt;

&lt;h2 id=&quot;yes-that-is-a-problem-how-do-you-fix-that&quot;&gt;Yes, that is a problem. How do you fix that?&lt;/h2&gt;

&lt;p&gt;If we look back at step 2 above we have made subtle assumption: we assumed that we have no prior information about our hidden random variable \(X\). If we know nothing about the product, then we are indirectly assuming that \(X\) is uniform on \([0,1]\) until we get new information. If you are wondering why assuming no knowledge about \(X\) leads us to assuming \(X\) is uniform on \([0,1]\), the reason is that the best measure of our knowledge about a system is &lt;a href=&quot;https://en.wikipedia.org/wiki/Entropy_(information_theory)&quot;&gt;entropy&lt;/a&gt; and the uniform distribution maximizes entropy. If you want to learn more about this I would recommend reading through Shannon’s A Mathematical Theory of Communication. In the meantime I will go back to the question at hand.&lt;/p&gt;

&lt;p&gt;We assumed we had no knowledge about \(X\) when we fact we do. As such we can use &lt;a href=&quot;https://en.wikipedia.org/wiki/Bayesian_probability&quot;&gt;Bayesian probability&lt;/a&gt;. The main idea of Bayesian probability is that we have a certain distribution \(X_0\) for a hidden random variable, and as time passes we make observations, in our case about sales or lack thereof, and update our estimates \(X_t\) as time \(t\) moves forward.&lt;/p&gt;

&lt;h2 id=&quot;and-how-do-we-do-that&quot;&gt;And how do we do that?&lt;/h2&gt;
&lt;p&gt;We will use &lt;a href=&quot;https://en.wikipedia.org/wiki/Bayes%27_theorem&quot;&gt;Bayes’ Theorem&lt;/a&gt;, which states that \(\mathbb{P}(A|B) = \frac{\mathbb{P}(B|A)}{\mathbb{P}(B)}\mathbb{P}(A)\). In other words the probability of \(A\) being true is updated after observation \(B\) by the factor \(\frac{\mathbb{P}(B|A)}{\mathbb{P}(B)}\). That formula works well for discrete cases, but for continuous cases we get a slightly different formula:&lt;/p&gt;

&lt;p&gt;If \(f(\theta)\) is our distribution as above and \(g(\theta)\) our initial knowledge of the distribution, then our updated knowledge is given by \(f(\theta)g(\theta)\) normalized, since a pdf must always integrate to 1. In a no knowledge situation we get \(g \equiv 1\) so \(f(\theta)g(\theta) = f(\theta)*1 = f(\theta)\) as we concluded before. However in our case we have the knowledge that the average product sells 10% of the time.&lt;/p&gt;

&lt;h2 id=&quot;how-do-we-translate-that-into-the-function-g-&quot;&gt;How do we translate that into the function \(g\) ?&lt;/h2&gt;

&lt;p&gt;We will have to use our historic data. Assuming we have sold enough different products, then each product has its own conversion rate. As such the set of all our products has its own distribution. If we were to pick one product at random from our inventory then we would be taking a product with conversion rate modeled by that distribution. Hence we can think of adding a new product similar to taking the conversion rate from a product in our inventory. As such we have \(g\) and \(f\).&lt;/p&gt;

&lt;h2 id=&quot;so-we-just-multiply-the-2-distributions-normalize-and-we-are-done&quot;&gt;So we just multiply the 2 distributions, normalize and we are done?&lt;/h2&gt;

&lt;p&gt;That will certainly give us an estimation way better than our initial estimate. However there is one problem. Since our inventory might be big, \(g\) will probably be defined by a big array and multiplying it by f and then computing \(\mathbb{E}[f(\theta)g(\theta)]\) might be computationally expensive.&lt;/p&gt;

&lt;h2 id=&quot;can-we-simplify-it&quot;&gt;Can we simplify it?&lt;/h2&gt;

&lt;p&gt;There is one trick that might work, depending on our product distribution. We can try to model our initial distribution \(g\) as a beta distribution. We are getting now exact with our calculations so, depending on the sales data, this might work or not. If it works then we approximate \(g\) with a beta distribution with \(S_o\) sales and \(N_o\) non sales. Then (setting \(x = \theta\) for easier typing, and letting \(\propto\) mean proportional to) we get&lt;/p&gt;

\[\frac{f(x)g(x)}{\int_0^1{f(x)g(x)dx}} \propto\]

\[\propto f(x)g(x) \propto\]

\[\propto \frac{\Gamma(S+N+2)}{\Gamma(S+1)\Gamma(N+1)} x^S (1-x)^N \frac{\Gamma(S_0+N_0+2)}{\Gamma(S_0+1)\Gamma(N_0+1)} x^{S_0} (1-x)^{N_0} \propto\]

\[\propto x^S (1-x)^N x^{S_0} (1-x)^{N_0} \propto x^{S+S_0}(1-x)^{N+N_0}\]

&lt;p&gt;So after normalization \(f(x)g(x)\) has pdf&lt;/p&gt;

\[\frac{\Gamma(S+S_0+N+N_0+2)}{\Gamma(S+S_0+1)\Gamma(N+N_0+1)} x^{S+S_0} (1-x)^{N+N_0}\]

&lt;p&gt;Which is a Beta distribution with \(S + S_0\) sales and \(N + N_0\) non-sales. This makes sense intuitively because we can think of \(g\) as the distribution of \(X\) after \(S_0\) sales and \(N_0\) non-sales, and \(fg\) is the pdf of \(X\) updated after we see \(S\) more sales and \(N\) more non-sales.&lt;/p&gt;

&lt;p&gt;But then our estimation for a products future conversion rate becomes \(\frac{S+S_0 + 1}{S+S_0 + N + N_0 +2}\) which is both more accurate than the initial formula \(\frac{S}{N}\) and equally fast to compute.&lt;/p&gt;

&lt;h2 id=&quot;great-so-i-should-always-use-fracss_0--1ss_0--n--n_0-2-instead-of-fracsn&quot;&gt;Great, so I should always use \(\frac{S+S_0 + 1}{S+S_0 + N + N_0 +2}\) instead of \(\frac{S}{N}\).&lt;/h2&gt;

&lt;p&gt;Not really. First of all there’s the previous assumption that \(g\) can be modeled via a Beta Distribution. That depends on how rigorous we want to be, but it nonetheless needs to be checked. Secondly this was all about forecasting conversion rates. For analysis related to past performances I would not suggest using this formula since it is disconnected from the truth (i.e. the products actual conversion rate). However, re iterating, any predictive tool related to Conversion Rate should be using this formula instead.&lt;/p&gt;

&lt;p&gt;I will summarize with a few pros and cons of each predicted conversion rate.
s&lt;/p&gt;
&lt;h3 id=&quot;division-by-zero&quot;&gt;Division by zero:&lt;/h3&gt;
&lt;p&gt;For new products with no observations the formula \(\frac{S}{N}\) has no meaning, which can cause problems when doing some bulk analysis i.e. some machine learning on top of it&lt;/p&gt;

&lt;h3 id=&quot;cold-start-problem&quot;&gt;Cold Start Problem:&lt;/h3&gt;
&lt;p&gt;The Cold Start Problem is defined by not showing enough products that haven’t been seen a lot yet. If we use the Conversion Rate as a proxy of how much we should show a given product then new products will have \(CR = 0\) until their first conversion, which might take a while, and until then they will be barely shown. This does not happen with \(\frac{S+S_0 + 1}{S+S_0 + N + N_0 +2}\) and the opposite happens with \(\frac{S+1}{N+2}\) which maps new products predicted \(CR\) to \(\frac{1}{2}\) , which is generally above the average \(CR\).&lt;/p&gt;

&lt;h3 id=&quot;overvaluing-new-products&quot;&gt;Overvaluing new products:&lt;/h3&gt;
&lt;p&gt;This is the final statement in the last paragraph. \(\frac{S+1}{N+2}\) overshoots the predict \(CR\), while \(\frac{S+S_0 + 1}{S+S_0 + N + N_0 +2}\) maps new products to the average \(CR\), neither boosting nor penalizing them.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Scars</title>
   <link href="https://blog.mptc.uk/posts/Scars"/>
   <updated>2017-12-27T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Scars</id>
   <content type="html">&lt;p&gt;I found this lying around &lt;a href=&quot;https://www.reddit.com/r/WritingPrompts/comments/5kxe94/wp_you_live_in_a_world_where_each_lie_creates_a/&quot;&gt;Reddit&lt;/a&gt; and really enjoyed it.&lt;/p&gt;

&lt;p&gt;This story happens in a world where each lie creates a scar on the liar’s body. The bigger the lie, the deeper and larger the mark. One day, you meet someone that only has one scar; it is the biggest one you have ever seen.&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;blockquote&gt;
  &lt;p&gt;He was a real good guy, through and through. Never met anyone quite like him since, never really expect I will either.&lt;/p&gt;

  &lt;p&gt;People like Joe don’t come around often. Once in a lifetime, maybe, if you’re lucky.&lt;/p&gt;

  &lt;p&gt;Almost everyone I’ve ever met had the tiny silvered paper cuts of white lies on their fingers. It’s a price of formalities, a camouflage of sorts, as everyone has a few, some deeper cut than others and over the years; opened and reopened time after time. And not just that, but the larger cuts, silvery things on forearms and shins, necks and backs. People lie, it’s just the way of things.&lt;/p&gt;

  &lt;p&gt;Sometimes the pain is worth the deception, the balancing scale plays out mentally before a person’s mouth opens.&lt;/p&gt;

  &lt;p&gt;Joining the force was what I wanted. There was a lie I told myself: A Lie I scratched in deep, over and over again. I wanted to change, I wanted my parents to be proud: All lies, tiny scratching lines on my shoulder to create a strange and deceitful pattern that never seemed to heal completely.&lt;/p&gt;

  &lt;p&gt;In truth, I joined the force because I had nothing left. I joined as a last ditch effort to save myself from rock bottom. Among the elite, surrounded by the brave and the successful, I simply kept my head down. It felt like being a fox, stuck among a pack of wolves. Just being there in the first place felt like deception.&lt;/p&gt;

  &lt;p&gt;But then, there was instructor Joe.&lt;/p&gt;

  &lt;p&gt;I had more scars than most, and that earned little trust- but if people were politely cold with me, they were visibly frigid with Joe. See, he didn’t have the traditional marks on his hands, he didn’t have cuts and nicks along his arms, his face or neck: At a quick glance you might have thought him the most honest man alive. In fact, at first people did. A man in his fading thirties without scars?&lt;/p&gt;

  &lt;p&gt;That’s like a fucking unicorn. They’re more myth and legend than person- yet there he was. Plain as day.&lt;/p&gt;

  &lt;p&gt;Everyone liked Joe that first week. Everyone wanted to be on good terms with him- I mean, who wouldn’t? In a world of liars and cheats, proof reminded at every twist and turn of the road, who wouldn’t want someone they could trust?&lt;/p&gt;

  &lt;p&gt;Well, that was before he took of his shirt in the locker-room. Before we all saw the hideous mark that covered half his back. One lie, but the most gruesome thing I’ve ever seen. From his shoulder blade to his ribs, it looked like a crashing comet of red and silvered white. A tiny portion of it just finally healing, a rough tear now recovered again.&lt;/p&gt;

  &lt;p&gt;It was all the same lie. That’s something you can just tell sometimes, just know it. Usually you can tell how many times too, but whatever the number was which he’d said that aloud, I don’t know.&lt;/p&gt;

  &lt;p&gt;He rarely spoke to begin with, issuing the orders with a stern smile, instructing as all the rest did. He was positive, encouraging, truthful: But that scar was on everyone’s mind. Deep, dark, and terrible: Someone who could tell a lie like that… Well, there was someone to watch out for. In the end though, it was at the range when things went well and truly sour.&lt;/p&gt;

  &lt;p&gt;Live-fire runs, we’d done them a thousand times, but that day I guess someone forgot themselves. Maybe they thought too much on what and how and their brain skipped a beat, or maybe they were just careless. Regardless of the reason, a shot fired when it shouldn’t have. Brass spit fire, Air swallowed metal, and lead took its first taste of iron, calcium, iron and dirt.&lt;/p&gt;

  &lt;p&gt;In that order.&lt;/p&gt;

  &lt;p&gt;We all stopped, eyes wide and watching that kid fall down real slow. First standing, staring with his hand pulling away- not even scared, just shocked. Red, like deep crimson soaking and spreading, he dropped down to his knees. Still, he wasn’t even there yet, it hadn’t quite processed.&lt;/p&gt;

  &lt;p&gt;That’s when Joe caught him- and all the shouting erupted. The pandemonium, the first real training turned to action kicking in. Cries for &lt;em&gt;“Medic!”&lt;/em&gt; and &lt;em&gt;“KIT! Get the kit!”&lt;/em&gt; as people ran for the directions they thought mattered.&lt;/p&gt;

  &lt;p&gt;I was close enough to know that wasn’t going to make a difference. Center of mass was what we trained for, the reason was straight and forward: Shoot to kill. Eliminate the target and move on.&lt;/p&gt;

  &lt;p&gt;So I sat there, weapon heavy in my hands as I watched Joe hold this kid, blood pouring out into the dirt like a faucet, and I listened to him repeat the words that cut deep. Over, and over, and over again.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;“Hang on, look at me. You’re gonna be alright.”&lt;/em&gt;&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;“You’re gonna be alright.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>GitLaw</title>
   <link href="https://blog.mptc.uk/posts/GitLaw"/>
   <updated>2017-12-26T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/GitLaw</id>
   <content type="html">&lt;p&gt;This post will start with the history of &lt;a href=&quot;https://github.com/&quot;&gt;GitHub&lt;/a&gt; and &lt;a href=&quot;https://git-scm.com/&quot;&gt;Git&lt;/a&gt;, founded on the 3rd April 2005, by &lt;a href=&quot;https://en.wikipedia.org/wiki/Linus_Torvalds&quot;&gt;Linus Torvalds&lt;/a&gt;&lt;sup&gt;1&lt;/sup&gt;. Once upon a time code started to be written. It would be written for websites, operative systems, games, and many other uses. As software got more complex it was harder to manage. It required multiple people working on the same project, and tight cooperation amongst the developers. It all got so complex that it was impossible for anyone to know how it worked in all its detail. As with everything, programming errors were made. When it broke, we first had to understand exactly what was the problem. Then we had to fix the code, but navigating code we don’t understand takes a long while, let alone knowing how to fix it without breaking other parts of the software. This is when Git and other Software Management tools came to help.&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#improvements-made-by-git-and-other-source-code-management-tools&quot; id=&quot;markdown-toc-improvements-made-by-git-and-other-source-code-management-tools&quot;&gt;Improvements made by Git and other Source Code Management tools&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#automatically-saving-a-products-history&quot; id=&quot;markdown-toc-automatically-saving-a-products-history&quot;&gt;Automatically saving a product’s history&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#branching-of-a-software-to-test-different-hypothesis&quot; id=&quot;markdown-toc-branching-of-a-software-to-test-different-hypothesis&quot;&gt;Branching of a software to test different hypothesis&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#faster-collaboration-by-working-on-different-parts-of-the-code&quot; id=&quot;markdown-toc-faster-collaboration-by-working-on-different-parts-of-the-code&quot;&gt;Faster collaboration by working on different parts of the code&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#code-reviews-became-a-lot-easier-with-git-diff&quot; id=&quot;markdown-toc-code-reviews-became-a-lot-easier-with-git-diff&quot;&gt;Code reviews became a lot easier with git diff&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#accountability-of-individual-changes&quot; id=&quot;markdown-toc-accountability-of-individual-changes&quot;&gt;Accountability of individual changes&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#so-how-does-this-relate-to-law&quot; id=&quot;markdown-toc-so-how-does-this-relate-to-law&quot;&gt;So how does this relate to law?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#what-is-gitlaw&quot; id=&quot;markdown-toc-what-is-gitlaw&quot;&gt;What is GitLaw?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#how-is-gitlaw-achieving-what-it-promises&quot; id=&quot;markdown-toc-how-is-gitlaw-achieving-what-it-promises&quot;&gt;How is GitLaw achieving what it promises?&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#transparency&quot; id=&quot;markdown-toc-transparency&quot;&gt;Transparency&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#accountability&quot; id=&quot;markdown-toc-accountability&quot;&gt;Accountability&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#reducing-costs-of-new-bills&quot; id=&quot;markdown-toc-reducing-costs-of-new-bills&quot;&gt;Reducing costs of new bills&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#speeding-up-the-process&quot; id=&quot;markdown-toc-speeding-up-the-process&quot;&gt;Speeding up the process&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#ease-of-use&quot; id=&quot;markdown-toc-ease-of-use&quot;&gt;Ease of use&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#that-all-sounds-great-but-how-do-we-implement-it&quot; id=&quot;markdown-toc-that-all-sounds-great-but-how-do-we-implement-it&quot;&gt;That all sounds great, but how do we implement it?&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#step-1-developing-a-law-book-filetype--lawbook-&quot; id=&quot;markdown-toc-step-1-developing-a-law-book-filetype--lawbook-&quot;&gt;Step 1: Developing a law book filetype ( LawBook )&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#step-2-developing-a-web--local-editor&quot; id=&quot;markdown-toc-step-2-developing-a-web--local-editor&quot;&gt;Step 2: Developing a web / local editor&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#step-3-lawbook-to-pdf&quot; id=&quot;markdown-toc-step-3-lawbook-to-pdf&quot;&gt;Step 3: LawBook to pdf&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#step-4-setup-with-git&quot; id=&quot;markdown-toc-step-4-setup-with-git&quot;&gt;Step 4: Setup with Git&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#step-5-build-gitlaw&quot; id=&quot;markdown-toc-step-5-build-gitlaw&quot;&gt;Step 5: Build GitLaw&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#step-6-move-lawbooks-to-gitlaw&quot; id=&quot;markdown-toc-step-6-move-lawbooks-to-gitlaw&quot;&gt;Step 6: Move LawBooks to GitLaw&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#step-7-give-repositories-ownership-to-the-respective-institutions&quot; id=&quot;markdown-toc-step-7-give-repositories-ownership-to-the-respective-institutions&quot;&gt;Step 7: Give repositories ownership to the respective institutions&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#do-you-think-the-above-will-happen&quot; id=&quot;markdown-toc-do-you-think-the-above-will-happen&quot;&gt;Do you think the above will happen?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#sources--related-links&quot; id=&quot;markdown-toc-sources--related-links&quot;&gt;Sources &amp;amp; Related Links&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#footnotes&quot; id=&quot;markdown-toc-footnotes&quot;&gt;Footnotes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;improvements-made-by-git-and-other-source-code-management-tools&quot;&gt;Improvements made by Git and other Source Code Management tools&lt;/h2&gt;

&lt;h3 id=&quot;automatically-saving-a-products-history&quot;&gt;Automatically saving a product’s history&lt;/h3&gt;

&lt;p&gt;GitHub works by keeping the software’s history using a simple interface. There is a central repository (we’ll call it origin) with the code. A pull request is the same as asking for the latest code version. When I have the code I make commits with comments explaining the changes made. There is a diff operator that allows me to see the changes made between commits (So we can just look at the code changes, instead of having to look at the entire code). When we are done with changing the code we make a push request, which equates to sending our branch to the origin and asking for it to be accepted. Others can see the uploaded code, see the changes committed and make comments on things that are not clear / can be improved. Once all the comments are answered we can finally merge the code.&lt;/p&gt;

&lt;p&gt;PS: The above is a simplification of the process, written with clarity for those who never worked with Git over correctness of all processes. For a detailed and fully correct explanation see &lt;a href=&quot;http://datasift.github.io/gitflow/IntroducingGitFlow.html&quot;&gt;GitFlow&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;branching-of-a-software-to-test-different-hypothesis&quot;&gt;Branching of a software to test different hypothesis&lt;/h3&gt;

&lt;p&gt;I can create 2 branches of a software (i.e. make 2 exact copies of the master code), make different changes and see which branch performs better. After choosing the ‘best’ branch I can make a pull request from it to the master branch, and discard the ‘losing’ branch.&lt;/p&gt;

&lt;h3 id=&quot;faster-collaboration-by-working-on-different-parts-of-the-code&quot;&gt;Faster collaboration by working on different parts of the code&lt;/h3&gt;

&lt;p&gt;Following the methodology above, I can make a pull request and work on component A of the code. You make a pull request and work on component B. We both make a push request and have our requests evaluated independently.&lt;/p&gt;

&lt;h3 id=&quot;code-reviews-became-a-lot-easier-with-git-diff&quot;&gt;Code reviews became a lot easier with git diff&lt;/h3&gt;

&lt;p&gt;As described above, after making the necessary code changes and a pull request, other developers will be able to see the changes made and comment on them, while focusing exclusively on the code differences.&lt;/p&gt;

&lt;h3 id=&quot;accountability-of-individual-changes&quot;&gt;Accountability of individual changes&lt;/h3&gt;

&lt;p&gt;Whenever a change is made, we can trace back who committed the change. That way any doubts regarding the thought process that lead to the code implementation and related questions can be directed easily, making it faster to understand ‘old’ code.&lt;/p&gt;

&lt;h2 id=&quot;so-how-does-this-relate-to-law&quot;&gt;So how does this relate to law?&lt;/h2&gt;

&lt;p&gt;Law is code, and code is law.&lt;/p&gt;

&lt;p&gt;Code is a set of rules that computers follow in order to attain the expected goal. As users require new functionalities and better performance the code gets harder to manage and organize. Code complexity has a cost on its own: it makes it harder for new people to understand and improve. Hence we need source code management tools such as Git.&lt;/p&gt;

&lt;p&gt;Law is a set of rules that people follow in order to attain the best for society&lt;sup&gt;2&lt;/sup&gt;. As human interactions get more complex the law gets more complex in order to handle all the edge cases. Law complexity has a cost on its own: bureaucracy makes it harder for new businesses to start, transactions to be made and its’ final user, the average citizen, loses track of what he can, can’t and should do. Hence we need Law Management tools such as GitLaw.&lt;/p&gt;

&lt;h2 id=&quot;what-is-gitlaw&quot;&gt;What is GitLaw?&lt;/h2&gt;

&lt;p&gt;GitLaw is a project. It is a project that promises to give transparency and accountability to the legislative branch, while speeding up the process and allowing easier citizens contributions.&lt;/p&gt;

&lt;h2 id=&quot;how-is-gitlaw-achieving-what-it-promises&quot;&gt;How is GitLaw achieving what it promises?&lt;/h2&gt;

&lt;h3 id=&quot;transparency&quot;&gt;Transparency&lt;/h3&gt;

&lt;p&gt;Firstly, by having all laws available in a central website, we can easily search for all laws and law books&lt;sup&gt;3&lt;/sup&gt;. Secondly, by having the history of law books available we can trace back changes to those who pushed for them to happen. This would avoid the problem of joining bills so that law changes are made as a bundle, where some small changes are passed without being given proper thought. By allowing for frequent yet shorter bills to be voted independently we bring visibility to the smaller changes.&lt;/p&gt;

&lt;h3 id=&quot;accountability&quot;&gt;Accountability&lt;/h3&gt;

&lt;p&gt;By checking history we can back trace changes done to those who pushed for them. This should make everyone think twice before pushing for a bill change. It adds moral costs (people should think through changing laws more carefully since they are accountable for what they push) while decreasing bureaucratic costs.&lt;/p&gt;

&lt;h3 id=&quot;reducing-costs-of-new-bills&quot;&gt;Reducing costs of new bills&lt;/h3&gt;

&lt;p&gt;Following the above, it decreases bureaucratic costs: Managing bills and push requests online reduces management costs, and being able to see law changes as difference files reduces the time wasted to understand what a new bill is doing.&lt;/p&gt;

&lt;h3 id=&quot;speeding-up-the-process&quot;&gt;Speeding up the process&lt;/h3&gt;

&lt;p&gt;Frequently bills are proposed as a list of planned changes. If it passes then a team of lawyers will change law books accordingly. Under GitLaw the government changes the law directly and bills are just the difference files.&lt;/p&gt;

&lt;p&gt;Remark: Even though we should be fast to consider and approve new bills, the stability of laws is very important if we want to foster events. Ideally bills would be passed but only became ‘valid’ every x months or so (as a group), so that it wouldn’t keep changing constantly. However this detail and others can and should be more thoroughly though about after implementing GitLaw, since this problem is independent of whether or not we are using GitLaw.&lt;/p&gt;

&lt;h3 id=&quot;ease-of-use&quot;&gt;Ease of use&lt;/h3&gt;

&lt;p&gt;GitHub requires learning, but almost every developer uses it because it quickly pays off for how easy maintaining code becomes. Similarly GitLaw would require a learning phase (probably no more than a few hours), but after that we would be able to see the law at a specific period in time, see who advocated for each bill, check the discussions had before passing each bill to know how well it was though about.&lt;/p&gt;

&lt;h2 id=&quot;that-all-sounds-great-but-how-do-we-implement-it&quot;&gt;That all sounds great, but how do we implement it?&lt;/h2&gt;

&lt;p&gt;This is the tricky part (as with everything). Personally I have no doubts about the usefulness of such system, but for any change to go through there must be people pushing for it to happen. Society benefits as a whole (and a lot), but there is no one who benefits enough to push for it. In order to bring interest to it either we find a great bunch of philanthropists willing to put in the hours (ideal but usually unlikely given how many other problems we have to work on), or we need to find either public funding or a sustainable business model to implement this.&lt;/p&gt;

&lt;h3 id=&quot;step-1-developing-a-law-book-filetype--lawbook-&quot;&gt;Step 1: Developing a law book filetype ( LawBook )&lt;/h3&gt;

&lt;p&gt;The most similar occurrence of this is &lt;a href=&quot;https://fountain.io&quot;&gt;Fountain&lt;/a&gt;, as mentioned in &lt;a href=&quot;https://blog.abevoelker.com/gitlaw-github-for-laws-and-legal-documents-a-tourniquet-for-american-liberty/&quot;&gt;Abe Voelker’s blog&lt;/a&gt;. The idea is simple: instead of having PDFs, Microsoft Word / Google Docs or another general purpose filetype to edit law books, we should have a specific one designed for exclusively for laws. The format of law books does not differ significantly from each other. I would compare it to designing a syntax for Screenplays similar to what &lt;a href=&quot;https://fountain.io&quot;&gt;Fountain&lt;/a&gt; achieved.&lt;/p&gt;

&lt;p&gt;The filetype should have metadata such as creation date, author, owner and others included. In the file itself we should be able to define sections, sub sections,… and reference each other. This part needs to be better thought about, but ideally we would need at least a lawyer involved (to enlighten us about how to generalize a law book’s structure) and a programmer (ideally someone who is familiar with parsing documents, to avoid possible problems). Maybe a variation of markdown would be ideal.&lt;/p&gt;

&lt;p&gt;Remark: It is common to define the meaning of certain words to avoid ambiguity, such as in the &lt;a href=&quot;https://www.ietf.org/rfc/rfc2119.txt&quot;&gt;RFC2119&lt;/a&gt;. We could just have all such defined words link to their definition, decluttering space.&lt;/p&gt;

&lt;p&gt;Ideally we would end with a page like &lt;a href=&quot;https://fountain.io/syntax&quot;&gt;Fountain’s Syntax Page&lt;/a&gt;, which explain how to write with this syntax.&lt;/p&gt;

&lt;h3 id=&quot;step-2-developing-a-web--local-editor&quot;&gt;Step 2: Developing a web / local editor&lt;/h3&gt;

&lt;p&gt;The LawBook we defined above could directly be edited via a text editor, but we want to make it easier and more intuitive to use. As such we need a text editor. It would need to allow:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Add sections / subsections and others.&lt;/li&gt;
  &lt;li&gt;References to other sections&lt;/li&gt;
  &lt;li&gt;Add word definitions (or link to word definitions in other documents)&lt;/li&gt;
  &lt;li&gt;Warn about broken links, since we might point to a document and after a while that document is changed, rendering the link invalid.&lt;/li&gt;
  &lt;li&gt;(Optional) Reference to other law books.&lt;/li&gt;
  &lt;li&gt;etc&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It should be as plain to use as possible. Keeping it simple will make it easier to use. That’s why I personally prefer a web based editor, but this is up to debate.&lt;/p&gt;

&lt;h3 id=&quot;step-3-lawbook-to-pdf&quot;&gt;Step 3: LawBook to pdf&lt;/h3&gt;

&lt;p&gt;Essential for easy printing / sending rulebooks to people. Shouldn’t be hard to implement. Since we are aiming this pdfs for possible printing then we need to think carefully how to resolve both internal links and links to other LawBooks.&lt;/p&gt;

&lt;h3 id=&quot;step-4-setup-with-git&quot;&gt;Step 4: Setup with Git&lt;/h3&gt;

&lt;p&gt;Setup a repository, create a few LawBooks and make changes, see how it behaves.&lt;/p&gt;

&lt;h3 id=&quot;step-5-build-gitlaw&quot;&gt;Step 5: Build GitLaw&lt;/h3&gt;

&lt;p&gt;Probably the hardest part. GitLaw would be the effective GitHub for Law, a browser based editor where people could see the central repository branches, diffs, comments, push requests (i.e. bills) and everything else. This also needs to be well though of before implementing. A good starting point is to analyze GitHub functionality and see where it has unneeded and/or missing features for the GitLaw needs.&lt;/p&gt;

&lt;h3 id=&quot;step-6-move-lawbooks-to-gitlaw&quot;&gt;Step 6: Move LawBooks to GitLaw&lt;/h3&gt;

&lt;p&gt;All publicly available LawBooks can be moved to GitLaw, without the need for legal permission (after all LawBooks are already publicly available).
Having an easy to read online LawBook reader is crucial to bringing people’s attention to the tool. If it is easier to use than tracking all the law books scattered through different institutions then it will be used.&lt;/p&gt;

&lt;h3 id=&quot;step-7-give-repositories-ownership-to-the-respective-institutions&quot;&gt;Step 7: Give repositories ownership to the respective institutions&lt;/h3&gt;

&lt;p&gt;Allow institutions to alter the LawBooks themselves. We need good tutorials on how to use the tools we provide, but this project should be straightforward.&lt;/p&gt;

&lt;h2 id=&quot;do-you-think-the-above-will-happen&quot;&gt;Do you think the above will happen?&lt;/h2&gt;

&lt;p&gt;Yes. Steps 1 to 3 shouldn’t be too hard with part time investment. Step 4 is incredibly hard and probably will require full time investment. Maybe discussing the possibility with GitHub itself would make it easier. Maybe not. Step 5 is time consuming but isn’t hard. Step 6 is the easiest one if we advertise our goal during the process. All of the above should be made into an MVP, and then improve on that by iterating over the various steps. By starting as a lookup tool with history (for lawyers to see the current laws and nothing else), it should get some traction.&lt;/p&gt;

&lt;h2 id=&quot;sources--related-links&quot;&gt;Sources &amp;amp; Related Links&lt;/h2&gt;

&lt;p&gt;Abe Voelker’s blog - &lt;a href=&quot;https://blog.abevoelker.com/gitlaw-github-for-laws-and-legal-documents-a-tourniquet-for-american-liberty/&quot;&gt;GitLaw: GitHub for Laws and Legal Documents - a Tourniquet for American Liberty&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Being considered by the French Government - &lt;a href=&quot;https://forum.etalab.gouv.fr/t/gitlaw-using-version-control-software-to-build-laws-collaboratively/2622&quot;&gt;forum.etalab.gouv.fr&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EU - &lt;a href=&quot;https://joinup.ec.europa.eu/news/european-parliament-share&quot;&gt;European Parliament to share amendment web tool as open source&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;footnotes&quot;&gt;Footnotes&lt;/h2&gt;

&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; Git - &lt;a href=&quot;https://en.wikipedia.org/wiki/Git#History&quot;&gt;How it actually came to be&lt;/a&gt; instead of the short tale I tell.&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;2&lt;/sup&gt; If this is the one and only goal of having laws is debatable, but lets assume this is true for now. It shouldn’t be too far from this anyway.&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;3&lt;/sup&gt; By law book I mean a document where a set of laws are written. Law book sounds weird, but I didn’t find a better term. Tell me if you know the actual name for those.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Nash's Equilibrium</title>
   <link href="https://blog.mptc.uk/posts/Nash-Equilibrium"/>
   <updated>2017-12-22T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Nash-Equilibrium</id>
   <content type="html">&lt;p&gt;Lets play a game. It is called Rock Paper Scissors. After each round the winner receives 3£&lt;sup&gt;1&lt;/sup&gt; from the loser. However I have an handicap. I can never ever play Scissors. How much should you pay to play this game?&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;h2 id=&quot;somewhere-between-0-and-3-&quot;&gt;Somewhere between 0£ and 3£ ?&lt;/h2&gt;

&lt;p&gt;True. If you payed 0£ you would not be expecting to lose money and if you paid 3£ you would certainly not make a profit, so you should pay something in between those values. However we can do better than that. We can find the specific value it is fair to pay.&lt;/p&gt;

&lt;h2 id=&quot;how&quot;&gt;How?&lt;/h2&gt;

&lt;p&gt;Lets try to understand the game better. I can only play Rock or Paper. Hence the the possible outcomes for you are:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;Rock&lt;/th&gt;
      &lt;th&gt;Paper&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Paper&lt;/td&gt;
      &lt;td&gt;3£&lt;/td&gt;
      &lt;td&gt;0£&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Scissors&lt;/td&gt;
      &lt;td&gt;-3£&lt;/td&gt;
      &lt;td&gt;3£&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Rock&lt;/td&gt;
      &lt;td&gt;0£&lt;/td&gt;
      &lt;td&gt;-3£&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Since playing Rock is always worse for you than playing Paper we can assume you never play it, so the possible outcomes become:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;Rock&lt;/th&gt;
      &lt;th&gt;Paper&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Paper&lt;/td&gt;
      &lt;td&gt;3£&lt;/td&gt;
      &lt;td&gt;0£&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Scissors&lt;/td&gt;
      &lt;td&gt;-3£&lt;/td&gt;
      &lt;td&gt;3£&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;If you always play Paper you never lose money and no matter what we play you will never win more than 3£ , so your initial guess of paying something between 0£ and 3£ makes sense. If you always played Paper then I would always play Paper and you would win no money. However you could change your tactic to playing Scissors in order to win the 3£, but then you will be at risk of losing 3£ if I play Rock.&lt;/p&gt;

&lt;h2 id=&quot;how-does-that-help-us-reach-the-fair-value&quot;&gt;How does that help us reach the fair value?&lt;/h2&gt;

&lt;p&gt;In practice in every play we will choose each move independently and with certain probabilities. For instance, I will choose Rock with probability \(p\) and Paper with probability \(1-p\) (remember that the sum of the probabilities of all of our moves must add up to \(1\)). You will choose to play Scissors with a probability \(q\) and Paper with probability \(1-q\). As such the probabilities of each move are:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;Rock&lt;/th&gt;
      &lt;th&gt;Paper&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Paper&lt;/td&gt;
      &lt;td&gt;$$p(1-q)$$&lt;/td&gt;
      &lt;td&gt;$$(1-p)(1-q)$$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Scissors&lt;/td&gt;
      &lt;td&gt;$$pq$$&lt;/td&gt;
      &lt;td&gt;$$(1-p)q$$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Let \(L(p,q)\) be how much money you expect to make given the above probabilities. Then&lt;/p&gt;

\[L(p,q) =\]

\[= [pq(-3)] + [(1-p)q(3)] + [p(1-q)(3)] + [(1-p)(1-q)(0)] =\]

\[=  -3pq + 3(1-p)q + 3p(1-q) =\]

\[= 3(p + q - 3pq)\]

&lt;p&gt;Cool. Now we have a function giving us how much you expect to get after a game. I will try to choose \(p\) so that \(L\) is minimal, and you will try to choose \(q\) so that \(L\) is maximal. Nash’s work (and the reason for this post’s title) was about proving that this equilibrium always exists for non-deterministic games (and this is called Nash’s Equilibrium)&lt;/p&gt;

&lt;h2 id=&quot;so-how-do-we-choose-p-and-q-&quot;&gt;So how do we choose \(p\) and \(q\) ?&lt;/h2&gt;

&lt;p&gt;We have to go back to finding maxima and minima of functions (if your high school math is fresh you should probably skip this section). We have to choose \(p\) in the interval [0,1]. Therefore either there is a local maxima somewhere in the middle or the maximum is attained at the endpoints. To find interior maxima we will use derivatives: If \((p_0,q_0)\) is a maxima or minima, then the derivative of \(L\) with respect to \(p\) vanishes (i.e. equals zero) at \(p_0\). Doing the actual computations we get:&lt;/p&gt;

\[0 = \frac{\partial }{\partial p}(L) =\]

\[= \frac{\partial }{\partial p}(3(p+q-3pq)) =\]

\[= 3(1 - 3q) \implies  q = \frac{1}{3}\]

&lt;p&gt;Similarly,&lt;/p&gt;

\[0 = \frac{\partial }{\partial q}(L) \implies q = \frac{1}{3}\]

&lt;p&gt;Hence our local maxima / minima can be found when \(p \in \{ 0,\frac{1}{3},1 \}\) and \(q \in \{ 0,\frac{1}{3},1 \}\).&lt;/p&gt;

&lt;p&gt;Visually the expected returns for you (i.e. \(L(p,q)\) ) are:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$$q \setminus p$$&lt;/th&gt;
      &lt;th&gt;$$0$$&lt;/th&gt;
      &lt;th&gt;$$\frac{1}{3}$$&lt;/th&gt;
      &lt;th&gt;$$1$$&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$$0$$&lt;/td&gt;
      &lt;td&gt;$$0$$(A)&lt;/td&gt;
      &lt;td&gt;$$1$$(B)&lt;/td&gt;
      &lt;td&gt;$$3$$(C)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$$\frac{1}{3}$$&lt;/td&gt;
      &lt;td&gt;$$1$$(D)&lt;/td&gt;
      &lt;td&gt;$$1$$(E)&lt;/td&gt;
      &lt;td&gt;$$1$$(F)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$$1$$&lt;/td&gt;
      &lt;td&gt;$$3$$(G)&lt;/td&gt;
      &lt;td&gt;$$1$$(H)&lt;/td&gt;
      &lt;td&gt;$$-3$$(I)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;I can choose the value of \(p\), which amounts to choosing the column we are in. Since I want to minimize your returns (i.e. minimize \(L\)) then I am happy if, for any line you choose, I choose the column with minimal \(L\). Hence my choice will end up being one of (A),(D),(E),(F),(I). (A) and (I) because they are the minimum in their respective rows, and (D),(E),(F) because they are all equal in their row.&lt;/p&gt;

&lt;p&gt;Similarly you get to choose \(q\) i.e. you choose the row. In order to maximize \(L\), you will only be happy with (C) and (G) since they are the maximum in their respective columns, or (B),(E),(H), for a final choice in the set (C),(B),(E),(H),(G).&lt;/p&gt;

&lt;p&gt;Looking at the 2 sets we chose: \(\{A,D,E,F,I \}\) and \(\{ C,B,E,H,G \}\) we notice that they only intersect in E (Nash proved that when following this method there will always be an intersection. If you want to know how I would recommend reading his paper, though it is way more advanced than this post). As such when we both play optimally we will be in cell (E).&lt;/p&gt;

&lt;h2 id=&quot;i-lost-track-how-does-this-relate-to-the-original-problem&quot;&gt;I lost track. How does this relate to the original problem?&lt;/h2&gt;

&lt;p&gt;We saw that If we both play optimally then we will end up in cell (E), where \(p = \frac{1}{3} = q\) . Since \(p\) is my probability of playing Rock and \(q\) your probability of playing Scissors, then we found the optimal strategy for both of us.&lt;/p&gt;

&lt;p&gt;Also, for those probabilities, \(L(\frac{1}{3},\frac{1}{3}) = 1\) so you will have an average return of 1£.&lt;/p&gt;

&lt;p&gt;Therefore, going back to the original question, paying 1£ would make it a fair game. Anything less than that and you will most likely profit, anything more than that and you will most likely lose money.&lt;/p&gt;

&lt;p&gt;&lt;sub&gt;&lt;sup&gt;1&lt;/sup&gt; You are probably wondering why I choose 3£ instead of 1£ . During the calculations we end up having to divide that value by 3, so this way I have to work with less fractions.&lt;/sub&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Michellin</title>
   <link href="https://blog.mptc.uk/posts/Michellin"/>
   <updated>2017-11-09T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Michellin</id>
   <content type="html">&lt;p&gt;For any of you who have a car, you might have had the experience of getting a tire blown and have to pay for it. This is not a big problem (The automobile industry needs to profit and you need a tire, so it seems like a win win situation). There is a problem with incentives whoever.
Michellin profits whenever you need a replacement tire. The more often you need a replacement tire the more they get paid. Hence, there is no reason for them to improve the quality of their tires.&lt;/p&gt;

&lt;h2 id=&quot;that-is-problematic-how-can-we-solve-it&quot;&gt;That is problematic. How can we solve it?&lt;/h2&gt;

&lt;p&gt;There is a &lt;a href=&quot;https://michelin-solutions.com/en/service/pay-per-kilometre-travelled/&quot;&gt;solution&lt;/a&gt; currently being tested by Michellin. Instead of 
paying per tire, you are being paid per kilometer driven. This is being possible due to the diminishing costs of technology. In particular, Michellin is equipping tires with sensors that measure the distance traveled, temperature, weariness and many others. This way they are able to charge for the number of kilometers driven. Not only that but they are kept up to date about the tires weariness and can inform their clients about needed tire changes if needed.&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;h2 id=&quot;great-so-we-have-a-solution&quot;&gt;Great, so we have a solution.&lt;/h2&gt;

&lt;p&gt;Lets not jump to conclusions too fast. We need to consider the incentives in case A (pay per tire) and case B (pay per kilometer)&lt;/p&gt;

&lt;h3 id=&quot;case-a&quot;&gt;Case A:&lt;/h3&gt;

&lt;p&gt;Since we are paying per tire Michellin has no incentive to improve the quality of the tires. Clients have to be careful in their driving in order to avoid unneeded costs. By default costs associated with tire replacement are paid by the Client.&lt;/p&gt;

&lt;h3 id=&quot;case-b&quot;&gt;Case B:&lt;/h3&gt;

&lt;p&gt;Since we are paying per mile it is in Michellin’s best interest to minimize their cost per km driven, hence making better tires. By default costs associated with tire replacement are paid by Michellin. Michellin is also able to call clients for a tire change if their sensors raise any alarms. Clients do not need to worry as much about wearing out tires.&lt;/p&gt;

&lt;h2 id=&quot;but-you-still-agree-that-case-b-is-best-right&quot;&gt;But you still agree that Case B is best, right?&lt;/h2&gt;

&lt;p&gt;Definitely yes, but I wanted to bring attention to the incentives in play. By Michellin’s own initiative they were able to change the company incentives so that investing in durable tires is in the company’s best interest. Aligning society’s interests with company’s interests is more powerful than legislation or company claims to do so when research and other company sectors might not be transparent to the public.
There are many industries where similar changes can be made, so do share any ideas that come to your mind.&lt;/p&gt;

&lt;p&gt;Kudos to Michellin for doing this out of their own initiative. I don’t believe this option (pay per kilometer) is available to everyday single car customers, but this solution is being rolled out already to fleet owners (be it trucks, airplanes or other wheeled vehicles).&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Differential Cryptography</title>
   <link href="https://blog.mptc.uk/posts/Differential-Cryptography"/>
   <updated>2017-10-06T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Differential-Cryptography</id>
   <content type="html">&lt;p&gt;Apparently Apple is taking &lt;a href=&quot;https://www.wired.com/2016/06/apples-differential-privacy-collecting-data/&quot;&gt;steps&lt;/a&gt; to protect their users privacy by using Differential Privacy.&lt;/p&gt;

&lt;h2 id=&quot;so-what-is-differential-privacy&quot;&gt;So what is differential privacy?&lt;/h2&gt;

&lt;p&gt;I wondered the same after reading the article, since they mention its benefits a lot without explaining what it is. After reading about it for a bit in Wikipedia under the title &lt;a href=&quot;https://en.wikipedia.org/wiki/Differential_privacy&quot;&gt;Differential Privacy&lt;/a&gt;, I understood the goal of differential privacy to be messing with the data of individuals (making it useless for individual targeting purposes) while preserving its statistical properties as a whole. In essence is a way of extracting value from knowledge of millions of individuals without invading the privacy of a single individual.&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;h2 id=&quot;that-sounds-great-but-how-can-you-do-that&quot;&gt;That sounds great, but how can you do that?&lt;/h2&gt;

&lt;p&gt;The best example I was able to come up with: say that you want to survey people in order to find how many people smoke weed. Since it is illegal to sell weed and there’s a big discussion about it, people might not feel comfortable disclosing whether they smoke weed or not. Instead, lets put a little math into this:&lt;/p&gt;

&lt;p&gt;Let each person flip a coin. If it lands heads then the person answers truthfully, otherwise it answers at random (with another coin flip). Say that \(q\) of the population actually smokes weed. Then through this method we expect to have \(p = \frac{q}{2} + \frac{1}{4}\) of the population to answer yes. Rearranging the equation we get \(q =2p-\frac{1}{2}\). Hence we can retrieve (with some statistical noise) a rough estimate of the population that actually smokes weed. However, if we were to go to a single individual and claim that they smoke weed, we couldn’t since we couldn’t be sure whether he actually smoked weed or wether it was chance that made him answer yes.&lt;/p&gt;

&lt;h2 id=&quot;so-the-use-of-differential-privacy-is-to-protect-wrongdoers&quot;&gt;So the use of differential privacy is to protect wrongdoers?&lt;/h2&gt;

&lt;p&gt;No. First of all wrongdoing is subjective, but I won’t go there now. I’ll try to keep this post more math and tech related. Secondly, Machine Learning has made the need for Differential Privacy increase. Here’s an example: Say we want to build software capable of diagnosing illnesses. AI needs a lot of data for that, in particular medical records of thousands of people. We can hide the name of the patient and any ID associated with him before releasing the data to the AI corporation, but this is not a risk free action. From intel such as height, body weight, race, gender and by joining any medical condition we could find the original individual to whom the data belonged to, and maybe learn about some condition that would preferably be kept private.
By messing with the data a bit, we can increase individual privacy at the cost of the AI’s accuracy. This is the big trade off in Differential Privacy&lt;sup&gt;1&lt;/sup&gt;.&lt;/p&gt;

&lt;h2 id=&quot;so-using-differential-privacy-is-awesome-and-we-should-admire-apple-for-using-it-d&quot;&gt;So using Differential Privacy is awesome and we should admire Apple for using it :D&lt;/h2&gt;

&lt;p&gt;Yes and No. Using Differential Privacy is great, but Apple didn’t release any info on how they are using it. They might be using it on a tiny insignificant part and claiming it to be a big thing, or they might be actually doing a great job. It’s hard to know when companies keep so much information to themselves, which makes sense financially but for outsiders it makes us stand stronger behind initiatives like the &lt;a href=&quot;https://en.wikipedia.org/wiki/Open-source_software_movement#Legal_issues&quot;&gt;Open Source Software Movement&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; Note that I haven’t given a specific method of jumbling the data, that needs proper and careful thought which I might give at a later time. Probably not though.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>How to AB Test</title>
   <link href="https://blog.mptc.uk/posts/How-to-AB-Test"/>
   <updated>2017-10-05T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/How-to-AB-Test</id>
   <content type="html">&lt;p&gt;This article is mildly related to &lt;a href=&quot;https://support.google.com/analytics/answer/2844870&quot;&gt;Google’s Multi Armed Bandit experiments&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;what-are-ab-tests&quot;&gt;What are AB Tests?&lt;/h2&gt;

&lt;p&gt;Suppose that you have a problem (say you want to be the best &lt;a href=&quot;https://www.callofduty.com&quot;&gt;CoD&lt;/a&gt; player) and you have many possible solutions to your problem (namely different play styles, from the most aggressive to the most defensive, using different weapons, and many more alternatives). You have some ideas as to what are the best tactics, but you’re not sure which one would fit you best (in this case best means the ratio between winning and losing matches).&lt;/p&gt;

&lt;p&gt;What AB Tests propose is that you try out the different options for a length of time. After that time you will have played each option \(i\) \(n_i\) times and have won \(r_i\) times. As such \(\frac{n_i}{r_i}\) will give you an approximation of the win ratio for each alternative, and you can make an informed decision on what weapons to use, your play style, etc.&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;h2 id=&quot;wouldnt-it-take-ages-to-test-all-the-different-options&quot;&gt;Wouldn’t it take ages to test all the different options?&lt;/h2&gt;

&lt;p&gt;Yes! That is why the multi armed bandits come into play. Say that you have a certain play style that you think is the best. You define it as your champion and play with it most of the time. However whenever there’s an alternative you think might outplay your current option you bring it into the alternatives pool, and you play with it occasionally. Then you can start ruling out alternatives who have too few wins and betting more on the most promising alternatives, instead of waiting for a fixed amount of time / trials (and possibly sacrificing your long term win rates). You need to be careful not too discard alternatives too soon (just because you lost 3 matches in a row doesn’t mean it’s a bad alternative, maybe it was just bad luck. Some people call this statistical significance), and similarly not to bet exclusively on the higher end alternatives.&lt;/p&gt;

&lt;h2 id=&quot;so-how-do-you-know-which-ones-to-use&quot;&gt;So how do you know which ones to use?&lt;/h2&gt;

&lt;p&gt;There are different suggestions for solving this problem. I would be interested in seeing AB Tests on AB Testing Techniques. However in this post I am going to provide one alternative that I think is best. Do comment below better alternatives / points I’ve missed.&lt;/p&gt;

&lt;h2 id=&quot;thats-all-good-but-i-havent-heard-your-solution-yet&quot;&gt;That’s all good, but I haven’t heard your solution yet.&lt;/h2&gt;

&lt;p&gt;Ok, say you have \(m\) alternatives of play and you are about to play a match. In the past you have played \(n_i\) matches with option \(i\), of which you won \(r_i\) matches. My current goal is to maximize the percentage of wins over a long time period. So I’ll make this formal and I’ll say I want to maximize my expected wins over the next \(k\) matches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; I’m going to get more technical from here onwards.&lt;/p&gt;

&lt;p&gt;We can then define our problem as one of finding the following function:&lt;/p&gt;

\[C(n,r,k) : (\mathbb{N}^{+})^{m}  \times (\mathbb{N}^{+})^{m}  \times \mathbb{N}^{+} \mapsto I_m\]

&lt;p&gt;Which maps the vector \(n = (n_1,n_2,...,n_m)\) and \(r = (r_1,r_2,...,r_m)\) of observations and wins and the integer \(k\) to the integer \(i\) in \(I_m = {1,2,...,m}\) which is the best choice of alternative to play in order to maximise the long term win rate. In order to calculate this we need another function&lt;/p&gt;

\[V(n,r,k) : (\mathbb{N}^{+})^{m}  \times (\mathbb{N}^{+})^{m}  \times \mathbb{N}^{+} \mapsto \mathbb{R}\]

&lt;p&gt;which maps the same knowledge to the expected number of wins in the next k matches assuming optimal choices. Now we do some maths:&lt;/p&gt;

&lt;h2 id=&quot;how-likely-am-i-to-win-if-i-choose-to-play-with-alternative-i-&quot;&gt;How likely am I to win if I choose to play with alternative \(i\) ?&lt;/h2&gt;

&lt;p&gt;So you’ve had \(n_i\) observations so far and \(r_i\) wins. Let \(\theta\) be the underlying likelihood of winning. Since we know \(n_i\) and \(r_i\) then we can estimate the pdf&lt;sup&gt;1&lt;/sup&gt; of \(\theta\) by using Bayes Theorem. Letting \(a=n_i\), \(b=r_i\) we first compute:&lt;/p&gt;

\[\mathbb{P}( X=b | \theta) = C^a_b \theta^b (1-\theta)^{a-b}\]

&lt;p&gt;where \(X\) is the sum of \(a\) Bernoulli variables with probability \(\theta\) and \(C^a_b\) is the number of ways of choosing b elements out of \(a\) elements. From this we can get the pdf of the underlying \(\theta\) by normalizing the pdf:&lt;/p&gt;

\[f(\theta) = \frac{C^a_b \theta^b (1-\theta)^{a-b}}{\int_{0}^{1}C^a_b t^b (1-t)^{a-b}dt} = \frac{\theta^b (1-\theta)^{a-b}}{\int_{0}^{1} t^b (1-t)^{a-b}dt}\]

&lt;p&gt;Since \(a\) , \(b\) are non-negative integers, we can use the fact that&lt;/p&gt;

\[\int_{0}^{1} t^a (1-t)^{b}dt = \frac{a! b!}{(a+b+1)!}\]

&lt;p&gt;to simplify \(f(\theta)\) to&lt;/p&gt;

\[f(\theta) = \frac{\theta^b (1-\theta)^{a-b}}{\frac{a! (a-b)!}{(a+1)!}} = \frac{(a+1)! \theta^b (1-\theta)^{a-b}}{b! (a-b)!}\]

&lt;p&gt;Finally we can get the probability of success in a single sale by integrating the chances of success over the pdf:&lt;/p&gt;

\[\int_{0}^{1} \theta f(\theta) d\theta =\]

\[\int_{0}^{1} \theta\frac{(a+1)! \theta^b (1-\theta)^{a-b}}{a! (a-b)!} d\theta =\]

\[= \frac{(a+1)!}{b! (a-b)!} \int_{0}^{1}\theta^{b+1} (1-\theta)^{a-b}d\theta =\]

\[= \frac{(a+1)!}{b! (a-b)!} \times \frac{(b+1)!(a-b)!}{((a-b)+(b+1)+1)!} =\]

\[= \frac{(a+1)!}{b! (a-b)!} \times \frac{(b+1)!(a-b)!}{(a+2)!} =\]

\[= \frac{(a+1)!(b+1)!(a-b)!}{b!(a-b)!(a+2)!} =\]

\[= \frac{(a+1)!}{(a+2)!} \times \frac{(b+1)!}{b!} \times \frac{(a-b)!}{(a-b)!} =\]

\[= \frac{1}{a+2} \times (b+1) \times 1 =\]

\[= \frac{b+1}{a+2}\]

&lt;p&gt;Awesomeness, all of the above simplifies to a really neat expression. If we played \(n_i\) matches with \(r_i\) wins then the chances of winning the next match is \(\frac{r_i + 1}{n_i +2}\) . As a bonus that expression works even if \(n_i = r_i = 0\), since in that case we are assuming the pdf of \(\theta\) to be the entropy maximizing (and hence knowledge minimizing) uniform distribution, in which case there’s a \(\frac{1}{2}\) chance of winning. On second thought, that is to be expected since the pdf and integral above only require \(n_i\) and \(r_i\) not to be negative, so there’s that.&lt;/p&gt;

&lt;h2 id=&quot;yay-now-we-know-that-the-chances-of-success-by-choosing-option-i-how-does-this-help-us-in-making-long-term-choices&quot;&gt;Yay, now we know that the chances of success by choosing option \(i\). How does this help us in making long term choices?&lt;/h2&gt;

&lt;p&gt;We have found the solutions of \(C\) and \(V\) for \(k=1\), namely:&lt;/p&gt;

\[C(n,r,1) = argmax_i \{ \frac{r_i + 1}{n_i + 1} \}\]

\[V(n,r,1) = C(n,r,1)\]

&lt;p&gt;Now we need to solve this same problem for \(k&amp;gt;1\). If, for a given \(k\), we choose option \(i\) , then our expected number of wins is given by&lt;/p&gt;

\[\mathbb{P}(win) (1+V(n+e_i,r+e_i,k-1)) + \mathbb{P}(loss) V(n+e_i,r,k-1) =\]

\[= \frac{r_i + 1}{n_i + 2} (1+V(n+e_i,r+e_i,k-1)) + \frac{n_i-r_i+1}{n_i+2} V(n+e_i,r,k-1)\]

&lt;p&gt;As such we only need to find the \(argmax_i\) of the expression above to find \(C(n,r,k)\), and use that to find \(V(n,r,k)\). Hence we have found a recursive formula for this, which can be solved somewhat efficiently using &lt;a href=&quot;https://en.wikipedia.org/wiki/Dynamic_programming&quot;&gt;dynamic programming&lt;/a&gt;&lt;sup&gt;3&lt;/sup&gt; since there will be many values computed repeatedly.&lt;/p&gt;

&lt;h2 id=&quot;great-now-what&quot;&gt;Great, now what?&lt;/h2&gt;

&lt;p&gt;Well, I still need to implement this, probably in a python notebook that I’ll leave available somewhere (only then can I check how feasible it is to compute this result). If it turns out to be computationally unfeasible (due to huge \(k\)’s) then I’ll try to tackle it in a slightly different way:&lt;/p&gt;

&lt;p&gt;Instead of choosing one alternative at a time, I can choose them in a bulk of size \(b\), and then decide how many of that bulk should be used in each alternative (effectively deciding a percentage to be used in each alternative). By having large bulk sizes I could avoid having absurd recursion depths of millions of function calls just to compute this value, instead going for recursion depths of hundreds with bulk sizes of tens of thousands (we can play with this numbers after implementation).&lt;/p&gt;

&lt;p&gt;EDIT: I’ve found this &lt;a href=&quot;/assets/documents/Top%20Arm%20Identification%20in%20Multi-Armed%20Bandits%20with%20Batch%20Arm%20Pulls.pdf&quot;&gt;paper&lt;/a&gt; online about Batch Size implementations of this problem. I might write a short summary of it after having read it properly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Footnotes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; pdf : Probability Density Function and its’ &lt;a href=&quot;https://en.wikipedia.org/wiki/Probability_density_function&quot;&gt;Wikipedia page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;2&lt;/sup&gt; \(e_i\) : Unit vector along the \(i\)th dimension, i.e. \((0,0,...,0,1,0,...,0)\)&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;3&lt;/sup&gt; I never understood why they call it dynamic programming. There’s nothing dynamic about this technique.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Mythical Man Month</title>
   <link href="https://blog.mptc.uk/posts/The-Mythical-Man-Month"/>
   <updated>2017-05-15T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/The-Mythical-Man-Month</id>
   <content type="html">&lt;p&gt;It’s rare to find such a short book with so many useful insights. This insights are based on the work experience of &lt;a href=&quot;https://en.wikipedia.org/wiki/Fred_Brooks&quot;&gt;Fred Brooks&lt;/a&gt;. In summary he mentions:&lt;/p&gt;

&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#the-mythical-man-month&quot; id=&quot;markdown-toc-the-mythical-man-month&quot;&gt;The mythical man-month&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#no-silver-bullet&quot; id=&quot;markdown-toc-no-silver-bullet&quot;&gt;No silver bullet&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#the-second-system-effect&quot; id=&quot;markdown-toc-the-second-system-effect&quot;&gt;The second-system effect&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#the-tendency-towards-irreducible-number-of-errors&quot; id=&quot;markdown-toc-the-tendency-towards-irreducible-number-of-errors&quot;&gt;The tendency towards irreducible number of errors&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#progress-tracking&quot; id=&quot;markdown-toc-progress-tracking&quot;&gt;Progress Tracking&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#conceptual-integrity&quot; id=&quot;markdown-toc-conceptual-integrity&quot;&gt;Conceptual Integrity&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#formal-documents&quot; id=&quot;markdown-toc-formal-documents&quot;&gt;Formal documents&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#project-estimation&quot; id=&quot;markdown-toc-project-estimation&quot;&gt;Project estimation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#communication&quot; id=&quot;markdown-toc-communication&quot;&gt;Communication&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#specialized-tools&quot; id=&quot;markdown-toc-specialized-tools&quot;&gt;Specialized tools&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-mythical-man-month&quot;&gt;The mythical man-month&lt;/h2&gt;

&lt;p&gt;The core idea in the books states that many project managers (wrongly) use Man-Months as a developer’s productivity measurement unit, so that for example 4 developers do in 2 months what 2 developers do in 4 months.
This fails to take into account different group mechanics: 2 great developers might not work well together or a few very specialized developers might achieve no work alone, but when together produce exponentially more work. As the number of workers increases we get more communication pairs (to be exactly \(\frac{n(n-1)}{2}\) channels , so with as few as 10 developers we have 45 channels of communication ).
Also there’s another problem: most people think about the man-month unit of measurement when their projects are running late. However consider a scenario when you have 4 people, you have 2 months to finish a project but you need 12 man-months (Assuming this is a viable measurement unit). So you need to hire 2 people in order to complete the required 12 man-months. However the new developers need training in order to start working on the project. If they each need a person to introduce them and they will be learning in their first month, then we will only have 2 developers working in the first month and 6 in the second, for a total of 8 man-months. Not optimal.&lt;/p&gt;

&lt;h2 id=&quot;no-silver-bullet&quot;&gt;No silver bullet&lt;/h2&gt;

&lt;p&gt;Brooks insists that there is no technology or discovery in software that will lead to a tenfold increase in productivity over the span of a decade (this in contrast to Moore’s law about Hardware productivity).&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;h2 id=&quot;the-second-system-effect&quot;&gt;The second-system effect&lt;/h2&gt;

&lt;p&gt;This revolves around the tendency to over-engineer the second system that is built for any purpose, for the reason that we often try to include in the second system all of the first system capabilities and every addition we didn’t add in the first system due to time constraints.&lt;/p&gt;

&lt;h2 id=&quot;the-tendency-towards-irreducible-number-of-errors&quot;&gt;The tendency towards irreducible number of errors&lt;/h2&gt;

&lt;p&gt;Brooks states that as systems get complex, there is a lower bound to how many errors the system has. Any attempt at fixing known errors will introduce even more errors. As the fable goes,&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;99 little bugs in the code.
99 little bugs.
Take one down, patch it around.
127 little bugs in the code.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;progress-tracking&quot;&gt;Progress Tracking&lt;/h2&gt;

&lt;p&gt;Brooks wrote “Question: How does a large software project get to be one year late? Answer: One day at a time!” Incremental slippages on many fronts eventually accumulate to produce a large overall delay. Continued attention to meeting small individual milestones is required at each level of management.&lt;/p&gt;

&lt;h2 id=&quot;conceptual-integrity&quot;&gt;Conceptual Integrity&lt;/h2&gt;

&lt;p&gt;Any software should be made user friendly and it pays off to have an architect focusing on understanding what/how the user will be using the program. Everyone in the team should understand the architects’ (i.e. the user’s) point of view and good features might not be included if they make the program harder to learn.&lt;/p&gt;

&lt;h2 id=&quot;formal-documents&quot;&gt;Formal documents&lt;/h2&gt;

&lt;p&gt;Every project manager should create a small core set of formal documents defining the project objectives, how they are to be achieved, who is going to achieve them, when they are going to be achieved, and how much they are going to cost. These documents may also reveal inconsistencies that are otherwise hard to see.&lt;/p&gt;

&lt;h2 id=&quot;project-estimation&quot;&gt;Project estimation&lt;/h2&gt;

&lt;p&gt;Project times must take into account the fact that most customer oriented projects take thrice as long as in-house projects and that there will be time spent on administrative tasks (meetings, discussing project ideas,…). A good rule of thumb is to divide the time spent coding in 12 time blocks:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;\(4\) blocks spent designing the app and it’s structure&lt;/li&gt;
  &lt;li&gt;\(2\) blocks spent coding&lt;/li&gt;
  &lt;li&gt;\(3\) blocks spent testing each component of the app (and debugging if necessary)&lt;/li&gt;
  &lt;li&gt;\(3\) blocks spent testing the system as a whole (and, again, debugging if necessary)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;communication&quot;&gt;Communication&lt;/h2&gt;

&lt;p&gt;Everyone working on a project should be easily reachable and the project’s goal should always be made clear. Instead of assuming something, implementers should ask and clarify anything about a feature they are implementing, before proceeding with an assumption that might very well be completely incorrect. The architect(s) are responsible for formulating a group picture of the project and communicating it to others.&lt;/p&gt;

&lt;h2 id=&quot;specialized-tools&quot;&gt;Specialized tools&lt;/h2&gt;

&lt;p&gt;Instead of every programmer having his own special set of tools, each team should have a designated tool-maker who may create tools that are highly customized for the job that team is doing, e.g., a code generator tool that creates code based on a specification. In addition, system-wide tools should be built by a common tools team, overseen by the project manager.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Medium</title>
   <link href="https://blog.mptc.uk/posts/Medium"/>
   <updated>2017-04-04T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Medium</id>
   <content type="html">&lt;p&gt;I’ve recently started spending hours daily on a single website: &lt;a href=&quot;https://medium.com&quot;&gt;Medium&lt;/a&gt; . I see it as a news website where anyone can publish stories, but due to Medium’s underlying magic the post quality is awesome (Otherwise I wouldn’t have swapped The Economist, Financial Times and others for Medium). Here are some posts to get you started:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://medium.com/javascript-scene/familiarity-bias-is-holding-you-back-its-time-to-embrace-arrow-functions-3d37e1a9bb75&quot;&gt;Familiarity Bias&lt;/a&gt; - Just recently discovered this bias (and it makes total sense), Definitely worth reading.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://medium.com/@roysebag/the-natural-order-of-money-and-why-abstract-currencies-fail-aad5f9f8cf89&quot;&gt;The Natural Order of Money and Why Abstract Currencies Fail&lt;/a&gt; - I don’t agree with his conclusion, not only but mostly because he his comparing abstract currencies to Gold/physical currencies instead of Euros/Pounds/Dollars/fiat money. Still, his post was surprisingly informative.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;!--excerpt ends here--&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://medium.com/personal-growth/48-tiny-habits-that-will-make-you-awesome-d8e3959840c8&quot;&gt;48 Tiny Habits That Will Make You Awesome&lt;/a&gt; - I’m surprised at how much little changes can accomplish.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://column.st/how-bitcoin-works-efab68f17558&quot;&gt;How Bitcoin Works&lt;/a&gt; - Nothing is better than reading the original paper (which he links to in his article), but this is a softer introduction if you are not familiar with the concepts involved.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://blog.baremetrics.com/33-lessons-from-the-trenches-of-building-a-million-dollar-company-9685fa7811bb&quot;&gt;33 lessons from the trenches of building a million dollar company&lt;/a&gt; - A list of useful ‘lessons’ to consider, even though he doesn’t go in-depth about any of them.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://medium.freecodecamp.com/ivy-league-free-online-courses-a0d7ae675869&quot;&gt;Here are 250 Ivy League courses you can take online right now for free&lt;/a&gt; - Self-explanatory&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The above are all oriented to what I enjoy reading about. Medium has various topics which I did not cover. So read away, follow anyone whose articles you found interesting and subscribe to Medium to support their work.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Maths' Ceiling</title>
   <link href="https://blog.mptc.uk/posts/Maths'-Ceiling"/>
   <updated>2017-03-17T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Maths'-Ceiling</id>
   <content type="html">&lt;p&gt;This is entirely based on a &lt;a href=&quot;https://mathwithbaddrawings.com/2015/04/08/the-math-ceiling-wheres-your-cognitive-breaking-point/&quot;&gt;post&lt;/a&gt; from one of my favorite blogs: &lt;a href=&quot;https://mathwithbaddrawings.com&quot;&gt;Math With Bad Drawings&lt;/a&gt;. Read the original post if you wanna see really cool drawings. The post starts with a simple question (and the author provides a lovely answer):&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Does each person have a math ceiling?&lt;/b&gt; (or a cognitive ceiling of any kind)&lt;/p&gt;

&lt;!--excerpt ends here--&gt;

&lt;p&gt;Answers usually fall in one of 2 categories. The optimist claims that there is no such thing and everything is achievable by enough work and determination. Some might get it faster than others, but there is no limit. The pessimist claims the opposite: No matter how much one works there are things beyond some people’s comprehension (I’ve heard this mostly from teachers and tutors who taught hundreds of students, with astonishingly disparate performances). Some middle ground can be achieved (someone claiming that there’s no math ceiling as long as you find the right circumstances, including the right teacher, the right mood and motivation to work,…). Still, these are the 2 main campuses of thought.&lt;/p&gt;

&lt;p&gt;And then comes Math with Bad Drawings. They start with a beautiful analogy: Say I’ve bought a futon for my room. As I was getting it in, I saw a small metal piece come off. I’m not sure where from, and after looking around and everything seeming to be in place, I have no choice but to take it into my room as planed. All is fine. A week in and the futon starts bending down in the middle. As more time progresses the bending gets worse and worse, to the point of me not being able to sit in it anymore without sliding to the center (and everyone else sitting down too, into a awkward cluster of people).&lt;/p&gt;

&lt;p&gt;And so it is with maths.&lt;/p&gt;

&lt;p&gt;When we are learning maths we are supposed to follow the rhythm of the class. When we fail to do so we take shortcuts in order to do as everyone else, prioritizing implementation over understanding. We might be able to differentiate equations to find maxima/minima, but that’s useless unless we understand that the derivative is nothing but the slope of the curve at that point and as such the zeros of the derivative give us the maxima/minima. This is obvious to the half of the class that never took shortcuts in previous years and tried to understood everything. For the other half, they’ll feel like they’re just not capable of understanding the concepts involved, and going back to relearn the misunderstood concepts properly is a lot more work than learning them correctly the first time around. As Math With Bad Drawings said, a student who doesn’t understand a topic is a student with an expiration date on what he’ll be able to do.&lt;/p&gt;

&lt;p&gt;My final remark to this is the following: it is easier to be an A* student for the entirety of your studies than to be a B or C student for the same period. So put on the effort and climb up the ladder: never take a “You’ll understand it once you do it enough times” for an answer, first understand it and them practice implementing it.&lt;/p&gt;

&lt;p&gt;PS: I kind of feel really bad for taking the punchline “And so it is with maths” word by word from Math With Bad Drawings, but it is a brilliant punchline, I couldn’t deprive people of that. Sorry Math With Bad Drawings.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>OxfordHack</title>
   <link href="https://blog.mptc.uk/posts/Oxford-Hack"/>
   <updated>2016-11-21T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Oxford-Hack</id>
   <content type="html">&lt;p&gt;This weekend there was a 24h Hackathon which brought together people from many different countries: &lt;a href=&quot;http://www.oxfordhack.com/&quot;&gt;OxfordHack&lt;/a&gt;. It was a rather unexpected event: Saturday I went to the Maths Institute to revise, but every room was taken by people coding. Completely unaware of what was going on, I saw a welcome stall and asked them what it was all about. Turns out some companies funded this hackathon for 24h, and they had an interesting list of activities scheduled (namely Werewolves or, as I prefer to call it, Mafia).
&lt;!--excerpt ends here--&gt;
I asked them “Can I join?” and got a successful “Yes”, which was surprising given that in their website Applications were closed. As they were telling me to find a team, Manish, who was passing behind me, said he was looking for people to join his team, and so that was sorted. He already had a project in mind, and goes as follows:&lt;/p&gt;

&lt;p&gt;The Netherlands (Manish is Dutch) will be having elections next March, and the candidates will be officially announced on the 17th Dec. As expected those who want to run for president already have started their campaigns and are well known, even before their official announcement for presidency. Turns out that the current most popular candidate, Mark Rutte, is very similar to Trump. Following the belief that a significant amount of the votes come from misinformation and not genuine willingness to support Mark Rutte, Manish is invested in raising awareness of the urgent topics that need to be discussed instead of letting the election being decided by catchphrases such as “Take back control” and “Make America Great Again”. Whether this sentiment reflects the reality of the situation or not, that’s a different topic which I will not approach here. However the idea that a informed society makes wiser decisions is hard to question, and in support of that we are trying to bring hot topics to the attention of the public. As this was an hackathon, the project consisted of gamifying aspects of political debates, where knowledge of both facts and candidate’s policies are tested. Would you like to be put to the test?&lt;/p&gt;

&lt;p&gt;We have designed the structure of the website (without coding), with a few topics being open in the sense that we have contradicting ideas regarding certain aspects of the app, but nothing that would prevent us from developing a single app together. We started building it using the ionic framework, but much more needs to be done (and fast if we want to release it before the Dutch elections).&lt;/p&gt;

&lt;p&gt;Other than the project we played werewolves (a.k.a. mafia) during the night (I managed to get myself killed in both games during the first round despite being a victim) and there was one interesting challenge I watched: competitors were provided with a manual of html and css code, but no Internet access. Then we were shown Gmail’s front page and we had to recreate it in 20mins from scratch. Whoever gets the most similar front page wins. A couple of participants got my vote for doing the “404 error” page, but sadly/expectedly they didn’t win.&lt;/p&gt;

&lt;p&gt;I ended up sleeping in the Maths Institute (as many others did), and when I woke up I started working on what I went to the Maths Department for: actual academic work. That was the end of the hackathon for me, but the project still lives. Let’s see what we make of it.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Egg</title>
   <link href="https://blog.mptc.uk/posts/Egg"/>
   <updated>2016-03-10T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Egg</id>
   <content type="html">&lt;p&gt;I found this text lying around on this &lt;a href=&quot;https://www.galactanet.com/oneoff/theegg_mod.html&quot;&gt;website&lt;/a&gt;. The story told regards a man who dies and finds himself in the afterlife with a divine entity.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;You were on your way home when you died.&lt;/p&gt;

  &lt;p&gt;It was a car accident. Nothing particularly remarkable, but fatal nonetheless. You left behind a wife and two children. It was a painless death. The EMTs tried their best to save you, but to no avail. Your body was so utterly shattered you were better off, trust me.&lt;/p&gt;

  &lt;p&gt;And that’s when you met me.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;!--excerpt ends here--&gt;

&lt;blockquote&gt;
  &lt;p&gt;“&lt;em&gt;What… what happened?&lt;/em&gt;” You asked. “&lt;em&gt;Where am I?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;You died,&lt;/em&gt;” I said, matter-of-factly. No point in mincing words.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;There was a… a truck and it was skidding…&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Yup,&lt;/em&gt;” I said.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;I… I died?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Yup. But don’t feel bad about it. Everyone dies,&lt;/em&gt;” I said.&lt;/p&gt;

  &lt;p&gt;You looked around. There was nothingness. Just you and me. “&lt;em&gt;What is this place?&lt;/em&gt;” You asked. “&lt;em&gt;Is this the afterlife?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;More or less,&lt;/em&gt;” I said.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Are you god?&lt;/em&gt;” You asked.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Yup,&lt;/em&gt;” I replied. “&lt;em&gt;I’m God.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;My kids… my wife,&lt;/em&gt;” you said.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;What about them?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Will they be all right?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;That’s what I like to see,&lt;/em&gt;” I said. “&lt;em&gt;You just died and your main concern is for your family. That’s good stuff right there.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;You looked at me with fascination. To you, I didn’t look like God. I just looked like some man. Or possibly a woman. Some vague authority figure, maybe. More of a grammar school teacher than the almighty.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Don’t worry,&lt;/em&gt;” I said. “&lt;em&gt;They’ll be fine. Your kids will remember you as perfect in every way. They didn’t have time to grow contempt for you. Your wife will cry on the outside, but will be secretly relieved. To be fair, your marriage was falling apart. If it’s any consolation, she’ll feel very guilty for feeling relieved.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Oh,&lt;/em&gt;” you said. “&lt;em&gt;So what happens now? Do I go to heaven or hell or something?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Neither,&lt;/em&gt;” I said. “&lt;em&gt;You’ll be reincarnated.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Ah,&lt;/em&gt;” you said. “&lt;em&gt;So the Hindus were right,&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;All religions are right in their own way,&lt;/em&gt;” I said. “&lt;em&gt;Walk with me.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;You followed along as we strode through the void. “&lt;em&gt;Where are we going?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Nowhere in particular,&lt;/em&gt;” I said. “&lt;em&gt;It’s just nice to walk while we talk.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;So what’s the point, then?&lt;/em&gt;” You asked. “&lt;em&gt;When I get reborn, I’ll just be a blank slate, right? A baby. So all my experiences and everything I did in this life won’t matter.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Not so!&lt;/em&gt;” I said. “&lt;em&gt;You have within you all the knowledge and experiences of all your past lives. You just don’t remember them right now.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;I stopped walking and took you by the shoulders. “&lt;em&gt;Your soul is more magnificent, beautiful, and gigantic than you can possibly imagine. A human mind can only contain a tiny fraction of what you are. It’s like sticking your finger in a glass of water to see if it’s hot or cold. You put a tiny part of yourself into the vessel, and when you bring it back out, you’ve gained all the experiences it had.&lt;/em&gt;“&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;You’ve been in a human for the last 48 years, so you haven’t stretched out yet and felt the rest of your immense consciousness. If we hung out here for long enough, you’d start remembering everything. But there’s no point to doing that between each life.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;How many times have I been reincarnated, then?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Oh lots. Lots and lots. An in to lots of different lives.&lt;/em&gt;” I said. “&lt;em&gt;This time around, you’ll be a Chinese peasant girl in 540 AD.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Wait, what?&lt;/em&gt;” You stammered. “&lt;em&gt;You’re sending me back in time?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Well, I guess technically. Time, as you know it, only exists in your universe. Things are different where I come from.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Where you come from?&lt;/em&gt;” You said.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Oh sure,&lt;/em&gt;” I explained “&lt;em&gt;I come from somewhere. Somewhere else. And there are others like me. I know you’ll want to know what it’s like there, but honestly you wouldn’t understand.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Oh,&lt;/em&gt;” you said, a little let down. “&lt;em&gt;But wait. If I get reincarnated to other places in time, I could have interacted with myself at some point.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Sure. Happens all the time. And with both lives only aware of their own lifespan you don’t even know it’s happening.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;So what’s the point of it all?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Seriously?&lt;/em&gt;” I asked. “&lt;em&gt;Seriously? You’re asking me for the meaning of life? Isn’t that a little stereotypical?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Well it’s a reasonable question,&lt;/em&gt;” you persisted.&lt;/p&gt;

  &lt;p&gt;I looked you in the eye. “&lt;em&gt;The meaning of life, the reason I made this whole universe, is for you to mature.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;You mean mankind? You want us to mature?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;No, just you. I made this whole universe for you. With each new life you grow and mature and become a larger and greater intellect.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Just me? What about everyone else?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;There is no one else,&lt;/em&gt;” I said. “&lt;em&gt;In this universe, there’s just you and me.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;You stared blankly at me. “&lt;em&gt;But all the people on earth…&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;All you. Different incarnations of you.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Wait. I’m everyone!?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Now you’re getting it,&lt;/em&gt;” I said, with a congratulatory slap on the back.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;I’m every human being who ever lived?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Or who will ever live, yes.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;I’m Abraham Lincoln?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;And you’re John Wilkes Booth, too,&lt;/em&gt;” I added.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;I’m Hitler?&lt;/em&gt;” You said, appalled.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;And you’re the millions he killed.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;I’m Jesus?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;And you’re everyone who followed him.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;You fell silent.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Every time you victimized someone,&lt;/em&gt;” I said, “&lt;em&gt;you were victimizing yourself. Every act of kindness you’ve done, you’ve done to yourself. Every happy and sad moment ever experienced by any human was, or will be, experienced by you.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;You thought for a long time.&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Why?&lt;/em&gt;” You asked me. “&lt;em&gt;Why do all this?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Because someday, you will become like me. Because that’s what you are. You’re one of my kind. You’re my child.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;Whoa,&lt;/em&gt;” you said, incredulous. “&lt;em&gt;You mean I’m a god?&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;No. Not yet. You’re a fetus. You’re still growing. Once you’ve lived every human life throughout all time, you will have grown enough to be born.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;So the whole universe,&lt;/em&gt;” you said, “&lt;em&gt;it’s just…&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;“&lt;em&gt;An egg.&lt;/em&gt;” I answered. “&lt;em&gt;Now it’s time for you to move on to your next life.&lt;/em&gt;”&lt;/p&gt;

  &lt;p&gt;And I sent you on your way.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>G-Research Competition</title>
   <link href="https://blog.mptc.uk/posts/GResearch"/>
   <updated>2015-10-24T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/GResearch</id>
   <content type="html">&lt;p&gt;Today Me, Matt and Aiken went for a high-frequency stock exchange competition. It was sponsored by G-Research ( It’s a fairly efficient way of hiring the best employees).
Unfortunately, we didn’t win (we won last year. Yay), but had we had more time we maybe would have.
&lt;!--excerpt ends here--&gt;
To give some context, the stock exchange market is a place where you have instruments (company shares) and their respective market price. The price is not an absolute thing but defined by the average value at which the shares are being exchanged (and somewhat related to how the company is doing in real-life, but during the competition we didn’t consider that). There was a central mechanism which kept a record of all the transactions and offers in the market, and each participant ( a company in real life) could propose to buy/sell instruments. Whenever there is a match (I sell at a lower price than you buy, or vice-versa), the transaction occurs at the price the first of us set. We also had a ‘Black Box’ which gave us relatively accurate predictions of future prices for the instruments. By the end, the participant who makes the most money wins. The entire code was done in C# (They, G-Research, scripted the structure of the program, and then we had to complete the rest with our own idea).&lt;/p&gt;

&lt;p&gt;We started with a very simple idea: We take (A) the average of the last transactions, compare it to (B) our black box prediction and decide to buy if A &amp;lt; B or sell if B &amp;gt; A. This was to make sure everything was operational, and then we tried to make a quadratic approximation of the values of the past few seconds in order to predict in a long-ish term how the stock values will change, and then decide to buy/sell using that value (and completely bypass the black box given to us). Unfortunately when we implemented it we didn’t manage to make it run our algorithm in the given time, so we had to run the simpler idea (The maths for the quadratic approximation had all been worked out, though).&lt;/p&gt;

&lt;p&gt;During the live test, all teams seemed to have a similar behavior (they all improved at the same time, had the same spikes and, in general, showed the same trends). Even though some correlation is expected (because increasing the value of the instruments increases the amount of money everyone has), usually there are differences in behaviors which we didn’t see, so I believe everyone used the same algorithm, which makes it kind of boring.&lt;/p&gt;

&lt;p&gt;Still, I wonder how it would be if such a system was set up online where people had all the time in the world to implement their algorithm of choice (Which happens to be the actual real money high-frequency stock exchange market). No doubt that is a lot more fun than this mini version we did. I might pitch in on this some day.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Oxford University Elliptic Curves Research Project</title>
   <link href="https://blog.mptc.uk/posts/Elliptic-Curves"/>
   <updated>2015-09-18T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Elliptic-Curves</id>
   <content type="html">&lt;h3 id=&quot;computing-the-average-rank-of-elliptic-curves-in-ordered-families&quot;&gt;Computing the average rank of elliptic curves in ordered families&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Supervisor: Dr Jennifer Balakrishnan&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An elliptic curve \(E\) is the set of points \((x, y)\) satisfying an equation of the form \(y^2 = x^3 + ax + b\), together with a special point “at infinity”. When the coefficients \(a\), \(b\) are rational numbers, it is of interest to study the set of all rational points \((x, y)\) satisfying the equation. It turns out that the rational points on \(E\) form a finitely generated abelian group, and an important invariant attached to \(E\) is the rank of this group.
&lt;!--excerpt ends here--&gt;
During the project we explored the “average” rank of various elliptic curves in certain families by using Sage to build a database of millions of elliptic curves, then computing various important number theoretic invariants attached to these curves.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Farfetch Internship</title>
   <link href="https://blog.mptc.uk/posts/Farfetch"/>
   <updated>2014-07-23T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Farfetch</id>
   <content type="html">&lt;h3 id=&quot;applying-machine-learning-to-fraud-detection&quot;&gt;Applying Machine Learning to Fraud Detection&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Supervisor: Cristina Cerqueira&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I first joined &lt;a href=&quot;https://www.farfetch.com&quot;&gt;Farfetch&lt;/a&gt; I was told they were looking for someone to implement Machine Learning algorithms to help predict possible fraud attempts. These fraud attempts can consist of something as simple as using someone else’s credit card to make purchases to more convoluted methods which I might not be aware of.
&lt;!--excerpt ends here--&gt;
I was unaware (that is, until my first day there) that I was going to be the only one (at the time) working on it. Hence I dived into learning more about SQL and the &lt;a href=&quot;http://pandas.pydata.org/&quot;&gt;Pandas&lt;/a&gt; module in Python (both of which I was working with for the first time) and into Machine Learning algorithms. I used &lt;a href=&quot;https://studio.azureml.net/&quot;&gt;Microsoft’s Azure Machine Learning Studio&lt;/a&gt; for a quick testing of different Machine Learning algorithms, and I repeated the same in R to double-check the accuracy of different algorithms. Both agreed that Random Forests was the most efficient method.&lt;/p&gt;

&lt;p&gt;Having decided on Random Forests for the initial implementation in Python. During the next three weeks came the manual labor: building the queries to retrieve all the needed that in an efficient manner (where information was not only across different tables but also different databases, which slowed down the process) to transforming the raw information into more relevant data using tips from field experts at Farfetch, to checking that datatypes match,… and finally running the Machine Learning algorithm on the transformed data. After all this the python/sql scripts worked as expected. I quickly tried the same scripts with different algorithms to check (again) for efficiency, but similarly to the initial tests Random Forests performed best.&lt;/p&gt;

&lt;p&gt;All of the above was done on static data. I still had to make it so that the algorithm could run live. The speed of the script wasn’t an issue, but I had yet to understand the way Farfetch pipelines so that I could integrate my work. Unfortunately my internship was coming to an end (and I had to go back to my studies in October). Hence I spent my 2nd last week organizing my code (It was a mess when I started, but by the end it was incredibly neat), and writing plans/suggestions/documentation for what exists/could be improved/needs to get done. In the last week a new intern, Nuno Monteiro, came along to continue this project (which by then got the informal nickname of project Sherlock). During that week my work was to put him up to date on the work that was done.&lt;/p&gt;

&lt;p&gt;Nuno was doing his Master thesis at Farfetch, specifically about implementing Machine Learning in industry (titled &lt;em&gt;A data mining based system for credit-card fraud detection in e-tail&lt;/em&gt;) , so he wrote his thesis alongside this internship (and I got to co-author the paper given my initial role in Project Sherlock).&lt;/p&gt;

&lt;p&gt;Looking back I reckon I would’ve been more productive if I practiced more SQL/Python and less time on understanding the theory behind the Machine Learning algorithms used, but they were so interesting (As much as I like coding, there will always be a mathematician in me curious about how things work, and not just in making them work).&lt;/p&gt;

&lt;p&gt;I’d also like to thank João Sousa (Pandas expert) and Carlos Gomes (SQL expert) for all the technical support they’ve given me during the internship, and everyone else who was there during breaks and lunch and gym sessions and dinners out. Couldn’t have had a better internship.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Delfos Project & Math Olympiads</title>
   <link href="https://blog.mptc.uk/posts/Delfos"/>
   <updated>2013-09-29T00:00:00+00:00</updated>
   <id>https://blog.mptc.uk/posts/Delfos</id>
   <content type="html">&lt;p&gt;This was my last Olympiad. I first heard about &lt;a href=&quot;http://www.uc.pt/fctuc/dmat/delfos&quot;&gt;Delfos&lt;/a&gt; when I was 14. I got to a Maths National Olympiad final and was told about this Maths Weekend school. Boring, I thought, so I didn’t join. 2 years later I happened to meet someone who went to Delfos and convinced me to try it (Thank you Catarina!). So I went. Expectations were low, but it was worth the shot (I already did maths in my spare time, but the idea of spending my weekends sitting in a classroom didn’t seem too appealing. I believe most of you will relate). How wrong was I.
&lt;!--excerpt ends here--&gt;
There were a few teachers who guided us a great deal (a special thanks to professor Kovacec who always went the extra mile for all of us), but the mutual learning was what amazed me. Yes, there were lectures, but we could just sit in the back doing something else or walk outside if, for any reason, we weren’t feeling productive (or if we just didn’t feel like it). But there I was, surrounded by people who were motivated to learn maths out of their own will, for fun. People who enjoyed the tricks and details observed in proving tricky problems, and were there for the challenge and the beauty of these proofs. We challenged each other with increasingly harder problems, and we improved ourselves.&lt;/p&gt;

&lt;p&gt;This is the environment that I was lucky to have found. Together, we solved problems and became friends. Summers ran by as we spent weeks at a time in each others’ houses, swimming in the ocean, playing Playstation, camping in Gerês, playing Mafia till 3pm and solving &lt;a href=&quot;http://www.imo-official.org/&quot;&gt;IMO&lt;/a&gt;’s. We grew together. It’s funny how I thought Delfos would be this dull place where people stare at books and learn how to mechanically solve problems.&lt;/p&gt;

&lt;p&gt;As wrong as I was, we did solve problems and even went abroad for some Math Olympiads. My first one abroad was in Brazil. Foolish me thought:  &lt;em&gt;Brasil is warm,I can just use flip-flops all the time&lt;/em&gt;. Wrong. I should have taken trainers. I hadn’t been there for a day but decided to play tennis (there were tennis courts nearby). Shoeless. Under the scorching sun. I got blisters. I couldn’t stand on my own two feet. For the rest of the week I had to use canadians. I will never make that mistake again, but at least I got to enjoy Salvador da Baia. The streets are surprisingly similar to Porto’s, due to our “&lt;a href=&quot;https://en.wikipedia.org/wiki/Portuguese_pavement&quot;&gt;calçada&lt;/a&gt;”, even more so than many Portuguese towns.&lt;/p&gt;

&lt;p&gt;It so happened that my birthday was during that Olympiad. They got me a surprise cake and Pedro, from Angola, was put in charge of getting me to the cake. I was playing Catan at the time with my Portuguese friends (who were unaware of the surprise), so we finished the game. It only took an hour of 20ish people waiting. After finishing the game Pedro tried to convinced me to go to the swimming pool (the cake and the people were next to it), but it was dinner time and I was hungry, so I went for dinner with the rest of the Portuguese. Another hour went by and everyone was still waiting. Finally we went to the pool and there they were. I was really surprised (If I had any suspicion of such they wouldn’t have waited for 2 hours). The guide from Timor Leste convinced me to follow his tradition of breaking 17 raw eggs on my head (as I was turning 17), and after a quick rinse in the shower we all went to the pool. I will not forget this birthday.&lt;/p&gt;

&lt;p&gt;I had my next Olympiad in Mozambique, but since I’ve been there before (to visit my brother, who worked in Maputo at the time), there wasn’t the novelty factor in it anymore. The last trip abroad was in Panama, in the ciudad de Panamá. During this trip we were escorted at all times by guides, and you can’t imagine how disappointed I was at crossing Panama’s Canal while not having had the chance to swim in neither of the Oceans bordering it (I managed to do so in both Brasil and Mozambique). It was an awesome week with Miguel (me), Miguel (Santos), Miguel (Moreira) and Luís (Duarte). However the ending was stressful for my parents. How so? Well, the flight took some 14 hours (with a schedule somewhere in Europe, I actually forgot where. It doesn’t matter, we never left the airport, so let’s say it was Frankfurt). We departed from Panama early in the morning and arrived in Portugal (Lisbon) at 9pm ish, after wich I had a 3h train trip to Porto. As such I emailed my parents the day before telling them I would arrive in Campanhã’s train station by midnight ish. I did not specify the day (which I assumed my parents knew). They assumed I would arrive on the day I sent the email. When they got to the train station I wasn’t there. They waited and waited. They went to the cops, who promptly told them there is a 24h mandatory wait period before initiating searches. My parents called my friends trying to figure out if they knew were I was. All the while I was sleeping. I woke up in the morning, didn’t check any form of communication cause I had no reason to, and I went to the airport. I got in, I started the flight. My parents still had no idea where I was, but by then they were hoping that I would arrive the next day. Something about the idea of me getting kidnapped in Panama wasn’t pleasant to them, so they hoped. I finally arrived at Frankfurt, with a call from Bea (a high-school friend of mine). She told me to call my parents since they were worried sick because of me. I did so, and my father was surprisingly calm as I spoke (probably relieved after all this). I boarded the last leg of my flight, had the 3h trip with another friend of mine from Porto and finally arrived home. Everything ended well. Except for my parent’s heart. That couldn’t have done them any good.&lt;/p&gt;

&lt;p&gt;As a final note, I leave the list of all Olympiads I was lucky enough to have gone to, all in Mathematics unless otherwise stated. Happy times.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Date and Place&lt;/th&gt;
      &lt;th&gt;Olympiad&lt;/th&gt;
      &lt;th&gt;Medal&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;September 2013, Panama&lt;/td&gt;
      &lt;td&gt;Ibero-American&lt;sup&gt;1&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;Bronze&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;August 2013, Mozambique&lt;/td&gt;
      &lt;td&gt;OMCPLP&lt;sup&gt;2&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;Gold&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;March 2013, Portugal&lt;/td&gt;
      &lt;td&gt;National&lt;/td&gt;
      &lt;td&gt;Silver&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;November 2012, Portugal&lt;/td&gt;
      &lt;td&gt;Paulista&lt;sup&gt;3&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;Silver&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;July 2012, Brasil&lt;/td&gt;
      &lt;td&gt;OMCPLP&lt;sup&gt;2&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;Silver&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;March 2012, Portugal&lt;/td&gt;
      &lt;td&gt;National&lt;/td&gt;
      &lt;td&gt;Gold&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;November 2010, Portugal&lt;/td&gt;
      &lt;td&gt;Paulista&lt;sup&gt;3&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;Bronze&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;May 2009, Portugal&lt;/td&gt;
      &lt;td&gt;National (Chemistry)&lt;/td&gt;
      &lt;td&gt;Silver&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;March 2009, Portugal&lt;/td&gt;
      &lt;td&gt;Regional (Chemistry)&lt;/td&gt;
      &lt;td&gt;Gold&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;sub&gt;&lt;sup&gt;1&lt;/sup&gt; Participants: Argentina, Bolivia, Brazil, Chile, Colombia, Costa Rica, Cuba, Ecuador, El Salvador, España, Guatemala, Honduras, México, Nicaragua, Panamá, Paraguay, Perú, Portugal, Puerto Rico, Uruguay y Venezuela.&lt;/sub&gt;&lt;/p&gt;

&lt;p&gt;&lt;sub&gt;&lt;sup&gt;2&lt;/sup&gt; Portuguese Speaking Countries´ Math Olympiad.&lt;/sub&gt;&lt;/p&gt;

&lt;p&gt;&lt;sub&gt;&lt;sup&gt;3&lt;/sup&gt; Portugal/Brazil joint Math Olympiad.&lt;/sub&gt;&lt;/p&gt;
</content>
 </entry>
 

</feed>
