<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="https://jesungpark.com">
  <title>Jesung Park - Writing &amp; Projects</title>
  <subtitle>Essays and projects from Jesung Park — one combined stream.</subtitle>
  <link href="https://jesungpark.com/feed-work.xml" rel="self"/>
  <link href="https://jesungpark.com/work/"/>
  <updated>2025-12-01T00:00:00Z</updated>
  <id>https://jesungpark.com/work/</id>
  <author>
    <name>Jesung Park</name>
  </author>
  <entry>
    <title>Wireless Race Car</title>
    <link href="https://jesungpark.com/projects/wireless-race-car/"/>
    <updated>2025-12-01T00:00:00Z</updated>
    <id>https://jesungpark.com/projects/wireless-race-car/</id>
    <category term="project"/>
    <content xml:lang="en" type="html">&lt;h3 id=&quot;getting-involved&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor-link&quot; href=&quot;https://jesungpark.com/projects/wireless-race-car/#getting-involved&quot;&gt;Getting Involved&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;One of the things I regret about my university days is spending too much time playing video games and not getting involved in enough student societies. So when I started my masters program last year, I did things a bit differently. Given my interest in racing, the &lt;a href=&quot;https://www.instagram.com/bristolracing/?hl=en&quot;&gt;Bristol Racing&lt;/a&gt; society was my top choice. There, I joined the electronics team to help primarily with the brain of the car -- a battle-worn but functional Arduino.&lt;/p&gt;
&lt;p&gt;The team participated in the electric &lt;a href=&quot;https://www.greenpower.co.uk/&quot;&gt;Greenpower Formula 24&lt;/a&gt; class. These are single-motored, car battery-powered cars with custom chassis. It&#39;s a bit different when the cars aren&#39;t screaming with engine and turbo noise but racing is still racing. There&#39;s something special in the air that makes my heart race.&lt;/p&gt;
&lt;h3 id=&quot;how-it-works&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor-link&quot; href=&quot;https://jesungpark.com/projects/wireless-race-car/#how-it-works&quot;&gt;How It Works&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The vehicle was powered by an Arduino Mega which controlled the motor and tracked sensor data. As such, we used an Arduino UNO as a receiver and used a LoRa RFM95 module. It was a bit finnicky to get everything working but the pressure of an upcoming race was enough motivation. Later, we found that this was much easier to implement on a ESP32 when preparing for the next iteration of the race car.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/LoRa_ESP32_Wiring.png&quot; alt=&quot;LoRa wiring diagram&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Image courtesy of &lt;a href=&quot;https://randomnerdtutorials.com/esp32-lora-rfm95-transceiver-arduino-ide/&quot;&gt;https://randomnerdtutorials.com/esp32-lora-rfm95-transceiver-arduino-ide/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h4 id=&quot;lora-receiver-code&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor-link&quot; href=&quot;https://jesungpark.com/projects/wireless-race-car/#lora-receiver-code&quot;&gt;LoRa Receiver Code&lt;/a&gt;&lt;/h4&gt;
&lt;pre class=&quot;language-cpp&quot;&gt;&lt;code class=&quot;language-cpp&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Arduino9x_RX&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// -*- mode: C++ -*-&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// Example sketch showing how to create a simple messaging client (receiver)&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// with the RH_RF95 class. RH_RF95 class does not provide for addressing or&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// reliability, so you should only use RH_RF95 if you do not need the higher&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// level messaging abilities.&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// It is designed to work with the other example Arduino9x_TX&lt;/span&gt;

&lt;span class=&quot;token macro property&quot;&gt;&lt;span class=&quot;token directive-hash&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;token directive keyword&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;lt;SPI.h&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token macro property&quot;&gt;&lt;span class=&quot;token directive-hash&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;token directive keyword&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;lt;RH_RF95.h&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token macro property&quot;&gt;&lt;span class=&quot;token directive-hash&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;token directive keyword&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;token macro-name&quot;&gt;RFM95_CS&lt;/span&gt; &lt;span class=&quot;token expression&quot;&gt;&lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token macro property&quot;&gt;&lt;span class=&quot;token directive-hash&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;token directive keyword&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;token macro-name&quot;&gt;RFM95_RST&lt;/span&gt; &lt;span class=&quot;token expression&quot;&gt;&lt;span class=&quot;token number&quot;&gt;9&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token macro property&quot;&gt;&lt;span class=&quot;token directive-hash&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;token directive keyword&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;token macro-name&quot;&gt;RFM95_INT&lt;/span&gt; &lt;span class=&quot;token expression&quot;&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// Change to 434.0 or other frequency, must match RX&#39;s freq!&lt;/span&gt;
&lt;span class=&quot;token macro property&quot;&gt;&lt;span class=&quot;token directive-hash&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;token directive keyword&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;token macro-name&quot;&gt;RF95_FREQ&lt;/span&gt; &lt;span class=&quot;token expression&quot;&gt;&lt;span class=&quot;token number&quot;&gt;434.0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// Singleton instance of the radio driver&lt;/span&gt;
RH_RF95 &lt;span class=&quot;token function&quot;&gt;rf95&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;RFM95_CS&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; RFM95_INT&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// Blinky on receipt&lt;/span&gt;
&lt;span class=&quot;token macro property&quot;&gt;&lt;span class=&quot;token directive-hash&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;token directive keyword&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;token macro-name&quot;&gt;LED&lt;/span&gt; &lt;span class=&quot;token expression&quot;&gt;&lt;span class=&quot;token number&quot;&gt;13&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;setup&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;pinMode&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LED&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; OUTPUT&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;     
  &lt;span class=&quot;token function&quot;&gt;pinMode&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;RFM95_RST&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; OUTPUT&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;digitalWrite&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;RFM95_RST&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; HIGH&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;token keyword&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;Serial&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;begin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;9600&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

  Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Arduino LoRa RX Test!&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;token comment&quot;&gt;// manual reset&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;digitalWrite&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;RFM95_RST&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; LOW&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;digitalWrite&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;RFM95_RST&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; HIGH&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token function&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;token keyword&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;rf95&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;init&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;LoRa radio init failed&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
  Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;LoRa radio init OK!&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;token comment&quot;&gt;// Defaults after init are 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;rf95&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;setFrequency&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;RF95_FREQ&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;setFrequency failed&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
  Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Set Freq to: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;RF95_FREQ&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;token comment&quot;&gt;// Defaults after init are 434.0MHz, 13dBm, Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on&lt;/span&gt;

  &lt;span class=&quot;token comment&quot;&gt;// The default transmitter power is 13dBm, using PA_BOOST.&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;// If you are using RFM95/96/97/98 modules which uses the PA_BOOST transmitter pin, then &lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;// you can set transmitter powers from 5 to 23 dBm:&lt;/span&gt;
  rf95&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;setTxPower&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;23&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;loop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;rf95&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;available&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// Should be a message for us now   &lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;uint8_t&lt;/span&gt; buf&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;RH_RF95_MAX_MESSAGE_LEN&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;uint8_t&lt;/span&gt; len &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;buf&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;rf95&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;recv&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;buf&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;len&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;token function&quot;&gt;digitalWrite&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LED&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; HIGH&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;token class-name&quot;&gt;RH_RF95&lt;/span&gt;&lt;span class=&quot;token double-colon punctuation&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;printBuffer&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Received: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; buf&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; len&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Got: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;buf&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
       Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;RSSI: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;rf95&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;lastRssi&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; DEC&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      
      &lt;span class=&quot;token comment&quot;&gt;// Send a reply&lt;/span&gt;
      &lt;span class=&quot;token keyword&quot;&gt;uint8_t&lt;/span&gt; data&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;And hello back to you&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      rf95&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      rf95&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;waitPacketSent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Sent a reply&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;token function&quot;&gt;digitalWrite&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;LED&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; LOW&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
      Serial&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Receive failed&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;lora-sender-code&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor-link&quot; href=&quot;https://jesungpark.com/projects/wireless-race-car/#lora-sender-code&quot;&gt;LoRa Sender Code&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;The sender code is integrated with our main codebase. It combines the various sensor outputs into a comma-delimited string and broadcasts the string via LoRa. It tracked metrics like temperature, voltage, and current. The GitHub commit can be found &lt;a href=&quot;https://github.com/Bristol-Racing/Car-2023-2024/commit/48278b736783f937e154cc4fdfd6beba1605ddc2&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;field-testing&quot; tabindex=&quot;-1&quot;&gt;&lt;a class=&quot;header-anchor-link&quot; href=&quot;https://jesungpark.com/projects/wireless-race-car/#field-testing&quot;&gt;Field Testing&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;After trialing the kit at the lab, we eagerly brought out the prototype to the famed Goodwood Motor Circuit. As cars rolled up to the start/finish line, messages from our race car started trickling in. Once the cars got going, we quickly found that the signal dropped once the car was not in direct line of sight. However, we still got a few pings as the car passed pit lane. This was enough for peace of mind.&lt;/p&gt;
&lt;p&gt;At some point, we started getting incredibly good signal from the race car and were wondering what happened. Turned out the chain fell off and the driver had to pull over at the end of pit exit. Oops. We ended the day with a DNF but at least the electronics held up the whole time!&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Self-Driving Race Car vs. Human Driver</title>
    <link href="https://jesungpark.com/projects/sdrc2/"/>
    <updated>2022-01-10T00:00:00Z</updated>
    <id>https://jesungpark.com/projects/sdrc2/</id>
    <category term="project"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- intro --&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
              &lt;p&gt;
                  In the post about my &lt;a href=&quot;https://jesungpark.com/projects/sdrc1/&quot;&gt;self-driving race car project&lt;/a&gt;, I wrote that it was a few tenths faster than the game&#39;s default AI on the highest setting. But how does it compare to a mediocre human driver? Find out below! The dashboard may take a few seconds to load initially.
              &lt;/p&gt;
              &lt;a href=&quot;https://infinity21.pythonanywhere.com/sdrc&quot; target=&quot;_blank&quot;&gt;Open in a new window&lt;/a&gt;
              &lt;iframe style=&quot;background: #FFFFFF;&quot; src=&quot;https://infinity21.pythonanywhere.com/sdrc&quot; width=&quot;100%&quot; height=&quot;2800&quot;&gt;&lt;/iframe&gt;
          &lt;/div&gt;</content>
  </entry>
  <entry>
    <title>Self-Driving Race Car with Path Optimization</title>
    <link href="https://jesungpark.com/projects/sdrc1/"/>
    <updated>2022-01-09T00:00:00Z</updated>
    <id>https://jesungpark.com/projects/sdrc1/</id>
    <category term="project"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- intro --&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
              &lt;p&gt;
                I built a path-optimization and control system for a simulated race car in Assetto Corsa, using traditional optimization methods before moving toward learning-based approaches. The system generates a target trajectory, computes a velocity profile, and controls the vehicle through a virtual gamepad interface — driving a full lap autonomously and benchmarked against the game&#39;s built-in AI.
              &lt;/p&gt;
              &lt;p&gt;
                I chose Assetto Corsa over CARLA — the simulator from the Coursera &lt;a href=&quot;https://www.coursera.org/specializations/self-driving-cars&quot; target=&quot;_blank&quot;&gt;Self-Driving Car specialization&lt;/a&gt; that motivated the project — specifically for its physics fidelity. CARLA&#39;s tire model behaved unrealistically at the limit of grip, which is exactly where racing performance is decided. Assetto Corsa&#39;s mature physics engine and active modding community made it the better testbed.
              &lt;/p&gt;
              &lt;p&gt;
                The goal was a working end-to-end pipeline built on a &quot;traditional&quot; optimization approach, deliberately scoped to leave room for later learning-based methods such as deep learning or reinforcement learning. Below, I walk through the key ideas and implementation details that make the program drive successfully on the simulator. If you are not interested in the technical stuff but want to try out the program, feel free to jump to the last section.
              &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
          &lt;!-- mathematical optimization --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Mathematical Optimization&lt;/h4&gt;
          &lt;/div&gt;
            &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
              &lt;p&gt;
                The goal of path optimization is to minimize (or maximize) an objective function, which is similar to cost functions in supervised machine learning. The difference is that we don&#39;t know the most optimal path so there are no actual values to compare against&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/projects/sdrc1/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. The most common approaches are to minimize the lap time directly and to minimize the curvature. However, we cannot compute the entire lap time or curvature in one go.
              &lt;/p&gt;
              &lt;p&gt;
                The traditional approach to path optimization divides a track into many discrete segments where each segment will have a value alpha between 0 and 1. Having a value 0 means the car is on the left-most part of the track and 1 represents the right-most part. This set of alpha values would then define the overall reference path. Typically, the initial guess for the reference path is 0.5. Now we can go ahead and compute the lap time or curvature.
              &lt;/p&gt;
              &lt;p&gt;
                Lap time can be calculated by dividing the length of each segment with the target velocity then summing up the results. The velocity profile computation is detailed in the next section. This approach is the most accurate (since minimizing lap time is the ultimate goal) but is computationally expensive. To address the speed issue, researchers have turned to minimizing curvature.
              &lt;/p&gt;
              &lt;p&gt;
                Curvature, typically denoted &#92;( &#92;kappa &#92;), is the inverse of the instantaneous radius of a curve &#92;( &#92;kappa = 1 / r &#92;). So minimizing the curvature is equivalent to maximizing the turning radius. Similar to lap time calculation, the objective function is the sum of curvatures at each segment. Minimizing curvature has been shown to yield similar lap times but is much faster to compute&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/projects/sdrc1/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;. However, it&#39;s not enough to know what path to follow. You also need to know how fast you should be following it.
              &lt;/p&gt;
            &lt;/div&gt;
          &lt;div class=&quot;w3-container w3-margin-bottom&quot;&gt;
            &lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/optimized.png&quot; alt=&quot;&quot; style=&quot;width:75%&quot; /&gt;
			&lt;br /&gt;&lt;small&gt;
				An optimized trajectory for the Red Bull Ring National track.
			&lt;/small&gt;
          &lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
          &lt;!-- Velocity Profile --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Velocity Profile&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
              &lt;p&gt;
                The velocity profile computation is divided into four steps. First, the maximum velocity is calculated for each segment. Second, you do a backward pass through the maximum velocities and compute the maximum deceleration. Third, you do a forward pass to compute the maximum acceleration while accounting for the maximum acceleration of the car at a given velocity. Lastly, to compute the final velocity profile, you take the minimum of the previous three steps.
              &lt;/p&gt;
              &lt;p&gt;
                Maximum velocity is a function of radius and maximum lateral acceleration &#92;( v_{max}^{2} = a_{lat_{max}} &#92;cdot r &#92;). With a bigger turning radius, you can carry more speed through the turn. However, the formula doesn&#39;t quite hold up when the track is not completely flat.
              &lt;/p&gt;
              &lt;p&gt;
                If you think about Nascar racing on oval tracks, the track surface is banked (where the side of the road that you are turning into is lower than the opposite side) which increases the maximum speed that can be carried through the turns. This is why many on/off ramps on highways will often have a slight banking.
              &lt;/p&gt;
              &lt;p&gt;
                Similarly, if the track is going uphill or downhill, then the car, impacted by gravity, would be rolling up/down the hill. This is an additional term in the car&#39;s acceleration. I take both of these factors into account in my calculations but would be happy to chat about it if anyone is interested!
              &lt;/p&gt;
              &lt;p&gt;
                For the deceleration step, you start with a local minimum velocity and work backwards to calculate the highest speed you can slow down from. This is defined by &#92;( v_{final} = &#92;sqrt{2 &#92;cdot a_{long} &#92;cdot s + v_{init}^{2}} &#92;) where &#92;( s &#92;) is the distance traveled and &#92;(a_{long} = &#92;sqrt{(&#92;mu &#92;cdot g)^2 - a_{lat}^{2}} &#92;) with &#92;( &#92;mu &#92;) the coefficient of friction of the tires and &#92;( g &#92;) the gravitational coefficient. In practice, a car is not able to maintain its maximum grip &#92;( &#92;mu &#92;) due to load transfer which I briefly discuss in step 4 of &lt;a href=&quot;https://jesungpark.com/blog/six-steps-for-fast-lap-times/&quot; target=&quot;_blank&quot;&gt;this post&lt;/a&gt;. Therefore, some form of damping is required to account for the reduced grip. My code contains a rudimentary form of it which seems to work for the test track.
              &lt;/p&gt;
              &lt;p&gt;
                Acceleration follows similar steps to the deceleration step except you need to account for the force that the car can apply to its driven wheel. Even for race cars, this will not always be higher than the available grip. The formula for wheel force at a given velocity is defined by &#92;[ F_{w} = &#92;frac{ &#92;tau &#92;cdot e &#92;cdot g_{i} * g_{f}} {r} &#92;] where &#92;( &#92;tau &#92;) is the engine torque in &#92;(N &#92;cdot m &#92;) &lt;br /&gt; &#92;( e &#92;) is the drivetrain efficiency &lt;br /&gt; &#92;( g_{i} &#92;) is the gear ratio for gear &#92;( i &#92;) &lt;br /&gt; &#92;( g_{f} &#92;) is the final drive ratio &lt;br /&gt; &#92;( r &#92;) is the wheel radius in meters.
			  &lt;/p&gt;
			  &lt;p&gt;One thing I left out here was whether the car is front-wheel drive, rear-wheel drive, or all-wheel drive. Depending on the amount of vertical load on the driven wheels, the car&#39;s overall coefficient of friction will be impacted. So the wheel force equation always overestimates the acceleration but not in a catastrophically detrimental way.
              &lt;/p&gt;
              &lt;p&gt;
                Clearly, there is much room for improvement in my implementation of the velocity profile calculation.It does not account for the load transfer during acceleration which limits the overall grip. In addition, it does not take into account aerodynamic forces that can play a major role in certain vehicles. However, it was good enough to get things working and as a solo developer, I had to manage my scope ruthlessly.
              &lt;/p&gt;
          &lt;/div&gt;
		  &lt;!-- Controller --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Controller&lt;/h4&gt;
          &lt;/div&gt;
		  &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
              &lt;p&gt;
                The algorithm used for the controller is largely from the &lt;a href=&quot;https://jesungpark.com/projects/av1/&quot; target=&quot;_blank&quot;&gt;first course&lt;/a&gt; of Coursera&#39;s self-driving car specialization. There were some tweaks made such as zeroing out the integral portion of the PID controller as I could not accurately model the velocity profile and the game will share the car&#39;s exact velocity so there is no error that needs to be accounted for. The underlying algorithm largely remains unchanged.
              &lt;/p&gt;
              &lt;p&gt;
                To actually control the car in-game, I used the &lt;a href=&quot;https://pypi.org/project/vgamepad/&quot; target=&quot;_blank&quot;&gt;vgamepad package&lt;/a&gt; which is a virtual controller that runs on Python. Once the target throttle, brake, and steering values are calculated, the controller is updated with the target values. One thing to note is that I had to adjust control settings such as steering speed and steering gamma within Assetto Corsa to ensure that the controller inputs translated as close as possible to 1:1 in the game.
              &lt;/p&gt;
          &lt;/div&gt;
		  &lt;!-- Results --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Results&lt;/h4&gt;
          &lt;/div&gt;
		  &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
              &lt;p&gt;
                How does this agent perform? A lap around the Red Bull Ring National track took around 1:06.8 with the agent. In comparison, the game&#39;s default AI on 100% strength ran a best lap around 1:07.1. An elite human driver can likely go 1-2 seconds faster but I&#39;m satisfied with the results.
              &lt;/p&gt;
              &lt;p&gt;
                Do you think you can beat my time? Download my code on GitHub and let me know how you get on!
              &lt;/p&gt;
          &lt;/div&gt;
		  &lt;div class=&quot;video-container w3-container w3-margin-bottom&quot;&gt;
            &lt;!----&gt;
            &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/WAfiw3wnLTw&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
          &lt;/div&gt;
		  &lt;!-- How to get started --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;How to get started&lt;/h4&gt;
          &lt;/div&gt;
		  &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
              &lt;p&gt;
                &lt;/p&gt;&lt;ul&gt;
					&lt;li&gt;Install Assetto Corsa (&lt;a href=&quot;https://store.steampowered.com/app/244210/Assetto_Corsa/&quot; target=&quot;_blank&quot;&gt;steam&lt;/a&gt;)&lt;/li&gt;
					&lt;li&gt;Download &lt;a href=&quot;https://github.com/jesung/aidriver&quot; target=&quot;_blank&quot;&gt;AI Driver app&lt;/a&gt; for Assetto Corsa&lt;/li&gt;
					&lt;li&gt;(optional) Download &lt;a href=&quot;https://assettocorsa.club/content-manager.html&quot; target=&quot;_blank&quot;&gt;Content Manager&lt;/a&gt;&lt;/li&gt;
						&lt;ul&gt;
							&lt;li&gt;Select car and track of choice from what&#39;s available&lt;/li&gt;
							&lt;li&gt;Confirm tires are the default option&lt;/li&gt;
							&lt;li&gt;Practice mode with ideal conditions&lt;/li&gt;
						&lt;/ul&gt;
					&lt;li&gt;(optional) If the track you want is not available, get &lt;a href=&quot;https://www.racedepartment.com/downloads/ai-line-helper.16016/&quot; target=&quot;_blank&quot;&gt;AI Line Helper&lt;/a&gt;&lt;/li&gt;
						&lt;ul&gt;
							&lt;li&gt;Use the &quot;Track Left&quot; button to map the left boundary&lt;/li&gt;
							&lt;li&gt;Rename side_l.csv in the game installation directory to left.csv&lt;/li&gt;
							&lt;li&gt;Use the &quot;Track Left&quot; button to map the right boundary&lt;/li&gt;
							&lt;li&gt;Rename side_l.csv in the game installation directory to right.csv&lt;/li&gt;
							&lt;li&gt;Copy into the content/tracks/track_name folder under the AC Self Driving repo below&lt;/li&gt;
						&lt;/ul&gt;
					&lt;li&gt;(optional) If the car you want is not available (&lt;a href=&quot;https://www.youtube.com/watch?v=H-Fji4-boME&amp;ab_channel=UnleashedDrivers&quot; target=&quot;_blank&quot;&gt;YouTube instructions&lt;/a&gt;&gt;&lt;/li&gt;
						&lt;ul&gt;
							&lt;li&gt;Open Content Manager and go to the About section&lt;/li&gt;
							&lt;li&gt;Click &quot;Version&quot; multiple times to enable developer mode&lt;/li&gt;
							&lt;li&gt;Go to Content -&gt; Cars and select the car you want&lt;/li&gt;
							&lt;li&gt;Click &quot;Unpack data&quot; in the bottom row&lt;/li&gt;
							&lt;li&gt;Copy into the content/cars/car_name folder under the AC Self Driving repo below&lt;/li&gt;
						&lt;/ul&gt;
					&lt;li&gt;Download the &lt;a href=&quot;https://github.com/jesung/ACSelfDriving&quot; target=&quot;_blank&quot;&gt;AC Self Driving&lt;/a&gt; repo&lt;/li&gt;
						&lt;ul&gt;
						&lt;li&gt;pip install -r requirements.txt&lt;/li&gt;
						&lt;li&gt;Run main.py&lt;/li&gt;
						&lt;/ul&gt;
				&lt;/ul&gt;
              &lt;p&gt;&lt;/p&gt;
              &lt;p&gt;
                Code has been tested using Python 3.10 on a Windows 11 machine
              &lt;/p&gt;
          &lt;/div&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;undefined (undefined). Machine learning approach to solve the path optimization problem Retrieved from &lt;a href=&quot;https://arxiv.org/ftp/arxiv/papers/2102/2102.02315.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://arxiv.org/ftp/arxiv/papers/2102/2102.02315.pdf&lt;/a&gt;. This paper describes a machine learning approach to solve the path optimization problem so there are certainly alternatives to the traditional path optimization approach.&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;Kapania, N., Subosits, J., Gerdes, J. (2019). A Sequential Two-Step Algorithm for Fast Generation of Vehicle Racing Trajectories Retrieved from &lt;a href=&quot;https://arxiv.org/pdf/1902.00606.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://arxiv.org/pdf/1902.00606.pdf&lt;/a&gt; (accessed January 30, 2023)&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</content>
  </entry>
  <entry>
    <title>Longitudinal and Lateral Controller on a Simulated Track Environment</title>
    <link href="https://jesungpark.com/projects/av1/"/>
    <updated>2022-01-06T00:00:00Z</updated>
    <id>https://jesungpark.com/projects/av1/</id>
    <category term="project"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
          &lt;div class=&quot;video-container w3-container w3-margin-bottom&quot;&gt;
            &lt;!----&gt;
            &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/dLzMbo29dcg&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;
This was the final project for the first course of the self driving car specialization on Coursera – &lt;a href=&quot;https://www.coursera.org/learn/intro-self-driving-cars&quot; target=&quot;_blank&quot;&gt;Introduction to Self-Driving Cars&lt;/a&gt;. The goal was to implement a lateral and longitudinal controller for a car on a race track given a set of target waypoints and some basic information such as vehicle position, yaw, and speed. More advanced concepts like state estimation, localization, visual perception, and motion planning will be covered in the following courses.
&lt;/p&gt;
&lt;p&gt;
My longitudinal controller is a rudimentary implementation of a &lt;a href=&quot;https://en.wikipedia.org/wiki/PID_controller&quot; target=&quot;_blank&quot;&gt;PID controller&lt;/a&gt;. Unfortunately, I know very little about PID controllers and the course videos didn’t give any examples of how the tuning process worked. So, I relied on my Google-fu and adjusted the parameters through trial and error. In the end, even if the throttle inputs were not as smooth as a human driver might have been, the longitudinal controller was sufficient in keeping the vehicle close to the desired velocity.
&lt;/p&gt;
&lt;p&gt;
For my lateral controller, I implemented the &lt;a href=&quot;https://www.ri.cmu.edu/pub_files/2009/2/Automatic_Steering_Methods_for_Autonomous_Automobile_Path_Tracking.pdf&quot; target=&quot;_blank&quot;&gt;Stanley controller&lt;/a&gt; which was a method used by the aptly named Stanley – Stanford University&#39;s autonomous vehicle that won the &lt;a href=&quot;https://en.wikipedia.org/wiki/DARPA_Grand_Challenge_(2005)&quot; target=&quot;_blank&quot;&gt;2005 DARPA Grand Challenge&lt;/a&gt;. This was a good chance to polish my rusty trigonometry skills and had me drawing diagrams to visualize the correct angles and headings. Surprisingly, the algorithm worked well enough without the crosstrack error adjustment. I suspect there is no rush to fix crosstrack error on a relatively open environment like a race track.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- simulation --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Simulation&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-half w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
The simulation was run on &lt;a href=&quot;http://carla.org/&quot; target=&quot;_blank&quot;&gt;CARLA&lt;/a&gt;, the open-source simulator for autonomous driving research. A script was provided by the course staff that takes care of all the components required besides the longitudinal and lateral controllers. Once running, the script will access the CARLA environment and start receiving state information and sending steering, throttle, and brake commands in return.
&lt;/p&gt;
&lt;p&gt;
Below are the resulting speed as well as the throttle, brake, and steering inputs for the car. Initially, I had a lot of trouble setting up a proper longitudinal controller so I set a static value for the throttle and worked on the lateral controller. Although there was a lot of derivations required to implement the Stanley controller, the individual steps were not too difficult. Once the edge cases were addressed and the vehicle was steering correctly, I implemented the PID controller for longitudinal control. One surprising observation was that even though the PID controller was programmed to brake if necessary, the brakes were not used at all. In fact, the throttle value stayed above 0.5 once it got up to speed. To the right, you can see the 2D map of the track. The actual vehicle trajectory tracks the reference line provided by the waypoints quite well. In my final solution, I was able to complete 100% of the waypoints evaluated by the grader.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-half w3-padding-16&quot;&gt;
&lt;div class=&quot;w3-col&quot;&gt;
&lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/forward_speed.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/throttle_output.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/brake_output.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/steer_output.png&quot; alt=&quot;&quot; /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-container w3-margin-bottom&quot;&gt;
&lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/trajectory.png&quot; alt=&quot;&quot; style=&quot;width:75%&quot; /&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- results --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Grader Output&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-row-padding w3-padding-16&quot;&gt;
&lt;div class=&quot;w3-col m6&quot;&gt;
&lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/AV_Figure_1.png&quot; alt=&quot;&quot; style=&quot;width:100%&quot; /&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-col m6&quot;&gt;
&lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/AV_Figure_2.png&quot; alt=&quot;&quot; style=&quot;width:100%&quot; /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;p&gt;
&lt;i&gt;Assessment passed!, 100.00% of waypoints completed.&lt;/i&gt;
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Assessing Modeling Variability in Autonomous Vehicle Accelerated Evaluation</title>
    <link href="https://jesungpark.com/projects/aisc/"/>
    <updated>2022-01-05T00:00:00Z</updated>
    <id>https://jesungpark.com/projects/aisc/</id>
    <category term="project"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
          &lt;div class=&quot;video-container  w3-container w3-margin-bottom&quot;&gt;
            &lt;!----&gt;
            &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/Js0WQMiKDy8&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              Back in June of 2019, I was given an opportunity to present a paper called &lt;a href=&quot;http://arxiv.org/abs/1904.09306&quot; target=&quot;-_blank&quot;&gt;Assessing Modeling Variability in Autonomous Vehicle Accelerated Evaluation&lt;/a&gt; at &lt;a href=&quot;https://aisc.ai.science/&quot; target=&quot;_blank&quot;&gt;AISC&lt;/a&gt;, a Toronto-based group that discusses interesting machine learning papers or concepts. The slides can be found &lt;a href=&quot;https://jesungpark.com/projects/aisc/assets/misc/Assessing%20Modeling%20Variability%20in%20Autonomous%20Vehicle%20Accelerated%20Evaluation.pdf&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;. The paper focused on leveraging importance sampling to reduce the required number of samples to achieve meaningful precision in safety evaluation by a few orders of magnitude.
            &lt;/p&gt;
            &lt;p&gt;
              Even though I work in the data science field, in my role as a manager, I don&#39;t often get a chance to dig deep into the weeds of research papers. I will typically read the abstract only or get a summary from a team member. This was a good opportunity for me to learn more about the autonomous vehicle space as well as practice my public speaking skills. The hard deadline also gave no room for me to procrastinate. This was happening no matter how over or under-prepared I was.
            &lt;/p&gt;
            &lt;p&gt;
              Given that the YouTube video available, I will not go into detail regarding the actual paper. Instead, I want to share my experiences that&#39;s not captured in the video - how I prepared for the presentation and my takeways from this experience.
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
          &lt;!-- simulation --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Challenges&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              The first challenge was in understanding all of the notation. The notion of an environment &amp;xi; and the corresponding parameters &amp;theta; was not clear to me. I initially thought that the environment spanned the literal environment that the AV would sit in such as the wheel angular velocity, distance between objects, and throttle/brake pedal application. The corresponding parameters might be the tire/surface friction coefficient or the engine torque. The second major confusion I had was around one of the key equations - (14) in the &lt;a href=&quot;https://arxiv.org/pdf/1904.09306v1.pdf&quot; target=&quot;_blank&quot;&gt;original version of the paper&lt;/a&gt;. I couldn&#39;t make sense of it without a normalizing 1/n term. &lt;a href=&quot;https://www.linkedin.com/in/serenamcdonnell/&quot; target=&quot;_blank&quot;&gt;Serena&lt;/a&gt; (who was coordinating) had already sent out an email to the authors so I asked some clarifying questions with the presentation a couple of days away.
            &lt;/p&gt;
            &lt;p&gt;
              Luckily, one of the authors respond promptly explaining that the environment &amp;xi; was much simpler than I had imagined and confirming that there was a typo in equation (14). The environment referred to the essential data points to establish the likelihood of crashing. For instance, if you are driving toward a wall, you might limit the environment to the velocity of the car and the distance between the car and the wall. Aha - things were starting to make sense.
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Final Thoughts&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              The phrase &quot;you get back what you put into it&quot; feels very relevant to this experience. As I spent hours and hours poring over every detail of the paper, I started to really appreciate it at a level not possible previously. This sense of enjoyment from mastery is hard to overstate and something you need to experience personally. That being said, it was humbling to see that my explanations were not as clear as they could be - meaning that my understanding of the topics had room for improvement. Whether you&#39;re a seasoned veteran or getting started in data science, I would highly recommend that you try to present a paper at a local meetup.
            &lt;/p&gt;
          &lt;/div&gt;</content>
  </entry>
  <entry>
    <title>Self-learning Tic-Tac-Toe Agent</title>
    <link href="https://jesungpark.com/projects/tic-tac-toe/"/>
    <updated>2022-01-04T00:00:00Z</updated>
    <id>https://jesungpark.com/projects/tic-tac-toe/</id>
    <category term="project"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
&lt;p&gt;&lt;!-- explanation --&gt;
&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Can you beat the machine?
&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;tictactoe&quot;&gt;
&lt;div class=&quot;grid&quot; id=&quot;btn1&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;grid&quot; id=&quot;btn2&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;grid&quot; id=&quot;btn3&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;grid&quot; id=&quot;btn4&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;grid&quot; id=&quot;btn5&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;grid&quot; id=&quot;btn6&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;grid&quot; id=&quot;btn7&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;grid&quot; id=&quot;btn8&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;grid&quot; id=&quot;btn9&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;div class=&quot;text-center&quot; id=&quot;result&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://jesungpark.com/assets/js/tic-tac-toe.js&quot;&gt;&lt;/script&gt;
&lt;!-- explanation --&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
This project creates an agent that learns how to play Tic-Tac-Toe by itself. The agent is based on a simple neural network with 2 fully connected hidden layers. I didn’t play around with the network architecture too much since Tic-Tac-Toe has a low skill ceiling and the agent was sufficiently good.
&lt;/p&gt;
&lt;p&gt;
A few things I approached differently from the original kernel was how the board state is represented and having the agent play against itself. For the board state, I changed player 1, player 2, and empty state from 1, 2, 3 to 1, -1, and 0, respectively. I thought it made more sense for the empty state to be in between the two players compared to 0, 1, 2. This turned out quite well for training. Initially, the agent was making poor moves even after 200K games played. With this representation, performance was much better with only 100K games.
&lt;/p&gt;
&lt;p&gt;
The training was done in groups of 250 games over 400 rounds for a total of 100K games. During a round, the agent will play against itself by alternating between the move with the highest expected score and then the move with the lowest expected score (1 for Player 1 win, 0.5 for draw, 0 for Player 2 win). To help the agent explore different options, it has a 20% chance of picking a random move. Every board state of each game will be updated with the final score and added to the training data. At the end of each round, the model will use the accumulated training data to update its weights.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-half w3-container w3-margin-bottom&quot;&gt;
&lt;img src=&quot;https://jesungpark.com/assets/img/portfolio/tic-tac-toe_results.jpg&quot; style=&quot;width:100%&quot; /&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-half w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Each bar in the chart represents 10K games played. You can see that going first was a significant advantage in the beginning but the results start to stabilize after 30K games. It will be interesting to test the strength of the agent at various points.
&lt;/p&gt;
&lt;p&gt;
So how does it perform? Pretty well. Generally, I could not beat the agent when it moved based on highest expected score. There were some edge cases that led to silly losses - I will leave it for you to find them. Sometimes a losing move would have an expected score that&#39;s within 0.01 of the winning move but as they say, it doesn&#39;t matter if you win by an inch or a mile. Winning is winning!
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Source code is available on &lt;a href=&quot;https://github.com/jesung/Tic-Tac-Toe/blob/master/tic_tac_toe.ipynb&quot; target=&quot;_blank&quot;&gt;Github&lt;/a&gt;. This project was inspired by this &lt;a href=&quot;https://www.kaggle.com/dhanushkishore/a-self-learning-tic-tac-toe-program&quot; target=&quot;”_blank”&quot;&gt;Kaggle kernel&lt;/a&gt;.
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</content>
  </entry>
  <entry>
    <title>Remembering happiness</title>
    <link href="https://jesungpark.com/blog/remembering-happiness/"/>
    <updated>2021-03-14T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/remembering-happiness/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              What makes us happy? Lots of money, social status, true love, our genetic predispositions -- the list goes on. However, studies have shown that the aforementioned factors make surprisingly little contribution to our happiness. In this post, I explore some useful models of thinking about happiness and share some practical tips.
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;!-- simulation --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Experiencing vs. remembering self&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              In &lt;i&gt;Living, and thinking about it: two perspectives on life&lt;/i&gt;, Kahneman and Riis (2005)&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; discuss the distinction between answers to questions about one&#39;s feelings in the past and in the present. How we feel in the moment is the &lt;b&gt;experiencing self&lt;/b&gt; and how we feel about the past is the &lt;b&gt;remembering self&lt;/b&gt;.
            &lt;/p&gt;
            &lt;p&gt;
              The experiencing self is ephemeral. You could be sipping margarita on a beach one moment and spilling your drink next, or find out your credit card got declined for the replacement drink. I cannot recall who said this&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;: &quot;when asked how things could get better, you can think of a few things like winning the lottery (JP: which, by the way, is as effective at increasing your long-term happiness as becoming a quadriplegic&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;) but there are infinitely many ways for things to go wrong&quot;.
            &lt;/p&gt;
            &lt;p&gt;
              How is happiness measured? If we think of our life as a sequence of moments in time, we could average out how the experiencing self felt in each moment. But our memory does not work this way. As &lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/&quot; target=&quot;_blank&quot;&gt;previously mentioned&lt;/a&gt;, the remembering self is biased with the &lt;b&gt;peak/end rule&lt;/b&gt;. Our evaluation can mostly be explained by the peak and final emotions with little regard for the total duration.
            &lt;/p&gt;
            &lt;p&gt;
              To highlight the difference between the two selves, Kahneman asks&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-4&quot; class=&quot;citation-link&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;:
              &lt;/p&gt;&lt;blockquote&gt;
                Suppose you&#39;re planning a vacation and you&#39;re just told that at the end of the vacation, you&#39;ll get an amnesic drug to remember nothing and they&#39;ll also destroy your photos so there will be nothing [left]. Would you still go to the same vacation [or plan a different vacation]?
              &lt;/blockquote&gt;
            &lt;p&gt;&lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Memory&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              Luckily for me, I don&#39;t need amnesic drugs because I am blessed with the memory of a goldfish. I say blessed because there are three benefits to having bad memory. First, I cannot rely on what happened before to make decisions so decision-making is done through my mental models or from &lt;a href=&quot;https://jamesclear.com/first-principles&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;first principles&lt;/a&gt;. Second, I am less influenced by memories of a bad event, which I suspect makes me more resilient&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-5&quot; class=&quot;citation-link&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;. You can&#39;t feel sorry for yourself if you don&#39;t recall your woes. Third, I cannot recall but I&#39;m sure it&#39;s important. This got me wondering: if you can&#39;t remember anything, do you really change as a person?
            &lt;/p&gt;
            &lt;p&gt;
              In the book The Power of Habit&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-6&quot; class=&quot;citation-link&quot;&gt;6&lt;/a&gt;&lt;/sup&gt;, Charles Duhigg describes Eugene Pauly, a man known in literature as E.P.&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-7&quot; class=&quot;citation-link&quot;&gt;7&lt;/a&gt;&lt;/sup&gt; who developed severe amnesia following a case of viral encephalitis. Eugene was not able to form any new memories but scientists studying him found that he was able to improve his performance on three-word sentence tests over a 12-week period. But when the researchers switched the order of words, E.P. could not get the answers right. Thus, his learning was more of a habit formation -- like riding a bicycle.
            &lt;/p&gt;
            &lt;p&gt;
              Even in the absence of recalled memory, the ego can change through learned habits and altered neurochemistry. I would posit that it is short-sighted to rely only on the remembering self to make judgements on happiness and what one should do to maximize it. For those of us that don&#39;t have severe amnesia like E.P., how does memory influence our emotional well-being and life satisfaction?
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Setting reference points&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              As described in &lt;a href=&quot;https://jesungpark.com/blog/on-prospect-theory/&quot; target=&quot;_blank&quot;&gt;prospect theory&lt;/a&gt;, our brain is constantly setting new reference points. Research seems to indicate that experiences drive more happiness than material goods&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-8&quot; class=&quot;citation-link&quot;&gt;8&lt;/a&gt;&lt;/sup&gt;. Instead of buying a new gadget, you will derive more remembered happiness with a vacation. Even marriage cannot escape reference points. Lucas et al. (2003)&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-9&quot; class=&quot;citation-link&quot;&gt;9&lt;/a&gt;&lt;/sup&gt; showed that tying the knot only provides a bump in happiness in the two years following.
            &lt;/p&gt;
            &lt;p&gt;
              Once a higher reference point has been set, the same experience that used to bring you joy (e.g., bigger house, nicer car) brings you less joy, and the peak/end rule spoils your memory of it. To combat this feature of the mind, perhaps car manufacturers ought to add more features or unlock more horsepower over time. Coincidently, I think that&#39;s called a Tesla but I digress.
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Practical tips&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              Speaking of digressions, I am aware that my writing tends to explore the underlying framework of things rather than providing practical tips. It&#39;s as if you are wandering in the desert, looking for an oasis, and I show up and tell you how oases are formed. In case you were wondering.
            &lt;/p&gt;
            &lt;p&gt;
              Strange analogies aside -- okay, one more -- allow me to offer you a cup of tea to wet the mouth. In her course &quot;&lt;a href=&quot;https://www.coursera.org/learn/the-science-of-well-being&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;The Science of Well-Being&lt;/a&gt;&quot;, Yale professor Laurie Santos shares some practical tips for happiness. To reset your reference points, you can concretely re-experience the old reference points, avoid social comparisons, and interrupt your consumption. To thwart hedonic adaptation, you can practise savouring (stepping outside of an experience to review and appreciate it), negative visualization (e.g., imagining how you may have never met your partner), and gratitude&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/remembering-happiness/#cite-10&quot; class=&quot;citation-link&quot;&gt;10&lt;/a&gt;&lt;/sup&gt;.
            &lt;/p&gt;
            &lt;p&gt;
              One wonders how these tactics will shift the results of happiness studies. Will it show that people are generally happier with what they have and shift all numbers up equally? Or will it show a preference for the experiencing self?
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Conclusion&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              Kahneman said recently that he abandoned happiness research because he couldn&#39;t quite figure it out. If people actually feel happier focusing on the best vacation or the best Instagram picture of it instead of tying the knot, who are we to tell them what should make them happy?
            &lt;/p&gt;
            &lt;p&gt;
              One might hesitate to make value judgements by saying you should enjoy the moment instead of taking the perfect vacation picture. It feels wrong to disparage our natural predispositions. But I believe one should make reasonable efforts to think about their value system and attempt to align it with their behaviour. This ability, in some sense, is what makes us human. Applying the practical tips for happiness affirms our commitment to a value system which ought to be consciously chosen, not dictated by our genes or other people.
            &lt;/p&gt;
            &lt;p&gt;
              What does your value system look like? If you want to be remembered positively by others, you should make lots of money, be somewhat miserly throughout your life, and go out with a bang of a charity donation to a noble cause before you croak. Leave it to the peak/end rule to overwrite a lifetime of being a scrooge. Instead, if you want to be a force for good in the world, what might you want to do? And would you do anything different if you knew that you will, one day, be forgotten?
            &lt;/p&gt;
          &lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;&lt;p&gt;&lt;/p&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;Kahneman and Riis (2005). Living, and thinking about it: two perspectives on life Retrieved from &lt;a href=&quot;https://scholar.princeton.edu/sites/default/files/kahneman/files/living_dk_jr_2005.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://scholar.princeton.edu/sites/default/files/kahneman/files/living_dk_jr_2005.pdf&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;See first sentence of the Memory section.&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;Brickman, P., Coates, D., &amp; Janoff-Bulman, R. (1978). Lottery winners and accident victims: is happiness relative?&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-4&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;4.&lt;/span&gt; &lt;small&gt;undefined (2020). Daniel Kahneman: Thinking Fast and Slow, Deep Learning, and AI | Lex Fridman Podcast #65 [Video]. undefined Retrieved from &lt;a href=&quot;https://youtu.be/UwwBG-MbniY?t=2636&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://youtu.be/UwwBG-MbniY?t=2636&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-5&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;5.&lt;/span&gt; &lt;small&gt;I haven&#39;t found scientific evidence to support this claim. &lt;a href=&quot;http://midus.wisc.edu/findings/pdfs/2046.pdf&quot; target=&quot;_blank&quot;&gt;Some studies&lt;/a&gt; seem to suggest lower neuroticism leads to better long-term memory performance but &lt;a href=&quot;https://pubmed.ncbi.nlm.nih.gov/24994479/&quot; target=&quot;_blank&quot;&gt;others saw the opposite&lt;/a&gt;. The relationship between long-term memory and resilience is unclear to me.&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-6&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;6.&lt;/span&gt; &lt;small&gt;undefined (2012). &lt;i&gt;The power of habit: Why we do what we do in life and business&lt;/i&gt;. Random House&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-7&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;7.&lt;/span&gt; &lt;small&gt;Insausti et al. (2013). Human amnesia and the medial temporal lobe illuminated by neuropsychological and neurohistological findings for patient E.P.&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-8&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;8.&lt;/span&gt; &lt;small&gt;Kumar A, Killingsworth MA, Gilovich T (2014). Waiting for Merlot: Anticipatory Consumption of Experiential and Material Purchases&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-9&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;9.&lt;/span&gt; &lt;small&gt;Lucas, R. E., Clark, A. E., Georgellis, Y., &amp; Diener, E. (2003). Reexamining adaptation and the set point model of happiness: Reactions to changes in marital status&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-10&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;10.&lt;/span&gt; &lt;small&gt;I am always at the mercy of the availability heuristic but the former seems to be a nod to prospect theory while the latter attempts to shift the focus to the experiencing self instead of the remembering self.&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>Taking a different perspective</title>
    <link href="https://jesungpark.com/blog/taking-a-different-perspective/"/>
    <updated>2021-03-01T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/taking-a-different-perspective/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              The Earth is round. Two plus two equals four. Joe Biden and Kamala Harris live on Earth which revolves around the Sun. These are demonstrable and irrefutable facts today but this wasn&#39;t always the case.
            &lt;/p&gt;
            &lt;p&gt;
              Before the 1600s, people believed that the Sun revolves around the Earth. Geocentrism was the predominant scientific model for most of recorded history since the times of Aristotle and Ptolemy. It wasn&#39;t until Galileo pioneered the refracting telescope and pointed it towards Jupiter&#39;s moons that scientific paradigm of two millennia was shaken. But why did people think this way? Evolutionary biologist Richard Dawkins posed this rhetorical question -- and I paraphrase -- it looks as if the Sun revolves around the Earth. What would it look like if the Earth revolved around the Sun?
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;!-- simulation --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Mysteries of the universe&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              Why does our universe seem &lt;a href=&quot;https://en.wikipedia.org/wiki/Fine-tuned_universe&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;fine-tuned to produce life&lt;/a&gt;? If there wasn&#39;t a matter-antimatter asymmetry (asymmetry being something fairly unusual in our universe), the Big Bang simply would have been a flash of light. But no matter -- celestial dials worked in our favour this time around.
            &lt;/p&gt;
            &lt;p&gt;
              What would it look like if the universe was not conducive to producing life? There were infinitely many ways that the universe could have imploded, scattered into nothingness, or otherwise not be conducive to producing life. It may seem as if the probability of our existence is incredibly small. However, probabilities must be considered with existing conditions. In this example, there is a group of creatures that are pondering this question so it would be unlikely for our universe to not seemingly guide life into existence&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/taking-a-different-perspective/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;.
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Against conventional wisdom&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/taking-a-different-perspective/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              In the show Silicon Valley, entrepreneur Peter Gregory&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/taking-a-different-perspective/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; has a serendipitous moment while starting atop the breading of BK burgers and predicts a global shortage of sesame seeds due to an overlapping lifecycle period of cicada species (&lt;a href=&quot;https://www.youtube.com/watch?v=KUxMY77i0q4&amp;ab_channel=FastTalkandFinePrint&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;just watch the video&lt;/a&gt;). This dramatized scene showcases thinking from first principles, where you start from a blank slate with no assumptions. Reasoning is done from scientifically demonstrable facts and the conclusions may go against conventional wisdom or the sesame seed futures market.
            &lt;/p&gt;
            &lt;p&gt;
              Done right, thinking from first principles can help you make better decisions. It can apply to Elon Musk deciding to invest a large part of his wealth into sustainable energy companies and becoming the richest person on Earth. But we do not have to reserve this tool only for investments of tens of millions of dollars. It can apply to making small day-to-day decisions as well.
            &lt;/p&gt;
          &lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Mental models&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
As a manager of data scientists, much of my day is spent making decisions. From prioritizing work at the individual or the team level to tactical steps for troubleshooting errors, I am asked to decide what&#39;s next. By having a good mental model of how various systems (e.g., decision making, data pipeline, machine learning algorithm) work, I can connect the dots and make a large number of reasonably good decisions quickly.
&lt;/p&gt;
&lt;p&gt;
One pattern some people fall into is doing things a certain way simply because that is how it was done before. This is in part driven by the availability heuristic, where the historical action comes to mind more readily than other, possibly better solutions. This heuristic is great for when deciding where to go for lunch but has obvious drawbacks. As financial advisors warn, past performance is not a guarantee of future results. We ought to think for ourselves to understand why things work a certain way.
&lt;/p&gt;
&lt;p&gt;
It is my job to have an opinion on things and communicate it to others effectively. Whether it is on the team&#39;s vision or at a task level, my role is to achieve maximum progress on the company&#39;s goals. Elon Musk has compared this to vectors (i.e., having a magnitude and a direction), saying &lt;/p&gt;&lt;blockquote&gt;&amp;quot;Every person in your company is a vector. Your progress is determined by the sum of all vectors.&amp;quot;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/taking-a-different-perspective/#cite-4&quot; class=&quot;citation-link&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/blockquote&gt; According to this, your progress as a company is maximized by aligning the individual vectors and increasing each person&#39;s magnitude&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/taking-a-different-perspective/#cite-5&quot; class=&quot;citation-link&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;.
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Wrapping up&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
If everyone accepted conventional wisdom as presented, humanity would never make progress. It is thanks to the dissenting few that new ideas are put forth and humanity takes a step forward. Just as Galileo advanced modern science through his willingness to be a contrarian, we should not get swept up in the tides of other opinions.
&lt;/p&gt;
&lt;p&gt;
But you should not take a different position just for the sake of it. Decisions ought to be on solid ground supported by first principles thinking or your tried and tested mental models. So next time you make an important decision, think through the why and do not let conventional wisdom dictate the outcome.
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;This is a form of the anthropic principle. Granted, many physicists seem dissatisfied with this answer and are looking for the principles that imbued our universe with its laws of physics such that life would always be inevitable.&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;This term seems to me quite a silly one. You would have to accept the implied premise that the general public is wise on most topics.&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;This character is loosely based on Peter Thiel, co-founder of PayPal and Palantir&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-4&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;4.&lt;/span&gt; &lt;small&gt;Shah, Dharmesh (2017). What Elon Musk Taught Me About Growing A Business. &lt;i&gt;LinkedIn&lt;/i&gt;. Retrieved from &lt;a href=&quot;https://www.linkedin.com/pulse/what-elon-musk-taught-me-growing-business-dharmesh-shah/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.linkedin.com/pulse/what-elon-musk-taught-me-growing-business-dharmesh-shah/&lt;/a&gt; (accessed October 16, 2017)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-5&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;5.&lt;/span&gt; &lt;small&gt;From my experience, the former is easier at smaller scales -- although your long-term success depends on the latter.&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>Lessons from endurance racing</title>
    <link href="https://jesungpark.com/blog/lessons-from-endurance-racing/"/>
    <updated>2021-02-17T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/lessons-from-endurance-racing/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              In 2018 and 2019, I participated in several grassroots endurance racing events with a group of friends. The events consisted of two days of 8-hour races and were held at different race tracks across Ontario. The races were an incredible experience and looking back, offers some lessons to be learned.
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;!-- simulation --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Real-time feedback&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              During our races, we had a timing device to track our car&#39;s progress. This provided feedback of the driver&#39;s pace every lap. Sometimes, we had a lap timer which measured the real-time delta of our current lap time against the car&#39;s best lap time. This gave extra motivation for our drivers to keep up the pace.
            &lt;/p&gt;
            &lt;p&gt;
              Seeing the delta creep up into the reds would provide real-time feedback that the way we took the last corner could be better. This was great for the drivers to improve their lap times. But the goal of an endurance race is not to put in the best lap times. It is to cross the finish line first.
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Life is a marathon, and racing is life&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/lessons-from-endurance-racing/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              Setting the best lap times does not matter if you cannot finish the race. Pushing the car too hard puts additional stress on the tires and the drivetrain, and it increases the risk of incidents. The goal then, is to drive as quickly as possible while managing wear and risk.
            &lt;/p&gt;
            &lt;p&gt;
              When you go as hard as possible without refueling, you will run out of steam quickly (more accurately, combustion). Throughout the race, we brought the car back to the pits several times for fuel and fresh rubber. The pitstop is a crucial element in racing. Seconds gained or lost in the pitstop can decide the race. In order to streamline the process, everyone on the team had to play their part.
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Trust your team&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              Racing is a team sport. There are the engineers that help to set up the car, finance teams that balance cost and reward, and strategists that calculate when to pit and how hard to push. We were lucky to have some talented mechanics on our team that brought some professional knowledge to our enthusiasm. There are too many instances to list them all here but some of them included aligning the car by eye during a post-crash pit stop, diagnosing a smoking dashboard&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/lessons-from-endurance-racing/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;, and using a dead blow mallet as a make-shift trailer spring to get us to the track on time.
            &lt;/p&gt;
            &lt;p&gt;
              During pitstops, there were multiple roles to fill: to fuel up the car, hold the fire extinguisher, jack up the car, change the tires, and help the next driver buckle in. We even had a team mascot to cheer us on.
            &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-col m4&quot;&gt;
&lt;picture&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://jesungpark.com/img/lui-300w.webp 300w, https://jesungpark.com/img/lui-600w.webp 600w, https://jesungpark.com/img/lui-1200w.webp 1200w&quot; sizes=&quot;(min-width: 993px) 33vw, 100vw&quot; /&gt;&lt;img src=&quot;https://jesungpark.com/img/lui-300w.jpeg&quot; alt=&quot;Our team mascot - Lui.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;1200&quot; height=&quot;1600&quot; srcset=&quot;https://jesungpark.com/img/lui-300w.jpeg 300w, https://jesungpark.com/img/lui-600w.jpeg 600w, https://jesungpark.com/img/lui-1200w.jpeg 1200w&quot; sizes=&quot;(min-width: 993px) 33vw, 100vw&quot; /&gt;&lt;/picture&gt;
&lt;br /&gt;&lt;small&gt;
Our team mascot Lui.
&lt;/small&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-col m8&quot;&gt;
&lt;iframe src=&quot;https://www.facebook.com/plugins/video.php?height=314&amp;href=https%3A%2F%2Fwww.facebook.com%2Fhhdang%2Fvideos%2F10160451132415475%2F&amp;show_text=false&amp;width=560&quot; width=&quot;560&quot; height=&quot;314&quot; style=&quot;border:none;overflow:hidden&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;true&quot; allow=&quot;autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share&quot; allowFullScreen=&quot;true&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
A single person cannot be an entire race team. Completing our pit stop within the 5-minute minimum window was like having complex parts work together to make a clock tick. Everyone must play their part and be trusted to do so. There is no time for second-guessing during a race. All the preparation is done before the race weekend.
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Test &amp;amp; tune&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Before races, we would take the car out to lapping days to tune the suspension and find out where the weak links are. This is critical to the success of the race weekends, as we seek to maximize the performance of the car and minimize the risk of failure over long stints.
&lt;/p&gt;
&lt;p&gt;
We check for tire temperature and wear, adjusting camber and toe as necessary. We also adjust the dampers to make the car well-behaved on track. Testing also ensures that drivers are not learning things about the car for the first time on track. The consequences could be catastrophic if the driver was not well-versed in unbuckling themself during a fire. We do the most we can to be ready for the weekend. And then we go racing.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Have fun&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Racing is not just about winning trophies. One of my fondest memories is having had to retire our car due to brake failure, overnight a new brake caliper from Japan (it was actually Toronto), and then experiencing complete brake failure during my stint the next day.
&lt;/p&gt;
&lt;p&gt;
My first reaction after the brake failure was to bring the car back to the pits as quickly as possible so we can try to fix it and get back on track. Perhaps I ought to have felt mortified at my near-death experience instead. Humans are weird.
&lt;/p&gt;&lt;p&gt;
At the end of the day, we all signed up to have fun. In grassroots racing, there are no giant prize pools or fame. We fight hard on track but are comrades off it. Everyone has some BBQ and beer after the race. The grassroots racing community welcomed us and we had the most fun we could have with our clothes on&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/lessons-from-endurance-racing/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;.
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;Since I&#39;m not a real writer, I can abuse whatever clichés I want&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;Electrical issues are the worst since there are so many points of failure. Not ideal when you have to get back on track as quickly as possible. It turns out dry carbon is conductive.&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;I must credit Joe T, the leader and class clown of SPDA for this phrase&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>On prospect theory</title>
    <link href="https://jesungpark.com/blog/on-prospect-theory/"/>
    <updated>2021-02-06T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/on-prospect-theory/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Thought experiment&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              Imagine that you are proposed the following gamble on a coin toss:
              &lt;/p&gt;&lt;blockquote&gt;
                If the coin shows tails, you lose $100.
                &lt;br /&gt;If the coin shows heads, you win $150.
                &lt;br /&gt;Do you accept the gamble? Yes/No
              &lt;/blockquote&gt;
              According to Daniel Kahneman&#39;s experiments, most people will not accept the gamble. Despite the positive expected value, the discomfort of losing $100 outweighs the possible gain of $150. Behavioural economist Richard Thaler coined the term &lt;b&gt;Econs&lt;/b&gt; to represent the fictitiously rational agents that exist in economic theory contrasted with the oft-irrational Humans.
            &lt;p&gt;&lt;/p&gt;
            &lt;p&gt;
              While basic economic theories are useful, there are many examples like in the gamble above that act as counterexamples against the assumption of rationality. As an aspiring Econ, I wanted to better understand how Humans make decisions by exploring &lt;b&gt;prospect theory&lt;/b&gt;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/on-prospect-theory/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. Published by Kahneman and Tversky in 1979, prospect theory made significant contributions to the field of behavioural economics; which led to Kahneman winning the 2002 Nobel prize in economics.
            &lt;/p&gt;
            &lt;p&gt;
              &lt;/p&gt;&lt;blockquote&gt;
                &lt;i&gt;Simple gambles (such as &quot;40% chance to win $300&quot;) are to students of decision making what the fruit fly is to geneticists.
                &lt;br /&gt;-from Thinking, Fast and Slow&lt;/i&gt;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/on-prospect-theory/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;
              &lt;/blockquote&gt;
            &lt;p&gt;&lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
          &lt;!-- simulation --&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Principle #1: Evaluation is relative to a reference point&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              According to prospect theory, there are three principles that affect how we evaluate situations. First, evaluation is relative to a neutral &lt;b&gt;reference point&lt;/b&gt;. This is also called adaptation level. You evaluate opportunities based on a reference point which is usually the status quo but can sometimes be the outcome you expect or the outcome you feel entitled to. The unit of measurement is often monetary in these scenarios for ease of comparison. Consider the following proposals.
            &lt;/p&gt;
            &lt;p&gt;
              &lt;/p&gt;&lt;blockquote&gt;
                Problem A: In addition to whatever you own, you have been given $1000. You are now asked to choose one of these options:
                &lt;br /&gt;50% chance to win $1000 OR get $500 for sure
                &lt;br /&gt;&lt;br /&gt;Problem B: In addition to whatever you own, you have been given $2000. You are now asked to choose one of these options:
                &lt;br /&gt;50% chance to lose $1000 OR lose $500 for sure
              &lt;/blockquote&gt;
              In problems A and B, the reference points are ignored; people barely pay attention to the initial $1k/2k that are given.
            &lt;p&gt;&lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Principle #2: Diminishing sensitivity&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              Humans also tend to compare things on a relative scale instead of in absolutes. The subjective difference between $900 and $1000 is much smaller than the difference between $100 and $200. I am guilty of this sin, having spent more effort deliberating which menu items has better cost per calorie than the McDouble compared to the hundreds or thousands of dollars I spend on new tech or my racing addiction. This concept of diminishing marginal gains is also seen in &lt;a href=&quot;https://en.wikipedia.org/wiki/Expected_utility_hypothesis&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Bernoulli&#39;s Utility theory&lt;/a&gt;.
            &lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;span12&quot;&gt;
            &lt;h4&gt;Principle #3: Loss aversion&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
            &lt;p&gt;
              The third principle is loss aversion. Faced with a gain or loss of the same amount, people would weigh the loss more heavily. This would explain why most people are unwilling to accept gambles such as the one introduced in the beginning. However, people become risk seeking when faced with loss such as in Problem B. The pain of losing $500 for sure is greater than 50% of the pain of losing $1000.
            &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-col m6&quot;&gt;
&lt;a href=&quot;https://commons.wikimedia.org/wiki/File:Prospect_Theory_Graph.svg#/media/File:Prospect_Theory_Graph.svg&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;img src=&quot;https://upload.wikimedia.org/wikipedia/commons/5/54/Prospect_Theory_Graph.svg&quot; alt=&quot;Prospect Theory Graph.svg&quot; style=&quot;width:100%&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-col m12&quot;&gt;
&lt;p&gt;
&lt;br /&gt;&lt;small&gt;
Illustration of the psychological value of various gains and losses as described by prospect theory.
By &lt;a href=&quot;https://commons.wikimedia.org/wiki/User:Pharexia&quot; title=&quot;User:Pharexia&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Pharexia&lt;/a&gt; - Own work,
&lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0&quot; title=&quot;Creative Commons Attribution-Share Alike 4.0&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;CC BY-SA 4.0&lt;/a&gt;,
&lt;a href=&quot;https://commons.wikimedia.org/w/index.php?curid=78589012&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Link&lt;/a&gt;
&lt;/small&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Limitation #1: Disappointment&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Not all theories are perfect, however. Kahneman is wary of developing the psychological theory equivalent of rose-coloured glasses and offers some criticisms of his own theory. For instance, prospect theory cannot deal with disappointment. If you had a 90% chance of winning $1M and 10% chance to win nothing only to end up winning nothing, you will be quite disappointed. Even though the status quo ought to be the reference point objectively, remaining there is somehow immensely disappointing.
&lt;/p&gt;
&lt;p&gt;
This might be explained by the brain&#39;s reward signals reacting to something unexpected even if it&#39;s not a sure thing. Once you are aware of the proposal, your brain sends out the reward signals. This is similar to telling people about your new year&#39;s resolutions. The act of telling others about it gets you a partial reward signal just by talking about it and gaining social acceptance.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Limitation #2: Regret&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Another criticism of prospect theory is that it does not deal with regret, as the following example shows.
&lt;/p&gt;&lt;blockquote&gt;
Problem C: Choose between 90% chance to win $1 million OR $50 with certainty
&lt;br /&gt;&lt;br /&gt;Problem D: Choose between 90% chance to win $1 million OR $150,000 with certainty
&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
People will feel bigger regret if they fail to win in Problem D. Perhaps the emotion of regret is the difference between the option not chosen ($150K) and the end state ($0). In the case of uncertain gambles (e.g. 90% chance to win $1 million), the value of the potential outcome is multiplied by the probability.
&lt;/p&gt;&lt;p&gt;
When examining these probabilistic gambles, I was reminded of a story in Kahneman&#39;s &lt;i&gt;Thinking, Fast and Slow&lt;/i&gt; that demonstrated that even statistics professors are terrible intuitive statisticians. If that is the case, can we expect Humans to fairly weigh probabilities in evaluating highly likely or unlikely events?
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Highly unlikely events&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
People tend to buy lottery tickets even though the expected value is negative (otherwise the lottery operator would lose money), and are disappointed when they do not win despite having astronomically low odds of winning. Burns et. al (2010)&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/on-prospect-theory/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; gives two explanations for this behaviour: availability heuristic and possibility effect.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Availability heuristic&lt;/b&gt; is a mental shortcut that relies on examples that immediately come to mind. When examining your own happiness, if all your can recall are social media stories of people&#39;s best experiences, your life will feel miserable in comparison. Lottery players can only think of the few publicized winners, not the millions of losers that do not get reported on. This leads them to believe that the odds of winning seem more likely than it actually is.
&lt;/p&gt;&lt;p&gt;
&lt;b&gt;Possibility effect&lt;/b&gt; describes the phenomenon where people overweight small probabilities compared to moderate ones. Although nuclear fission reactors are quite safe (scientists haven&#39;t quite gotten fusion working yet), people worry about the negative implications more than the probabilities demand. Perhaps availability heuristic is at work here with images of Fukushima or Chernobyl.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Probability weighting function&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
So, if people tend to overweight highly unlikely events (and also underweight highly likely events compared to certainty), can we figure out how the average person actually weighs different probabilities? We can then build a probability to weighting mapping function such as the following.
&#92;[f(p) = w, &#92;textrm{for probability } p &#92;textrm{ and weight } w &#92;textrm{, with } 0 &#92;leq p,w &#92;leq 1&#92;]
&lt;/p&gt;
&lt;p&gt;
Luckily, some smart people already thought about this and describe a weighted cumulative probability function as part of &lt;a href=&quot;https://en.wikipedia.org/wiki/Cumulative_prospect_theory&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;cumulative prospect theory&lt;/a&gt; (CPT), a successor to prospect theory. It is interesting to note that I came about this idea before knowing about CPT. This provides some evidence that the underlying concepts of CPT are already circulating within the general public.
&lt;/p&gt;&lt;p&gt;
One criticism I would offer for CPT&#39;s probability weighting function is that the overweighting can be done at infinitesimally small scales. I posit that at extreme scales (small or large), people lose the concept of scale. What things are measured in picometre (10-12 m) versus a femtometre (10-15 m)? Most people would not have a decent reference point to compare against. The Andromeda galaxy is a stone&#39;s throw&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/on-prospect-theory/#cite-4&quot; class=&quot;citation-link&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; of 2.5 M light years away, on a collision course with the Milky Way in 4 billion years whereas the &lt;a href=&quot;https://en.wikipedia.org/wiki/NGC_4151&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Eye of Sauron&lt;/a&gt; is watching from 52 M light years away (or ago?). Instead of an exponential function at the extremes, it may be a step function until there is a reasonable reference point that makes sense.
&lt;/p&gt;
&lt;p&gt;
In order to empirically estimate this mapping function, I propose simple gambles between certainty to win such as:
&lt;/p&gt;&lt;blockquote&gt;
Problem E: Choose between 1% chance to win $1 million OR $2,500 with certainty
&lt;br /&gt;&lt;br /&gt;Problem F: Choose between 99% chance to win $1 million OR $900,000 with certainty
&lt;/blockquote&gt;
With the right combination of chance and certain monetary values, the gambles that have close to 50-50 split will be the right trade-off. In the second example, 99% chance gets mapped to $900,000/$1 million = 90% provided that the answers are split 50-50.
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Prospect theory, introduced in 1979, helped to more accurately model human behaviour, including the irrational ones. While not without its limitations, prospect theory introduced concepts such as loss aversion and evaluation from a reference point which greatly improved upon the prevailing theories of the time.
&lt;/p&gt;
&lt;p&gt;
Studying decision making is useful because you can often catch yourself making irrational choices. Recall the very first problem that I introduced: you lose $100 if it&#39;s tails and win $150 if it&#39;s heads. If this offer was proposed to me, my first question would be &amp;quot;how many times can I play?&amp;quot;. And my second question would be &amp;quot;how much time can you give me to liquidate all my assets?&amp;quot;.
&lt;/p&gt;&lt;p&gt;
However, I want to avoid condemning all irrational behaviour. The lottery is simply a negative expected value event for Econs. But the thrill of anticipation and perhaps even the subsequent disappointment makes it a worthwhile experience for many Humans. If life was only about maximizing expected value, it would be a pretty boring one.
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;surveyhero-embed-ea4c4208&quot;&gt;&lt;/div&gt;
&lt;script src=&quot;https://embed-cdn.surveyhero.com/js/user/embed.ea4c4208.js&quot; async=&quot;&quot;&gt;&lt;/script&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;Kahneman, D., &amp; Tversky, A. (1979). Prospect Theory: An Analysis of Decision under Risk. &lt;i&gt;Econometrica, 47(2), 263-291&lt;/i&gt; Retrieved from &lt;a href=&quot;https://doi.org/10.2307/1914185&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://doi.org/10.2307/1914185&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;Kahneman, D. (2011). &lt;i&gt;Thinking, fast and slow&lt;/i&gt;. Farrar, Straus and Giroux&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;Burns et al. (2010). Overweighting of small probabilities Retrieved from &lt;a href=&quot;https://doi.org/10.1002/9780470400531.eorms0634&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://doi.org/10.1002/9780470400531.eorms0634&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-4&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;4.&lt;/span&gt; &lt;small&gt;Technically, it will get there eventually if one throws it faster than escape velocity and the stone is freed from Earth&#39;s gravity.&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>Six steps for fast lap times</title>
    <link href="https://jesungpark.com/blog/six-steps-for-fast-lap-times/"/>
    <updated>2021-01-11T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/six-steps-for-fast-lap-times/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;&lt;i&gt;
(Jan 13, 2021) Note: The statement I made around the relationship of lateral and longitudinal grip is false. The total force generated is not the sum of the two axes but the magnitude of the diagonal, or the length of the circle&#39;s radius.
&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;
In a &lt;a href=&quot;https://jesungpark.com/blog/driving/&quot; target=&quot;_blank&quot;&gt;previous post&lt;/a&gt;, I looked at how to become a faster driver. I argued that while System 1 is needed for the fastest drivers, it is System 2 that builds up the intuition over time through deliberate practice. Having a better understanding of the physics of driving around a track will accelerate a driver&#39;s progress as she will be able to get better feedback from the car and make better use of it.
&lt;/p&gt;
&lt;p&gt;
This post will provide a brief overview of the physics involved in track driving and provide some tools that a driver can use to optimize their lap times. If you are interested in track driving, I highly recommend that you sign up with a proper driving school to ensure a safe, productive environment.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- simulation --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;1. Maximize the grip circle&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
To understand how to maximize the car&#39;s potential, we start with the only point of contact between the car and the track -- the tires. Tire grip is the static friction between the tires and the track surface. A tire can generate grip longitudinally (acceleration and braking), laterally (turning left and right), or a combination of both. This is typically referred to as a &lt;b&gt;grip circle&lt;/b&gt; but in reality, it is more of a &lt;i&gt;grip diamond&lt;/i&gt;. The relationship between longitudinal and lateral grip is approximately linear (&#92;(a+b=c&#92;)), not quadratic (&#92;(a^2+b^2=c^2&#92;)).
&lt;/p&gt;
&lt;p&gt;
A simple rule to get around a track faster is to be at the edge of the grip circle as much as possible. Given two identical racing lines, using more grip means more speed. As a corollary, time spent transitioning between opposing sides should be minimized. For example, approaching corner entry, the driver would be going from full throttle to braking. Any time spent coasting (not accelerating or braking) is time spent in the middle of the grip circle which is undesirable. This is why some racers use &lt;i&gt;left foot braking&lt;/i&gt; to minimize the transition time from accelerating to braking, and back to accelerating. The same logic applies to lateral transitions as well.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;2. Use the full track width&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Now that the ground rule has been established, we will unpack the cornering process step by step, in reverse order. Given that the available tire grip is maximized, a car can drive faster in bigger circles than smaller ones. This is why -- in most countries -- drivers need to slow down more for right turns than for left. When the full track width is not used, the turning radius decreases and therefore the maximum speed that the car can achieve around the corner decreases.
&lt;/p&gt;
&lt;p&gt;
However, the turning radius during corner exit is not static. The car will be accelerating which means that the turning radius will necessarily increase in parallel. The ideal corner exit is one where the car has the highest possible speed at the apex&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/six-steps-for-fast-lap-times/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; that maintains the ability to go full throttle for the remainder of the corner.
&lt;/p&gt;
&lt;p&gt;
With differing grip and power levels, the ideal corner exit line changes for each car. High-powered cars will want to maximize the available forward thrust by straightening out the corner (at the expense of more braking) while low-powered cars will be closer to the geometric line&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/six-steps-for-fast-lap-times/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; with less acceleration throughout the cornering phase.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;3. Minimize the time between start of braking and getting back to full throttle&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
With the knowledge of what angle and speed the car needs to have at the apex, one must now get to that point as fast as possible. Going back to the grip circle, braking is at the top while apex is on the left or right. Unlike the opposing case, staying at the limit of grip while transitioning between maximal longitudinal grip and maximal lateral grip is possible.
&lt;/p&gt;
&lt;p&gt;
To do this, brakes are released gradually from corner entry -- freeing up longitudinal grip to be used for lateral grip. Once the apex is reached, the brakes are fully released and the car is able to accelerate out of the corner. This is called &lt;b&gt;trail braking&lt;/b&gt;. Trail braking creates a driving line with reducing turning radius due to the continuous braking and shift towards lateral grip.
&lt;/p&gt;&lt;p&gt;
In theory, a car can go from full braking to full turning with a quick steering input change without the gradual shift through trail braking. In reality, however, this will upset the balance of the car and cause the tires to slip and either understeer or oversteer. The reason for this is weight transfer.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;4. Manage weight (load) transfer&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
&lt;b&gt;Weight transfer&lt;/b&gt;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/six-steps-for-fast-lap-times/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; (or more accurately, &lt;i&gt;load transfer&lt;/i&gt;) is a phenomenon where the load on each wheel shifts through longitudinal or lateral acceleration. This matters because of &lt;b&gt;tire load sensitivity&lt;/b&gt;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/six-steps-for-fast-lap-times/#cite-4&quot; class=&quot;citation-link&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; where the maximum acceleration (Gs) that a tire can support will decrease with increasing load. Given this, it is ideal to have equal load against all 4 tires to maximize total available grip.
&lt;/p&gt;
&lt;p&gt;
Applying this knowledge, a rear-wheel drive car will have an advantage compared to a front-wheel drive car during acceleration as load shifts to the rear and the available grip increases. While turning, total available grip will decrease as the load shifts laterally assuming the car is roughly balanced left to right. This is not always true, however, with tracks like in Nascar where a car turns more in one direction than the other. In this case, it could make sense to bias the lateral weight distribution to achieve 50-50 load distribution during cornering.
&lt;/p&gt;
&lt;p&gt;
I had an epiphany after a race where I had an &lt;a href=&quot;https://youtu.be/F6_7QWdobKQ&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;exciting oversteer moment&lt;/a&gt; in our front-heavy Honda Civic with a generous application of trail braking. With the load shifting to the front under braking, the rear had less grip available, making the car prone to oversteering. While oversteering may look exciting, it is generally not the fastest way to go around a corner. Recall from high school physics class that static friction is higher than kinetic friction. Exceeding the static friction through erratic inputs will lead to a loss of grip. This is the basis for the racing maxim &amp;quot;Slow is smooth. Smooth is fast&amp;quot;. However, there is a grey zone in between called slip angle.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;5. Generate some slip angle (but not too much)&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
&lt;b&gt;Slip angle&lt;/b&gt;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/six-steps-for-fast-lap-times/#cite-5&quot; class=&quot;citation-link&quot;&gt;5&lt;/a&gt;&lt;/sup&gt; is the angle between where the wheel is pointing and where the car is actually travelling. This generates the lateral force required to turn the car. The slip angle and lateral force generated is linear at first, and then decreases in slope until it falls off. So not only is the grip circle more of a diamond, it is a function of load and slip angle.
&lt;/p&gt;
&lt;div class=&quot;w3-container w3-margin-bottom&quot;&gt;
&lt;small&gt;
&lt;img src=&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Tire_Sip_Angle.png/1200px-Tire_Sip_Angle.png&quot; alt=&quot;Tire Sip Angle.png&quot; style=&quot;width:50%&quot; /&gt;&lt;br /&gt;By Paradigm Shift Driver Development - Paradigm Shift Driver Development &lt;a href=&quot;http://www.paradigmshiftracing.com/&quot;&gt;www.paradigmshiftracing.com&lt;/a&gt;, &lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0&quot; title=&quot;Creative Commons Attribution-Share Alike 4.0&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;CC BY-SA 4.0&lt;/a&gt;, &lt;a href=&quot;https://commons.wikimedia.org/w/index.php?curid=51089565&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Link&lt;/a&gt;
&lt;/small&gt;
&lt;/div&gt;
&lt;p&gt;
Even among track-oriented tires, the characteristics exhibited can vary significantly. Some will have a very high peak grip but fall off faster; some will have a more gradual drop-off. Others peak at higher slip angles which requires more, shall we say, spirited driving. It is important to match these tire characteristics to the driving style to eke out every ounce of grip.
&lt;/p&gt;
&lt;p&gt;
With this knowledge, one might be tempted to maintain the slip angle required for peak grip at all times. There are some practical challenges with this however. For starters, only the front wheels turn in most cars&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/six-steps-for-fast-lap-times/#cite-6&quot; class=&quot;citation-link&quot;&gt;6&lt;/a&gt;&lt;/sup&gt; so it is difficult to achieve identical slip angle in both the front and rear tires. It is also not clear to me whether varying loads will impact the ideal slip angle like tire load sensitivity. Lastly, even if one manages to get a car in this state, it is mighty difficult to keep it there through braking, accelerating, and ever-changing environmental factors. To drive the perfect lap is mathematically impossible -- but how are the best drivers so consistent?
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;6. Listen to the car&#39;s feedback and minimize the impact of mistakes&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
The best drivers have an excellent mental model of what the perfect lap looks like. Their system 1 provide an accurate estimate of the available grip and their system 2 knows the exact braking and turn-in points. This allows them to closely follow the perfect line.
&lt;/p&gt;
&lt;p&gt;
Perhaps more important than driving the perfect line, the best drivers know what to do when they veer slightly off course. Even off the optimal line, there is a best way to drive to minimize the lap time. The rules of grip circle, weight transfer, and slip angle can be applied in any situation to work out the fastest way to get around the corner.
&lt;/p&gt;
&lt;p&gt;
The driver must judge whether he is driving above or below the maximal grip level by collecting data on both sides. Most drivers would be on the conservative side while driving on track. Just because I can afford to total my car, it does not mean I want to. Luckily, racing simulators can replicate driving physics quite accurately these days. With financial costs out of the equation, it is desirable to spend just as much time driving beyond the limit as below it.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
The best drivers can consistently push the car to its limit through a good mental model and adapt to changing environments quickly. They respect the laws of physics and use them to their advantage. Much like in life, driving is about having a plan but course correcting decisively when things inevitably go wrong.
&lt;/p&gt;
&lt;p&gt;
There are many lessons to be learned from racing. One concept that I would like to internalize in my life is spending as much time beyond the limit as below it. To understand where our own limits are, we need to go beyond it; and we may be surprised to find out what we are truly capable of.
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;The apex is the clipping point on the edge of the track where the car starts to accelerate&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;The racing line that maintains a constant turning radius&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;Weight transfer (n.d.). &lt;i&gt;Wikipedia&lt;/i&gt;. Retrieved from &lt;a href=&quot;https://en.wikipedia.org/wiki/Weight_transfer&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://en.wikipedia.org/wiki/Weight_transfer&lt;/a&gt; (accessed January 4, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-4&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;4.&lt;/span&gt; &lt;small&gt;Tire load sensitivity (n.d.). &lt;i&gt;Wikipedia&lt;/i&gt;. Retrieved from &lt;a href=&quot;https://en.wikipedia.org/wiki/Tire_load_sensitivity&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://en.wikipedia.org/wiki/Tire_load_sensitivity&lt;/a&gt; (accessed January 4, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-5&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;5.&lt;/span&gt; &lt;small&gt;Slip angle (n.d.). &lt;i&gt;Wikipedia&lt;/i&gt;. Retrieved from &lt;a href=&quot;https://en.wikipedia.org/wiki/Slip_angle&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://en.wikipedia.org/wiki/Slip_angle&lt;/a&gt; (accessed January 5, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-6&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;6.&lt;/span&gt; &lt;small&gt;A handful of cars have both front and rear-wheel steering but the ratio is nowhere close to 1:1. At lower speeds, they can even turn in the opposite direction to help the car rotate&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>The Brain Products Are Really Built For</title>
    <link href="https://jesungpark.com/blog/user-psychology-playbook/"/>
    <updated>2021-01-01T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/user-psychology-playbook/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Psychology fascinates me. A decent model of how the mind works helps when I am dealing with other people, but it is also useful for catching my own behaviours and idiosyncrasies. So when Product Faculty published their &lt;a href=&quot;https://www.productfaculty.com/playbook/user-psychology-understanding-the-brains-role&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;User Psychology Playbook for Product Managers&lt;/a&gt;, I read the whole thing. (For transparency: I took their Advanced Product Management course, paid for it with my own money, and I am a happy customer.)
&lt;/p&gt;
&lt;p&gt;
Here is the bit that stuck: A product manager will tell you they design for the user. What they really design for is a much older machine -- the brain that protects your ego, remembers the start and the end of things, and reaches for the easy question whenever the honest one is too much work. Most good product design is just a polite accommodation of that wiring. Most manipulation is the same wiring, nudged one notch too far.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- simulation --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Components of the old brain – self-centred&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
&lt;/p&gt;&lt;blockquote&gt;&lt;i&gt;
As far as the old brain&#39;s concerned, it&#39;s looking out for number one; it&#39;s all about you. Your old brain will ignore any messages that it sees as irrelevant.
&lt;br /&gt;-from User Psychology Playbook for Product Managers
&lt;/i&gt;&lt;/blockquote&gt;
In the age of social media and self-PR, it seems clear that people are only looking out for themselves. However, in our evolution-driven brain, the ego is certainly a priority but only insofar as making sure you survive long enough to pass on your DNA. In &lt;i&gt;The Selfish Gene&lt;/i&gt;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;, Richard Dawkins lays out the science behind why parents will jump into burning buildings to save their children. Humans and our genetic cousins such as chimpanzees (99% shared DNA) and bananas (~50%) are vessels for our genes to continue replicating. Not only that, studies suggest that there are at least as many bacteria in the human body as there are cells of their host&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;. Now, who is really in charge?
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
Another interesting aspect of our brain is our capacity for altruism. Jumping into the fire to save your child might make sense to ensure the survival of your DNA but what about the starving child across the globe? &lt;i&gt;The Selfish Gene&lt;/i&gt; argues that this wiring evolved from tribal times where any person you meet was likely to share your genes and reciprocate acts of generosity. Altruism, in essence, is a by-product of our evolutionary origins.
&lt;/p&gt;
&lt;p&gt;
That being said, Dawkins notes that understanding how the human brain is wired does not make acts of selfless bravery any less admirable or beautiful. The watchmaker who understands every component that goes into a watch can still marvel at their creation. In this case, our brains misfire in a way that is beneficial to humanity as a whole. In not so good cases, humans have been imbued with a capacity to rise above our genetic wirings but we often succumb to their whims.
&lt;/p&gt;
&lt;p&gt;
This is the brain a product has to win over -- the one that screens out anything it decides is irrelevant to its own survival and standing. The playbook treats that as a targeting problem, where the job is to earn the old brain&#39;s attention. I read it as a responsibility problem. Designing around someone&#39;s self-interest is fair game, and honestly unavoidable. The question I keep coming back to is whether you are serving the person who carries that brain around, or just farming the parts of them that do not know they are being played.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Components of the old brain – first and last&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
&lt;/p&gt;&lt;blockquote&gt;&lt;i&gt;
When given a long list of items to remember, people are more likely to remember the first item (the primacy effect) and the last item (the recency effect).
&lt;/i&gt;&lt;/blockquote&gt;
Primacy and recency effects have been well established in recall of lists. However, I would argue that one&#39;s opinion of a product is not a test of recalling a list of features but your experience of using these features. Garbinsky (2014)&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; found that in a hedonic situation involving gluttony (chips - my worst enemy, only rivalled by ice cream), people tended to remember the end better than the first due to an effect called &lt;b&gt;memory interference&lt;/b&gt;. For example, multilingual people experience situations where you cannot recall a word that you know in another language. This effect also occurs in short-term memory. For this reason, recency effect has a stronger impact than primacy effect.
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
In 1993, Kahneman et al.&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/#cite-4&quot; class=&quot;citation-link&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; found that test subjects preferred to submerge their hand in 14 °C water for 60 seconds with the temperature gradually raised to 15 °C compared to 30 seconds at 14 °C water. Clearly, the cumulative discomfort experienced over 60 seconds is greater than 30 seconds but duration does not seem to be a big factor compared to how the experience ended. The preference for ending at 15 °C over 14 °C is the &lt;b&gt;recency effect&lt;/b&gt; in the quote above. I once self-administered the cold pressor test (a fancy name for dunking one&#39;s hand in ice water) with water temperature at 4 °C and held for the maximum of 4 minutes as per MacLachlan et al. 2016&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/#cite-5&quot; class=&quot;citation-link&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;. I suspect my unusually fond recollection of that event is partially attributable to the fact that the water temperature rose by roughly 1 °C over the duration of the test.
&lt;/p&gt;
&lt;p&gt;
Finally, Varey &amp;amp; Kahneman (1992)&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/#cite-6&quot; class=&quot;citation-link&quot;&gt;6&lt;/a&gt;&lt;/sup&gt; experimentally demonstrated retrospective evaluations of films being well-predicted by a weighted average of the &lt;b&gt;peak and final evaluations&lt;/b&gt;. This effect has been confirmed by another study (Redelmier &amp;amp; Kahneman, 1996)&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/#cite-7&quot; class=&quot;citation-link&quot;&gt;7&lt;/a&gt;&lt;/sup&gt; involving colonoscopy patients. More recently, a study (Do, et al., 2008)&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/#cite-8&quot; class=&quot;citation-link&quot;&gt;8&lt;/a&gt;&lt;/sup&gt; applied this theory to the evaluation of material goods and found similar results. For a product to be remembered positively, focus on the peak and final experiences. That being said, for itemized segments within the product like SKU recommendations, the primacy effect can come into play.
&lt;/p&gt;
&lt;p&gt;
Stated as a tactic, that is harmless enough. Taken to heart, it is a quiet licence to engineer the memory instead of the experience. Stage one bright peak, stick the landing, and someone walks away remembering your product as better than the average minute of using it ever was. I have done a version of this to myself -- I remember that 4 °C ice bath fondly, and I am fairly sure the only reason is that the water crept up a degree before I pulled my hand out. The same trick can paper over a mediocre core, or send someone off feeling good about a decision that was bad for them. Craft or manipulation? It comes down to one question -- was the peak real, or just well-placed?
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Facts and figures&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
&lt;/p&gt;&lt;blockquote&gt;&lt;i&gt;
What numbers can you use to back up your claims? Amazon [...] know[s] that if we can see lots of other people have enjoyed a product, we&#39;ll be more likely to purchase it too.
&lt;/i&gt;&lt;/blockquote&gt;
When making decisions on purchases, humans do not evaluate a product or service holistically but substitute this cognitively intensive task with an easier one. Kahneman discussed this &lt;b&gt;substitution bias&lt;/b&gt; in his book Thinking, Fast and Slow&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/user-psychology-playbook/#cite-9&quot; class=&quot;citation-link&quot;&gt;9&lt;/a&gt;&lt;/sup&gt;. A sports car offers horse power, torque, 50-50 weight distribution, and a quick 0-60 time as substitute questions for the more difficult question of whether or not the car is right for you.
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
In his book, Kahneman gave an example of a stock trader who purchased Ford stocks because he liked their cars. Unfortunately, how much one likes a car is not the same question as how well-priced the company stock is. For what is often people&#39;s second biggest single-item expense, car purchases tend to be laden with emotion.
&lt;/p&gt;
&lt;p&gt;
Social proof runs on the same shortcut. &amp;quot;Look how many people bought this&amp;quot; quietly answers the easy question -- do other people approve? -- and stands in for the hard one you actually care about, which is whether the thing is right for you. That swap is the exact gap that fake reviews, padded star ratings, and &amp;quot;only 2 left in stock!&amp;quot; wedge themselves into. The mechanism itself is neutral. What is not neutral is the person who decides which question the screen nudges you toward, because they are also deciding whether the shortcut helps you or picks your pocket.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Emotional friction&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
&lt;/p&gt;&lt;blockquote&gt;&lt;i&gt;
Tinder revolutionized online dating by reducing the emotional friction involved. Rather than having to pour their hearts out in a message to a stranger, only to be ignored or rejected, now people just had to swipe right
&lt;/i&gt;&lt;/blockquote&gt;
Tinder took the dating world by storm by reducing the emotional cost of potential rejections to a swipe-and-forget process. The matching process is also random to the user, akin to a slot machine. Minimal emotional cost and randomness of matching led to a $18.6 B market cap of Match Group, the parent company of Tinder and other major dating platforms. Ironically, the long-term and prevalent use of these dating apps can affect the matrimonial zeitgeist for the worse.
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
1.6 billion swipes a day world-wide turns dating into a numbers game. Pull the slot machine lever enough times, and you are mathematically guaranteed to hit the jackpot. However, there are some downsides to chronic gambling. Reduced emotional cost has the consequence of devaluing individual relationships where people run at the first sight of trouble, on to their next match. Over time, this can lead to a decline in successful long-term relationships.
&lt;/p&gt;
&lt;p&gt;
A danger of building massively successful products is the &lt;a href=&quot;https://en.wikipedia.org/wiki/There_are_known_knowns&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;unknown unknowns&lt;/a&gt;. Products that took advantage of the brain&#39;s neural circuitry is changing the circuitry itself. Unfortunately, companies driven by the profit motive are not necessarily looking out for their users&#39; best interests. It is unlikely that companies like Facebook or Twitter had foreseen all the ways that their product would be used today. And even the parts that were predictable to them, users&#39; interests were put on the back burner chasing OKR. It is in our best interests then, as users, to be informed and prioritize our well-being. Products have limitless potential to add value to a person&#39;s life but you should always be its master, not its slave.
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;Dawkins, R. (1989). &lt;i&gt;The Selfish Gene&lt;/i&gt;. Oxford University Press&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;Sender R, Fuchs S, Milo R. (2016). Revised Estimates for the Number of Human and Bacteria Cells in the Body. &lt;i&gt;PLoS Biol.&lt;/i&gt; Retrieved from &lt;a href=&quot;https://doi.org/10.1371/journal.pbio.1002533&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://doi.org/10.1371/journal.pbio.1002533&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;Garbinsky, Emily N. et al. (2014). Interference of the End. &lt;i&gt;Psychological Science 25&lt;/i&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-4&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;4.&lt;/span&gt; &lt;small&gt;Kahneman, Daniel, et al. (1993). When More Pain Is Preferred to Less: Adding a Better End. &lt;i&gt;Psychological Science, vol. 4, no. 6&lt;/i&gt; Retrieved from &lt;a href=&quot;https://doi.org/10.1111/j.1467-9280.1993.tb00589.x&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://doi.org/10.1111/j.1467-9280.1993.tb00589.x&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-5&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;5.&lt;/span&gt; &lt;small&gt;MacLachlan, Cameron et al. (2016). The Cold Pressor Test as a Predictor of Prolonged Postoperative Pain, a Prospective Cohort Study. &lt;i&gt;Pain and therapy vol. 5,2&lt;/i&gt; Retrieved from &lt;a href=&quot;https://doi.org/10.1007/s40122-016-0056-z&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://doi.org/10.1007/s40122-016-0056-z&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-6&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;6.&lt;/span&gt; &lt;small&gt;Varey, C., &amp; Kahneman, D. (1992). Experiences extended across time: Evaluation of moments and episodes. &lt;i&gt;Journal of Behavioral Decision Making, 5&lt;/i&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-7&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;7.&lt;/span&gt; &lt;small&gt;Redelmeier, D. A., &amp; Kahneman, D. (1996). Patients&#39; memories of painful medical treatments: Real-time and retrospective evaluations of two minimally invasive procedures. &lt;i&gt;Pain, 66(1)&lt;/i&gt; Retrieved from &lt;a href=&quot;https://doi.org/10.1016/0304-3959(96)02994-6&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://doi.org/10.1016/0304-3959(96)02994-6&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-8&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;8.&lt;/span&gt; &lt;small&gt;Do, A.M., Rupert, A.V. &amp; Wolford, G. (2008). Evaluations of pleasurable experiences: The peak-end rule. &lt;i&gt;Psychonomic Bulletin &amp; Review 15&lt;/i&gt; Retrieved from &lt;a href=&quot;https://doi.org/10.3758/PBR.15.1.96&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://doi.org/10.3758/PBR.15.1.96&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-9&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;9.&lt;/span&gt; &lt;small&gt;Kahneman, D. (2011). &lt;i&gt;Thinking, fast and slow&lt;/i&gt;. Farrar, Straus and Giroux&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>Spaced repetition – how to create lasting memory</title>
    <link href="https://jesungpark.com/blog/spaced-repetition/"/>
    <updated>2020-12-21T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/spaced-repetition/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
If you ever tried to learn a new language, building up sufficient vocabulary to have basic conversations is one of the biggest hurdles. You can memorize basic sentences but will not know what to say when the conversation goes off script. Even more challenging, what the heck is the other person saying? I have ended many a conversation with 我不知道 (I don&#39;t know) or 我不明白你说什么 (I don&#39;t understand what you&#39;re saying) because my Mandarin Chinese vocabulary is so limited.
&lt;/p&gt;
&lt;p&gt;
Given the huge amount of time required to study languages, what is the most efficient way to memorize and recall a long list of facts? The answer is &lt;b&gt;spaced repetition&lt;/b&gt;. Spaced repetition is a technique where the &lt;u&gt;time intervals between active recall get increasingly longer&lt;/u&gt; as your memory strengthens. This technique applies to broader topics such as studying for exams, quotes you want to remember&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;, and even learning coding languages as long as the information can be broken down into bite-sized chunks. For reasons that I will not dive into here, &lt;b&gt;active recall&lt;/b&gt; is more effective at strengthening memory compared to passive review.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- simulation --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Ebbinghaus&#39; forgetting curve&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
The foundation of spaced repetition is often attributed to the German psychologist Hermann Ebbinghaus&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;, who ran a N=1 study on himself in the 1880s to remember nonsense syllables. Focusing on nonsense consonant-vowel-consonant syllables such as KOJ and YAT instead of words people can reference such as DOT or LAW was Ebbinghaus&#39; attempt at removing any existing knowledge of language from the equation. This led to him publishing the forgetting curve&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; in 1885 which is simplified in a recent paper (Reddy et al., 2016)&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-4&quot; class=&quot;citation-link&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;. The formula is fairly simple:
&#92;[P[ &#92;textrm{recall} ] = &#92;exp (-&#92;theta &#92;cdot &#92;frac{d}{s})&#92;]
where &#92;(&#92;theta &#92;in &#92;mathbb{R}^+ &#92;) is the item difficulty, &#92;(d &#92;in &#92;mathbb{R}^+ &#92;) is the delay or time elapsed since previous review, and &#92;(s &#92;in &#92;mathbb{R}^+ &#92;) is the memory strength.
&lt;/p&gt;
&lt;div class=&quot;w3-container w3-margin-bottom&quot;&gt;
&lt;small&gt;
&lt;img src=&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/ForgettingCurve.svg/1200px-ForgettingCurve.svg.png&quot; alt=&quot;ForgettingCurve.svg&quot; style=&quot;width:50%&quot; /&gt;&lt;br /&gt;By &lt;a href=&quot;https://en.wikipedia.org/wiki/User:Icez&quot; class=&quot;extiw&quot; title=&quot;wikipedia:User:Icez&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Icez&lt;/a&gt; at &lt;a href=&quot;https://en.wikipedia.org/wiki/&quot; class=&quot;extiw&quot; title=&quot;wikipedia:&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;English Wikipedia&lt;/a&gt;. - Originally from &lt;a class=&quot;external text&quot; href=&quot;https://en.wikipedia.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;en.wikipedia&lt;/a&gt;; description page is/was
&lt;a class=&quot;external text&quot; href=&quot;https://en.wikipedia.org/w/index.php?title=Image:ForgettingCurve.svg&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;here&lt;/a&gt;., Public Domain, &lt;a href=&quot;https://commons.wikimedia.org/w/index.php?curid=2214107&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Link&lt;/a&gt;
&lt;/small&gt;
&lt;/div&gt;
&lt;p&gt;
As you can see above, the curve has an exponential decay and will shift depending on item difficulty, time since last review, and memory strength. If the item was just learned (&#92;(d=0&#92;)), then &#92;(P[&#92;mathrm{recall}] = 1&#92;). On the other hand, if the item was learned a long time ago, then &#92;(P[&#92;mathrm{recall}]&#92;) will approach 0.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Leitner system&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Fast forward nearly a century, the German science journalist Sebastian Leitner proposed a method based on spaced repetition in his book &lt;i&gt;So lernt man Lernen&lt;/i&gt; (How to learn to learn) in 1972&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-5&quot; class=&quot;citation-link&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;. This method uses 5 boxes of increasing size (1, 2, 5, 8 and 14 cm) where the flashcards within each box were reviewed only if it was full. During review, correctly answered cards will graduate to the next box while incorrectly answered cards will go back to the first box.
&lt;/p&gt;
&lt;div class=&quot;w3-container w3-margin-bottom&quot;&gt;
&lt;small&gt;
&lt;img src=&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Leitner_system_alternative.svg/1200px-Leitner_system_alternative.svg.png&quot; alt=&quot;Leitner system alternative.svg&quot; style=&quot;width:50%&quot; /&gt;&lt;br /&gt;By &lt;a href=&quot;https://commons.wikimedia.org/wiki/User:Zirguezi&quot; title=&quot;User:Zirguezi&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Zirguezi&lt;/a&gt; - &lt;span class=&quot;int-own-work&quot; lang=&quot;en&quot;&gt;Own work&lt;/span&gt;, &lt;a href=&quot;http://creativecommons.org/publicdomain/zero/1.0/deed.en&quot; title=&quot;Creative Commons Zero, Public Domain Dedication&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;CC0&lt;/a&gt;, &lt;a href=&quot;https://commons.wikimedia.org/w/index.php?curid=20328125&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Link&lt;/a&gt;
&lt;/small&gt;
&lt;/div&gt;
&lt;p&gt;
This system ensures that the more difficult flashcards are reviewed more frequently which results in efficient time use. However, it may take a long time to fill up the last box at which point the first card in the box may be significantly older than the last card. How can you space out the reviews at an individual card level to take advantage of the &lt;b&gt;optimal repetition spacing&lt;/b&gt;?
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;SuperMemo&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
In 1985, Polish researcher Piotr Wozniak developed the first iteration of the SuperMemo algorithm SM-0 that loosely followed Leitner&#39;s methods&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-6&quot; class=&quot;citation-link&quot;&gt;6&lt;/a&gt;&lt;/sup&gt;. By 1987, this evolved into SM-2 - a computer algorithm at the individual card level with the following interval algorithm&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-7&quot; class=&quot;citation-link&quot;&gt;7&lt;/a&gt;&lt;/sup&gt;.
&lt;/p&gt;
&lt;p&gt;
&#92;[ I(1) &#92;rightarrow 1 &#92;]
&#92;[ I(2) &#92;rightarrow 6 &#92;]
&#92;(I(n) &#92;rightarrow I(n-1) &#92;cdot &#92;textrm{EF} &#92;) for &#92;( n&amp;gt;2 &#92;)
&lt;br /&gt;where &#92;( I(n) &#92;) is the inter-repetition interval after the &#92;( n &#92;)-th repetition
&lt;br /&gt;and &#92;( &#92;textrm{EF} &#92;) is the easiness factor reflecting the easiness of memorizing and retaining a given item in memory.
&lt;/p&gt;&lt;p&gt;
While the latest version of the SuperMemo algorithm is up to SM-18, a variant of SM-2 is still used in the popular open-source flashcard program Anki. These algorithms may be crude but there is no disputing the success people have had with spaced repetition software. Spaced repetition is the backbone of many language acquisition programs such as Pimsleur and Duolingo.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Challenges&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Tools like SuperMemo and Anki are a significant step up from the traditional methods but they are heuristic based approaches that use hand-picked weights. Looking back to the evolution of various disciplines within machine learning (e.g. natural language processing, computer vision), they started with a lot of structures and assumptions, including hand-picked features. As computing power, available data, and our understanding of these disciplines improved, the models got rid of more assumptions.&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-8&quot; class=&quot;citation-link&quot;&gt;8&lt;/a&gt;&lt;/sup&gt;
&lt;/p&gt;
&lt;p&gt;
With the massive amount of data that are being collected by spaced repetition software and technological progress since the 80s, leveraging machine learning approaches for optimizing to the best policy starts make sense. We explore two different ML-based approaches: half-life regression and Leitner queue network.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Half-life regression&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Settles et al. (2016)&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-9&quot; class=&quot;citation-link&quot;&gt;9&lt;/a&gt;&lt;/sup&gt; goes back to basics with Ebbinghaus&#39; forgetting curve.
&#92;[ p = 2 ^{-&#92;Delta/h} &#92;]
In this equation, &#92;( p &#92;) denotes the probability of correctly recalling an item which is a function of &#92;( &#92;Delta &#92;), the &lt;i&gt;lag time&lt;/i&gt; since the item was last practised, and &#92;( h &#92;) is the &lt;i&gt;half-life&lt;/i&gt; or measure of strength in the learner&#39;s long-term memory
&lt;/p&gt;
&lt;p&gt;
We can then estimate the half-life with
&#92;( &#92;hat{h}_&#92;Theta = 2^{&#92;Theta &#92;cdot x} &#92;)
where &#92;( x &#92;) is the student&#39;s feature vector and &#92;( &#92;Theta &#92;) is the set of weights that correspond to the features.
&lt;br /&gt;Features broadly fell into two categories:
&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;Interaction features that count the student&#39;s history with a certain word&lt;/li&gt;
&lt;li&gt;Lexeme tag features which is a sparse matrix of roughly twenty thousand lexeme tags to capture the inherent difficulty of the word&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
The model then predicts &#92;( &#92;hat{p}_&#92;Theta = 2^{- &#92;Delta / &#92;hat{h}_{&#92;Theta}} &#92;) with loss function &#92;( &#92;ell (X; &#92;Theta) = (p - &#92;hat{p}_&#92;Theta)^2 + &#92;alpha (h - &#92;hat{h}_&#92;Theta)^2 + &#92;lambda &#92;| &#92;Theta &#92;|^2_2 &#92;)
where &#92;( X = &#92;langle p, &#92;Delta, x &#92;rangle &#92;) and &#92;( &#92;lambda &#92;) is the regularization term.
&lt;/p&gt;
&lt;p&gt;
Results of the model was positive with the half-life (HLR) model significantly improving upon the mean absolute error (MAE) and getting very close in the area under the curve (AUC) compared to the baseline. The authors observed &lt;b&gt;two insights&lt;/b&gt;:
&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;Including the lexeme tag features did not make a significant difference to the results&lt;/li&gt;
&lt;li&gt;Optimizing for the half-life (&#92;( &#92;hat{h} &#92;)) is clearly important to the model&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
When the model was implemented into the production system of Duolingo where Settles worked, they found that the lexeme tag features were possibly overfitting for difficult words. To skirt around this as well as the &lt;a href=&quot;https://en.wikipedia.org/wiki/Cold_start_(recommender_systems)&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;cold-start problem&lt;/a&gt;, Duolingo removed the lexeme tag features and saw statistically significant improvement in retention metrics over the original Leitner system.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Leitner queue network&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
In Reddy et al. (2016) on the other hand, the Leitner system is taken to the next level. For deck &#92;( k &#92;) at time &#92;( t &#92;), let &#92;( D_k=t-T_{k,1} &#92;) denote the delay since the last review of that item. Then we have the transition probability
&#92;[P [k &#92;rightarrow k + 1] = &#92;exp{ (- &#92;theta &#92;cdot D_k / k) } &#92;]
&#92;[P [k &#92;rightarrow &#92;max &#92;{k - 1, 1 &#92;}] = 1 - &#92;exp{(- &#92;theta &#92;cdot D_k / k)} &#92;]
Note that the term &#92;(&#92;theta &#92;cdot D_k / k &#92;) is equivalent to &#92;( &#92;Delta / h &#92;) in half-life regression. They both describe how quickly the probability of recall degrades over time.
&lt;/p&gt;
&lt;p&gt;
We can then define the problem as finding the scheduling policy that maximizes the learning rate
&#92;[ &#92;lambda_{&#92;textrm{out}} = &#92;lim_{T&#92;to&#92;infty} &#92;frac{1}{T} &#92;cdot |  &#92;{ &#92;textrm{Items mastered in interval [0,T]} &#92;} | &#92;]
given a static arrival rate &#92;( &#92;lambda_{&#92;textrm{ext}} &#92;) that follows a Poisson distribution, a service rate &#92;( &#92;mu_k &#92;) representing the rate at which items from deck &#92;( k &#92;) come up for review, and the user&#39;s review frequency constraint &#92;( &#92;lambda_{&#92;textrm{ext}} + &#92;sum_k &#92;mu_k &#92;le U &#92;).
&lt;/p&gt;
&lt;p&gt;
From both the theory as well the experiments, a few interesting observations emerge:
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;Given a fixed review frequency budget &#92;( U &#92;), there is a phase transition in learning where your throughput (&#92;( &#92;lambda_{&#92;mathrm{out}} &#92;)) initially increases fairly linearly with arrival rate (&#92;( &#92;lambda_{&#92;mathrm{ext}} &#92;)) but starts to nose-dive as the arrival rate overwhelms the review frequency budget. As such, there is an optimal arrival rate for ever throughput.&lt;/li&gt;
&lt;li&gt;As a corollary, as your review frequency budget increases, your optimal arrival rate will increase fairly linearly.&lt;/li&gt;
&lt;li&gt;Item difficulty has a big impact on optimal review schedules. The more difficult the material, you should introduce new material less often and spend more time on newer material.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
These newer algorithms are certainly an improvement over their 3-4 decade-old parents but not without challenges. In half-life regression, the measured probability of recall is at the session level. This drops the temporal aspect (forgetting at the beginning is better than forgetting at the end) and the magnitude (getting 1/1 vs. 10/10) which are arguably useful information to bake in. On the other hand, Leitner queue network uses approximate methods to make the problem tractable which may impact accuracy and the FIFO structure does not allow for cards to reshuffle within a deck or move between decks without review.
&lt;/p&gt;
&lt;p&gt;
Despite their challenges, any version of these spaced repetition algorithms is a significant step up from the other approaches such as random review or focusing on recent cards&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/spaced-repetition/#cite-10&quot; class=&quot;citation-link&quot;&gt;10&lt;/a&gt;&lt;/sup&gt;. That being said, these approaches make you more efficient with your time but they are not a substitute for hard work. You need to put in the effort and create habits to make the effort sustainable. Following the theme of quotes I want to remember, I will end with this:
&lt;/p&gt;&lt;blockquote&gt;&lt;i&gt;Nothing in the world is worth having or worth doing unless it means effort, pain, difficulty… I have never in my life envied a human being who led an easy life. I have envied a great many people who led difficult lives and led them well.
&lt;br /&gt;-Theodore Roosevelt&lt;/i&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;Oscar Wilde (n.d.). Imitation is the sincerest form of flattery that mediocrity can pay to greatness. &lt;i&gt;Goodreads&lt;/i&gt;. Retrieved from &lt;a href=&quot;https://www.goodreads.com/quotes/558084-imitation-is-the-sincerest-form-of-flattery-that-mediocrity-can&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.goodreads.com/quotes/558084-imitation-is-the-sincerest-form-of-flattery-that-mediocrity-can&lt;/a&gt;. I recently learned the full quote of Oscar Wilde&#39;s oft-quoted &quot;Imitation is the sincerest form of flattery&quot;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;Hermann Ebbinghaus (n.d.). &lt;i&gt;Wikipedia&lt;/i&gt;. Retrieved from &lt;a href=&quot;https://en.wikipedia.org/wiki/Hermann_Ebbinghaus&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://en.wikipedia.org/wiki/Hermann_Ebbinghaus&lt;/a&gt; (accessed December 16, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;Forgetting curve (n.d.). &lt;i&gt;Wikipedia&lt;/i&gt;. Retrieved from &lt;a href=&quot;https://en.wikipedia.org/wiki/Forgetting_curve&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://en.wikipedia.org/wiki/Forgetting_curve&lt;/a&gt; (accessed December 16, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-4&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;4.&lt;/span&gt; &lt;small&gt;Reddy, S. et al. (2016). Unbounded Human Learning: Optimal Scheduling for Spaced Repetition Retrieved from &lt;a href=&quot;https://dl.acm.org/doi/pdf/10.1145/2939672.2939850&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://dl.acm.org/doi/pdf/10.1145/2939672.2939850&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-5&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;5.&lt;/span&gt; &lt;small&gt;Leitner, S. (1972). &lt;i&gt;So lernt man lernen&lt;/i&gt;. Herder&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-6&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;6.&lt;/span&gt; &lt;small&gt;Wozniak, P. (1990). SuperMemo Algorithm - Beginning. Retrieved from &lt;a href=&quot;https://www.supermemo.com/en/archives1990-2015/english/ol/beginning#Algorithm&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.supermemo.com/en/archives1990-2015/english/ol/beginning#Algorithm&lt;/a&gt; (accessed December 17, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-7&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;7.&lt;/span&gt; &lt;small&gt;Wozniak, P. (1990). SuperMemo SM-2 Algorithm. Retrieved from &lt;a href=&quot;https://www.supermemo.com/en/archives1990-2015/english/ol/sm2&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.supermemo.com/en/archives1990-2015/english/ol/sm2&lt;/a&gt; (accessed December 18, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-8&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;8.&lt;/span&gt; &lt;small&gt;For a more recent example, look at the various iterations of AlphaGo. It first learned from human games, then learned to play from scratch (AlphaZero), then learned without even knowing the rules of the game (MuZero) - with each version surpassing its predecessor&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-9&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;9.&lt;/span&gt; &lt;small&gt;Settles, B., Meeder, B. (2016). A Trainable Spaced Repetition Model for Language Learning Retrieved from &lt;a href=&quot;https://www.aclweb.org/anthology/P16-1174.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.aclweb.org/anthology/P16-1174.pdf&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-10&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;10.&lt;/span&gt; &lt;small&gt;AndrewFMs (2011). Simulation of SRS vs. Traditional Review [Video]. YouTube Retrieved from &lt;a href=&quot;https://www.youtube.com/watch?v=ai2K3qHpC7c&amp;ab_channel=AndrewFMs&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.youtube.com/watch?v=ai2K3qHpC7c&amp;ab_channel=AndrewFMs&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>The hidden costs of adding features</title>
    <link href="https://jesungpark.com/blog/feature-cost/"/>
    <updated>2020-12-10T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/feature-cost/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
&amp;quot;This is awesome Jesung, but can you just add…&amp;quot;. I had built out an automated dashboard of campaign performance and was getting buy-in from our marketing partners to use it to track their campaign results. The marketers were excited to have access to this data next-day since the previous process involved manual work and took longer. However, they would often bring up one campaign metric that is currently reported to the senior leaders of the company but not currently in the report.
&lt;/p&gt;
&lt;p&gt;
I diligently added new metrics and tabs over the following weeks and months. However, I began to run into issues such as the data pull crashing or slow response times on the dashboard. I had not accounted for the both the rows and columns of data to balloon and was paying the price. What should I have looked at before jumping into building new features?
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- simulation --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Opportunity cost&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
An obvious comparison to make is other things that could be done in that time. There are other features to be added or new products to be built. For bigger projects, the finance team can help to calculate a return on investment (ROI) value and see if it exceeds the internal rate of return (IRR). This will help the company allocate capital by comparing ROI across multiple possible projects.
&lt;/p&gt;
&lt;p&gt;
At smaller scales, it is possible to plot a value vs. effort grid to see where the various options land. The higher the value at the same or lower effort, the most attractive a project/feature is. Instead of adding 60- or 90-day churn metrics from the existing 30, I could have added revenue lift or worked on a different dashboard. If it is difficult to put a financial value to a feature, you could look at the number of clients asking for it and how they would prioritize.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Support and maintenance costs&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
A cost that is not immediately obvious is the ongoing support and maintenance costs. For my dashboard, adding more data points required more processing on the database side. Adding more tabs to a visualization increased the load on your visualization server. Adding more features also meant having more features that can potentially break. A small change in the source tables could mean days of trying to debug numerous lines of SQL code. Keep in mind that support/maintenance is not optional in many cases – you cannot let your product stay broken. As the support time continues to jump, you will have less time to develop your product. Before you know it, the heat will add up and you will realize that you are the frog, not the chef.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Technical debt&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
A particular support cost for products is technical debt. Technical debt is defined as the implied cost when making decisions to expedite delivery rather than build robust solutions, requiring refactoring down the line. Ward Cunningham – one of the authors of the agile manifesto – coined the term and likened it to borrowing money and paying interest on it&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/feature-cost/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. You can accelerate delivery through borrowing but eventually you will just be paying interest rather than making any useful progress on the principal.
&lt;/p&gt;
&lt;p&gt;
It seems like technical debt is the plague and everyone should avoid it. However, it can be used strategically to meet deadlines or verify assumptions. Every feature or project should account for the technical debt that will be accrued as a consequence of implementing it. Whether you choose to pay it off now or later should be a conscious decision, not a surprise credit card bill you find years later.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Strategic alignment&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Focusing on high ROI opportunities and accounting for technical debt without strategy is like sailing a speedboat efficiently without a map. You could be headed in a totally wrong direction and would not know it. Good strategy will focus on a few efforts that have been narrowed down from a long list of good ideas. That is easier said than done – with so many directions to go, it is easy to be led astray.
&lt;/p&gt;
&lt;p&gt;
One temptation for a product team is to be a market follower – implement the features that your top competitors have or the features that your customers ask for the most. This could be driven by the fear of missing out or lack of clarity in your vision. The problem with a homogenous market is that it is difficult for your product to stand out in a sea of similar commodities (you can only compete on price or service) and that the market will be ripe for disruption. If the market does not address a wide range of needs, it provides room for start-ups to take up unaddressed niches. The key, then, is differentiation.
&lt;/p&gt;
&lt;p&gt;
A useful tool when deciding on product strategy is the Blue Ocean strategy canvas, introduced in the book &lt;i&gt;Blue Ocean Strategy&lt;/i&gt;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/feature-cost/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;. You start off by listing off various industry factors and the baseline score of your main competitors. Then you distort the factors and plot out the canvas of the baseline score vs. your product&#39;s score. The important takeaway here is understanding not only what your product will be good at, but also understanding what you choose to be bad at.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
There are many hidden dangers of adding features. I have certainly lost time and effort by not accounting for them. However, that does not mean you should never add new features. Much like taking on debt to buy a house, you can take calculated risks and pay back the debt later. You also need a strategy to tell you which type of house to buy in which area.  Plan for increasing infrastructure capacity and support hours accordingly. Plan to address technical debt. Plan what the product will be good at and bad at. Ignoring these dangers can lead you to a shock bill years later or the realization that you are on the wrong planet.
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;Ward Cunningham (2009). Debt Metaphor [Video]. YouTube Retrieved from &lt;a href=&quot;http://www.youtube.com/watch?v=pqeJFYwnkjE&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;http://www.youtube.com/watch?v=pqeJFYwnkjE&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;Kim, W. C., &amp; Mauborgne, R. (2005). &lt;i&gt;Blue ocean strategy: How to create uncontested market space and make the competition irrelevant&lt;/i&gt;. Harvard Business School Press&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>Why so blue?</title>
    <link href="https://jesungpark.com/blog/blue/"/>
    <updated>2020-12-07T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/blue/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Think back to your last video conference. How many people looked unnatural or had weird lighting? With everyone in various circumstances at their home, there is a large variation of video quality. One common feature is the bluish tinge on people&#39;s faces. Without a sufficiently strong alternative light source, the light from your computer screen will make you look a little blue.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- simulation --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Science of colour&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Let&#39;s examine how we see colour. Light from a source (newsflash - you cannot see in the dark) will hit an object and excite its electrons. These electrons can give off light, reflect it, or convert it to heat by knocking into an adjacent atom&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/blue/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. Depending on the atomic and molecular structure of the object, different wavelengths will get absorbed by the object. An apple will look red because its skin absorbs all frequencies of visible light except red. Light can also scatter within a material. If you shine a flashlight through your fingertip, it will look red because the blue lights tend to scatter more than red in your skin and fat tissues.
&lt;/p&gt;
&lt;p&gt;
But your face is normally not blue (if it is, stop reading this and call a doctor). How is it reflecting the blue light from the screen? Looking at the RGB value of your skin in a picture, you will find that it is actually a combination of red, green, and blue – the red and green only have slightly higher values. Given the increased light from the source of shorter, blue wavelengths, the webcam will pick up more blue and reflect that in the video.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;How to look human&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
So how can we avoid looking like our face is severely lacking oxygen&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/blue/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;? One simple fix would be to use software like Windows&#39; night light or f.lux to increase the red hue of your screen. A better solution would be to find a warm, diffused source of light and place it in front of you. A warm light source will complement the blue-heavy light from your monitors to get closer to your natural skin tone. If you have an old lamp lying around, placing a piece of paper as diffusion material can work quite well. As a bonus, having more light will improve your webcam quality as more photons will end up on the sensor, making it less grainy. The reason why low light videos and photographs tend to look grainy is that the sensitivity of the sensors or film need to increase to compensate for reduced light which increases noise.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Looking up&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
One thing you may see when buying light bulbs is its colour temperature&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/blue/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;. It is denoted in Kelvin (K) and lights can be seen in warmer (2500~3000 K; incandescent) or cooler (5000+ K; fluorescent) temperatures. For the record, LCD screens are around 6500-9500 K. If you are confused because Kelvin – like Celsius or Fahrenheit – is a measurement of temperature and lower Kelvin is &amp;quot;warmer&amp;quot; light, then you are in good company.
&lt;/p&gt;
&lt;p&gt;
Colour temperature is determined by the temperature of an ideal black-body radiator&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/blue/#cite-4&quot; class=&quot;citation-link&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; that is emitting that colour. A black body is an ideal object that absorbs all electromagnetic radiation and emits black-body radiation at a range of electromagnetic spectrum determined by only its temperature – think blacksmith working on glowing hot metal. Stars approximate a black-body radiator which gives us a convenient way to measure their temperature. Doing the math, our Sun&#39;s effective temperature is approximately 5780 K.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Missing spots&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Now we know how hot the Sun is but how do we know what it&#39;s made of? In 1868, astronomers found a yellow line in the Sun&#39;s spectrum while studying a solar eclipse. Looking at the wavelength of the light, they realized it could not be produced by an element known at the time. They named it helium, after Helios, the Greek god of the Sun. Helium was the first element to be found outside Earth. Besides making your voice sound funny and balloons float, helium is the second most abundant element in the universe next to hydrogen and is chemically inert.
&lt;/p&gt;
&lt;p&gt;
Today, astrophysicists study the night sky with powerful telescopes and look at the observed electromagnetic emission. Looking at any spikes or dips can provide information about the light source or perhaps what is in between us and the light. As mentioned, helium glows in the yellow range while mercury glows blue when excited. Elements also absorb a certain range of the electromagnetic spectrum. Different elements will absorb a different range, leading to a cosmic fingerprint of each star&#39;s composition. The Sun&#39;s spectrum has been studied in detail&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/blue/#cite-5&quot; class=&quot;citation-link&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;, which provides information about its chemical make-up. This allows astrophysicists to estimate its origins and remaining life span. Luckily, you and I will be long dead before the Sun&#39;s nuclear fusion process runs out of steam, both literally and figuratively. It would be rather unpleasant to witness the Sun swell into a red giant and vaporize the Earth.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
If this kind of science excites you, Neil deGrasse Tyson&#39;s book Astrophysics for People in a Hurry is a pocket-sized primer on various facets of astrophysics that you can read in a weekend. Beyond visible light discussed here, the universe is filled with wonder across the electromagnetic spectrum - from spectacular gamma-ray bursts that release as much energy in a few seconds as the Sun will in its entire 10-billion-year lifetime to the cosmic microwave background that permeates the universe and lets us peer into its origins&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/blue/#cite-6&quot; class=&quot;citation-link&quot;&gt;6&lt;/a&gt;&lt;/sup&gt;. Perhaps it is the hubris of humankind that declare a certain range of the electromagnetic spectrum as visible when other species on earth can see outside of this range – both below (infrared) and above (ultraviolet).
&lt;/p&gt;
&lt;p&gt;
It took centuries for scientists to build a telescope outside the visible spectrum, and even that was accidental&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/blue/#cite-7&quot; class=&quot;citation-link&quot;&gt;7&lt;/a&gt;&lt;/sup&gt;. How many opportunities are staring at us in the face but we are simply blind to it? In the famous Müller-Lyer illusion, even if you know that the lines are the same length, your eyes still see them as different lengths. Simply knowing about infrared or radio waves wasn&#39;t enough for astronomers to look in the sky for them. In practice, it takes a concerted effort to break out of cognitive biases or blind spots. What opportunities are lurking in your blind spots? What will you do about it?
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;&lt;p&gt;&lt;/p&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;Everyday Physics – Why do veins look blue? (n.d.). Retrieved from &lt;a href=&quot;https://osuwomeninphysics.wordpress.com/2015/03/11/everyday-physics-why-do-veins-look-blue/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://osuwomeninphysics.wordpress.com/2015/03/11/everyday-physics-why-do-veins-look-blue/&lt;/a&gt; (accessed December 3, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;What You Should Know About Discoloration of Skin (n.d.). Retrieved from &lt;a href=&quot;https://www.healthline.com/health/skin-discoloration-bluish&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.healthline.com/health/skin-discoloration-bluish&lt;/a&gt; (accessed December 3, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;Color temperature (n.d.). Retrieved from &lt;a href=&quot;https://en.wikipedia.org/wiki/Color_temperature&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://en.wikipedia.org/wiki/Color_temperature&lt;/a&gt; (accessed December 3, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-4&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;4.&lt;/span&gt; &lt;small&gt;Blackbody radiators (n.d.). Retrieved from &lt;a href=&quot;http://dept.harpercollege.edu/chemistry/chm/100/dgodambe/thedisk/spec/blackbod.htm&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;http://dept.harpercollege.edu/chemistry/chm/100/dgodambe/thedisk/spec/blackbod.htm&lt;/a&gt; (accessed December 7, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-5&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;5.&lt;/span&gt; &lt;small&gt;Sun&#39;s Spectrum (n.d.). Retrieved from &lt;a href=&quot;https://scied.ucar.edu/image/sun-spectrum&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://scied.ucar.edu/image/sun-spectrum&lt;/a&gt; (accessed December 3, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-6&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;6.&lt;/span&gt; &lt;small&gt;Although this only takes us to about 380 thousand years after the big bang because the universe was not sufficiently cool to form hydrogen atoms, which would allow photons to pass through without scattering. The reason why they are merely microwaves today is due to an effect called redshift&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-7&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;7.&lt;/span&gt; &lt;small&gt;Karl Jansky was building a radio receiver for Bell labs and found noise coming from the centre of the Milky Way Galaxy&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>Why I find the Speed Chess Championship Interesting</title>
    <link href="https://jesungpark.com/blog/scc/"/>
    <updated>2020-11-29T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/scc/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
It has been interesting to see the world embrace Netflix&#39;s The Queen&#39;s Gambit with enthusiasm. As alluded to in the title, it champions a female lead and makes chess more approachable to a broader audience. Unlike many other movies or shows about sports or games, Netflix bothered to get the details right by consulting experts like famed American chess teacher Bruce Pandolfini and former world champion Garry Kasparov. This helped the series also gain wide approval in the chess community. There are thousands of articles about the Queen&#39;s Gambit so I wanted to focus on chess in the real world and what makes it interesting for me.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- simulation --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Chess memory&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
There are many stories of chess Grandmasters&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scc/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; (abbreviated GM) walking by a chess board and announcing mate in 6. Strong players are also able to play blindfolded chess, sometimes simultaneously. If that wasn&#39;t impressive enough, they can also recall positions from games that were played decades ago by other players with perfect precision. How is it that these players are able to achieve super-human performance?
&lt;/p&gt;
&lt;p&gt;
Studies have shown that GMs have no more working memory than regular folks but have excellent memory for chess positions&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scc/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;. This is due to the chunking effect where configurations of chess pieces are learned and stored in long-term memory. So instead of memorizing the location of individual pieces, they remember chunks like openings, pawn structures, or checkmating attacks. Even as a mediocre player, I started recognizing checkmating patterns like the smothered mate&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scc/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;. Better players will have far larger chunks and a bigger database of chunks to draw from.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;The SCC&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
&lt;a href=&quot;http://chess.com/&quot;&gt;Chess.com&lt;/a&gt; - one of the major online chess sites - has taken full advantage of the chess boom to host the 2020 edition of Speed Chess Championship&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scc/#cite-4&quot; class=&quot;citation-link&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; (SCC). SCC consists of 90 minutes of 5/1 blitz (i.e. players start with 5 minutes on their clock and gain 1 second per move. This is called a time control), 60 minutes of 3/1 blitz, and 30 minutes of 1/1 bullet chess. It attracts some of the best players in the world including GM Magnus Carlsen (reigning world, world rapid, and world blitz chess champion) and GM Hikaru Nakamura (highest ranking blitz player and a popular Twitch streamer). The games are played in rapid succession with breaks between the three time controls.
&lt;/p&gt;
&lt;p&gt;
For the broadcast, there are commentators (who are often GMs themselves or IMs&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scc/#cite-5&quot; class=&quot;citation-link&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;) that add colour and explain tactical sequences that may elude viewers. They give their thoughts on the players&#39; moves and keep the audience engaged. There is money on the line too - SCC has a total prize fund of a cool quarter million dollars. Other events like the Champions Chess Tour has a total prize pool of $1.5M. Despite being one of the oldest games in the world, chess has reinvented itself as an esport.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;What&#39;s happening behind the scenes?&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Needless to say, playing chess with such short time controls requires a tremendous amount of concentration. Blunders or &lt;a href=&quot;https://www.youtube.com/watch?v=7B5ifeOweNA&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;mouse slips&lt;/a&gt; can turn the tide of the game instantly and give a player momentum to launch comebacks. Given that every game of chess is independent of each other, these momentum shifts highlight the importance of psychology in player performance. Players with strong psychological resiliency bounce back easily from mistakes while others spiral out of control.
&lt;/p&gt;
&lt;p&gt;
Another interesting aspect of the SCC is the players&#39; opening choices throughout the match. With modern chess engines, top players may analyze and memorize up to 20+ moves in a single theoretical opening variation. As your opponent will have to figure out complex positions on the fly, this will help tremendously on the clock. To combat this, some players will play offbeat moves to get the other player off their book&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scc/#cite-6&quot; class=&quot;citation-link&quot;&gt;6&lt;/a&gt;&lt;/sup&gt; or prep.
&lt;/p&gt;
&lt;p&gt;
Between games, the players are also thinking of how to refute the other player&#39;s opening. They think about where they might have gone wrong and how they can pose a problem to their opponent. I believe this is similar to a &lt;a href=&quot;https://jesungpark.com/blog/driving/&quot; target=&quot;_blank&quot;&gt;driver analyzing their driving&lt;/a&gt; while on track. Novice chess players will spend much of their time trying not to make tactical blunders (and blundering anyway) while the expert player is able to spare some mental resources to look at pawn structure, positional weaknesses, or preparing a plan of attack for the next game.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;What makes things enjoyable?&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Back in university, I played a lot of FIFA with my friends. After a while, I noticed that I enjoyed watching actual soccer matches more because I&#39;m able to analyze the positions of players on the pitch and appreciated an amazing set piece goal or agonize over a missed opportunity for a through pass. With a better tactical eye and positional understanding, I was watching the exact same game but got more out of it.
&lt;/p&gt;
&lt;p&gt;
In his book So Good They Can&#39;t Ignore You&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scc/#cite-7&quot; class=&quot;citation-link&quot;&gt;7&lt;/a&gt;&lt;/sup&gt;, Cal Newport argues that the oft-touted advice of &#39;finding your passion then getting a job in that field&#39; has it backwards. Once you build rare and valuable skills, you will find it enjoyable and develop a passion for it. I think that applies other activities and hobbies that don&#39;t necessarily make you any money&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scc/#cite-8&quot; class=&quot;citation-link&quot;&gt;8&lt;/a&gt;&lt;/sup&gt; as well. Deliberate practice - the process needed to acquire rare and valuable skills - is hard. But the delayed gratification you&#39;ll experience pays off with added interest. Whatever your hobby is, if you&#39;re going to do it anyway, you might as well get good at it. You will enjoy it more.
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;GM – Grandmaster – highest title awarded to chess players based on Elo rating and tournament performance&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;Lane, D.M., Chang, YH.A. (2018). Chess knowledge predicts chess memory even after controlling for chess experience: Evidence for the role of high-level processes. &lt;i&gt;Mem Cogn 46, 337–348&lt;/i&gt; Retrieved from &lt;a href=&quot;https://doi.org/10.3758/s13421-017-0768-2&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://doi.org/10.3758/s13421-017-0768-2&lt;/a&gt; (accessed November 25, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;Smothered mate (n.d.). &lt;i&gt;Wikipedia&lt;/i&gt;. Retrieved from &lt;a href=&quot;https://en.wikipedia.org/wiki/Smothered_mate&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://en.wikipedia.org/wiki/Smothered_mate&lt;/a&gt; (accessed November 24, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-4&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;4.&lt;/span&gt; &lt;small&gt;2020 Speed Chess Championship (2020). &lt;i&gt;Chess.com&lt;/i&gt;. Retrieved from &lt;a href=&quot;https://www.chess.com/article/view/2020-speed-chess-championship&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.chess.com/article/view/2020-speed-chess-championship&lt;/a&gt; (accessed November 22, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-5&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;5.&lt;/span&gt; &lt;small&gt;IM – International Master, title just below Grandmaster&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-6&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;6.&lt;/span&gt; &lt;small&gt;Book move – a move that is considered standard or conventional, that is established opening theory&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-7&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;7.&lt;/span&gt; &lt;small&gt;Newport, C. (2012). &lt;i&gt;So good they can&#39;t ignore you: why skills trump passion in the quest for work you love&lt;/i&gt;. Business Plus&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-8&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;8.&lt;/span&gt; &lt;small&gt;Other people can make money if they are sufficiently skilled – but the enjoyment can come before that&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>A model of becoming a faster driver</title>
    <link href="https://jesungpark.com/blog/driving/"/>
    <updated>2020-11-17T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/driving/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
It was a warm, sunny day at the Canadian Tire Motorsport Park Driver Development Track (CTMP DDT) located in Bowmanville, Ontario. I put on my helmet and turned on the engine to line up for the next session. It had been a day filled with struggle to find lap times as I pushed my old tires to its limit. For the last session of the day, I decided to take it easy, enjoy the ride, and bring the car back home in one piece. While I was going through the motions, something mysterious happened. I was putting in my best lap times of the day – lap after lap. I could feel that I was using every bit of grip and every inch of the track. In the end, I went a full second faster than my previous fastest lap. How did this happen?
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- simulation --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Mental model of the driving task&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
As unusual as this might seem, this phenomenon has happened to me on multiple occasions. Let&#39;s start from the beginning and examine how a novice driver would learn to drive on a track. If you have never tracked before, I highly recommend signing up to a lapping day organized by groups like &lt;a href=&quot;https://spda-online.ca/&quot; target=&quot;_blank&quot;&gt;SPDA&lt;/a&gt; (for folks in the GTA) or driving schools that offer coaches. The coaches will tell you about basic physics of tire grip, driving etiquette, and the racing line&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/driving/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. Once on track, the novice driver will spend all their attention on following the basic rulebook of braking and turn-in points.
&lt;/p&gt;
&lt;p&gt;
Over time, drivers will be able to spend less attention on the basic tasks of tackling one corner at a time and divert their attention to other tasks like being aware of other drivers on track, analyzing their driving, and understanding the car&#39;s performance. The progression is nicely laid out a series of &lt;a href=&quot;http://www.intuitivespeed.com/learning/learning-stages/&quot; target=&quot;_blank&quot;&gt;articles&lt;/a&gt;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/driving/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; by Warren Chamberlain that sparked this topic. The specifics of analyzing and improving your driving is a separate topic I may tackle at a future date. &#39;The Perfect Corner&#39;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/driving/#cite-3&quot; class=&quot;citation-link&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; and its companion books are an excellent read if you&#39;re interested in learning about the physics of driving fast.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;The intuitive driver&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
How do fast drivers think about braking points, turn-in points, heel-and-toe downshifts, changing track conditions, tire degradation, adjusting to subtle mistakes in corner entry, tire slip, understeer/oversteer, and other drivers on track - all at the same time? The answer is System 1 thinking. As described by Daniel Kahneman in his book Thinking, Fast and Slow&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/driving/#cite-4&quot; class=&quot;citation-link&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;, System 1 is fast, intuitive, unconscious thought. Through experience and simulated experience, the brain is able to model and automate the task of track driving. It is able to take in large amounts of data and react quickly to incoming information.
&lt;/p&gt;
&lt;p&gt;
This skill is not limited to the best drivers in the world. Driving on an empty road is a task where most people are not actively thinking about controlling the steering wheel or the pedal inputs. The car becomes an extension of your body and you are on auto-pilot. For expert track drivers, this is what it feels like to drive on track – except you are on the edge of grip pulling over 1.3 lateral Gs for road cars on sticky tires or up to 6 G in a Formula One car.
&lt;/p&gt;
&lt;p&gt;
Beyond quick reactions, skilled drivers are able to confidently predict the car&#39;s behaviour faster than novice drivers. As I coached novice drivers from the passenger seat, I have been in situations where they carried too much or too little speed into the corner, risking our safety or worse – losing lap times. It is not uncommon for me to be aware of what&#39;s about to happen 1-2 seconds before the driver is but I couldn&#39;t explain to you exactly why I knew – I just did.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;System 1 vs. System 2&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Chamberlain points out that some activities like hard braking are very sensitive to timing which require conscious effort. At race speeds, you may miss the apex if you braked one hundredth of a second too late&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/driving/#cite-5&quot; class=&quot;citation-link&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;. There are other aspects of track driving such as awareness of other drivers on the track and driving analysis that also require conscious thought. However, System 1 and 2 cannot be active at the same time.
&lt;/p&gt;
&lt;p&gt;
This means that drivers need to switch between the intuitive and focused modes to leverage them when needed. Chamberlain asserts that expert drivers are able to use the focused/analytical (System 2) only when it&#39;s absolutely needed (e.g. hard braking and primary turn-in) and it&#39;s a gradual shift to using less and less System 2. I disagree with Chamberlain that the journey is monotonic. My journey for finding speed involved me going too far on the intuitive-analytical spectrum.
&lt;/p&gt;
&lt;p&gt;
Since my early days of track driving, I had little trouble letting my System 1 take the reigns. However, I had (and still have) issues timing the hard braking and turn-in points because I&#39;m on auto-pilot. Perhaps I&#39;m a rare breed (empirical data seems to support this) but some people may be predisposed to running one system over the other. To Chamberlain&#39;s point, I believe that the fastest drivers are able to effectively switch between the two Systems when needed.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;The 85% rule&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
During his Tim Ferriss podcast episode&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/driving/#cite-6&quot; class=&quot;citation-link&quot;&gt;6&lt;/a&gt;&lt;/sup&gt;, Hugh Jackman explained that
&lt;/p&gt;&lt;blockquote&gt;&amp;quot;If you tell most […] A-type athletes to run at their 85 percent capacity, they will run faster than if you tell them to run 100 because it&#39;s more about relaxation and form and optimizing the muscles in the right way.&amp;quot; &lt;/blockquote&gt;
I believe a similar approach is needed for track driving. If you are trying too hard to set the fastest lap times, you will often overdrive the car and end up going slower. Relaxing will allow your System 1 to step in easier and make the driving much smoother. And as all racing drivers will tell you, smooth is fast.
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;The racing line is the fastest path for a car to take around a track&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;Warren Chamberlain (n.d.). Learning Stages. &lt;i&gt;Speed Craft&lt;/i&gt;. Retrieved from &lt;a href=&quot;http://www.intuitivespeed.com/learning/learning-stages/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;http://www.intuitivespeed.com/learning/learning-stages/&lt;/a&gt; (accessed November 11, 2020)&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-3&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;3.&lt;/span&gt; &lt;small&gt;Brouillard, A. (2016). &lt;i&gt;The Perfect Corner: A Driver&#39;s Step-By-Step Guide to Finding Their Own Optimal Line Through the Physics of Racing&lt;/i&gt;. Paradigm Shift Motorsport Books&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-4&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;4.&lt;/span&gt; &lt;small&gt;Kahneman, D. (2011). &lt;i&gt;Thinking, fast and slow&lt;/i&gt;. Farrar, Straus and Giroux&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-5&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;5.&lt;/span&gt; &lt;small&gt;Even at moderate corner entry speeds of 150 km/h, you will be nearly half a metre further along if you brake one hundredth of a second later. This is about a mile off for track drivers&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-6&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;6.&lt;/span&gt; &lt;small&gt;Tim Ferriss (n.d.). The Tim Ferriss Show - Hugh Jackman Episode. Retrieved from &lt;a href=&quot;https://tim.blog/2020/06/26/hugh-jackman/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://tim.blog/2020/06/26/hugh-jackman/&lt;/a&gt; (accessed November 16, 2020)&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
  <entry>
    <title>How I read nutrition-related scientific studies</title>
    <link href="https://jesungpark.com/blog/scientific-studies/"/>
    <updated>2020-11-06T00:00:00Z</updated>
    <id>https://jesungpark.com/blog/scientific-studies/</id>
    <category term="essay"/>
    <content xml:lang="en" type="html">&lt;div class=&quot;clearfix&quot;&gt;
          &lt;/div&gt;
          &lt;!-- explanation --&gt;
&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
Does red meat cause cancer? Are eggs good for you? What about coffee? Scientists often seem to flip flop on life&#39;s most important questions. I ran across an &lt;a href=&quot;https://www.foxnews.com/food-drink/drinking-coffee-before-breakfast-negative&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;article&lt;/a&gt; covering the impact of impaired sleep and caffeine on blood glucose control. Given that I consume caffeine regularly and was reading this article at 3 AM, it seemed relevant. The study&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scientific-studies/#cite-1&quot; class=&quot;citation-link&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; is from the University of Bath (the city in England, not a place of higher education for bathtubs).
&lt;/p&gt;
&lt;p&gt;
&lt;i&gt;Standard internet disclaimer: I&#39;m not a doctor nor do I play one on the internet. Don&#39;t take anything here as medical advice.&lt;/i&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blank10&quot;&gt;&lt;/div&gt;
&lt;!-- simulation --&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Statistical Rigour&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
What you can conclude from an experiment&#39;s results depends entirely on how the experiment was set up. That is why there are systems like blind studies or control groups to limit the influence of other variables that could impact the outcome. The article looks at a N=29 study done at the University of Bath (the UK city, not a place of higher education for bathtubs). It looked at three scenarios with a subsequent sugar intake and tracked the participants&#39; blood glucose level.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;Undisturbed sleep with no morning coffee&lt;/li&gt;
&lt;li&gt;Disturbed sleep with no morning coffee&lt;/li&gt;
&lt;li&gt;Disturbed sleep with morning coffee&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
With this, we can compare the impact of sleep impairment on caffeine-free individuals (1 vs. 2) and the impact of caffeine on sleep-impaired individuals (2 vs. 3). The first thing that stood out was the omission of undisturbed sleep with coffee although we may need to read between the lines here. One nitpick on the methodology is that the study could have tried to control for the act of drinking coffee through decaf coffee or use caffeine pills and a placebo pill. The groups being compared should be as close as possible except for the variable(s) you&#39;re interested in studying.
&lt;/p&gt;
&lt;p&gt;
The study found no statistically significant difference between 1 &amp;amp; 2 and a statistically significant increase in 3 vs. 2. Although the study looked at both blood glucose and insulin levels, I&#39;ll focus on the former for simplicity. Next, I&#39;ll look at statements or conclusions made by the authors of the article and the study.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;New Learnings and Hidden Assumptions&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
&lt;/p&gt;&lt;blockquote&gt;&#39;Though, the study was limited and further research is needed into the effects of caffeine first-thing in the morning on the metabolism, the early findings suggest drinking coffee first could limit the body&#39;s ability to process sugar immediately after.&#39;&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
Some quotes from the authors of the study seem to indicate that they wanted to explore the impact of sleep impairment on metabolism but were unable to find any difference (1 vs. 2). While I think that the absence of statistically significant differences can be very important, it is certainly less exciting to talk about.
&lt;/p&gt;
&lt;p&gt;
Instead, the narrative focused more on the consumption of coffee before breakfast. But has that been explored already? A minute of Googling showed &lt;a href=&quot;https://pubmed.ncbi.nlm.nih.gov/9846599/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;a study&lt;/a&gt; published in 1998 showing increased blood glucose levels corresponding to blood caffeine levels so this particular conclusion seems less interesting.
&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;
&lt;/p&gt;&lt;blockquote&gt;
&#39;Put simply, our blood sugar control is impaired when the first thing our bodies come into contact with is coffee especially after a night of disrupted sleep. We might improve this by eating first and then drinking coffee later if we feel we still feel need it.&#39;
&lt;i&gt;-Professor James Betts, who oversaw the study&lt;/i&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
Based on the study methodology, the conclusions that we can draw would be on the impact of coffee &lt;b&gt;only&lt;/b&gt; after a night of disrupted sleep, not especially (2 vs. 3). To use that word, the study would have had to look at a group with undisturbed sleep and coffee. Then you can measure the impact of sleep impairment and coffee separately as well as see if there are any synergistic effects.
&lt;/p&gt;
&lt;p&gt;
[Warning: opinion] While eating before coffee sounds like sensible advice, there is a hidden assumption here that we want to flatten the blood sugar curve as much as possible. Hyperglycemia leads to diabetes so high glucose levels is bad for you, right? If that&#39;s the case, why aren&#39;t all athletes who eat voraciously suffering from diabetes? If your goal is to avoid blood sugar spikes, I would suggest consuming no calories (please don&#39;t do this - you will die). I believe the jury&#39;s still out on long-term health effects of acute elevation of blood glucose.
&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;span12&quot;&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;/div&gt;
&lt;div class=&quot;w3-full w3-container w3-margin-bottom&quot;&gt;
&lt;p&gt;
When confronted with complex topics, most people replace the difficult question of &amp;quot;does impaired sleep combined with caffeine compromise blood glucose control&amp;quot; with an easier one such as &amp;quot;is coffee bad for you&amp;quot;&lt;sup&gt;&lt;a href=&quot;https://jesungpark.com/blog/scientific-studies/#cite-2&quot; class=&quot;citation-link&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;. Besides being misinformed, perhaps a more significant consequence of this substitution heuristic is that the general public believe that scientists can&#39;t agree on anything and end up losing faith in the scientific community.
&lt;/p&gt;
&lt;p&gt;
So next time you read through a nutrition-related article, I would recommend that you add a healthy dose of scepticism, look at the actual paper, read what is &amp;amp; is not being said, and draw your own conclusions. It is more work than parroting sound bites but you will get a lot more out of it.
&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;bibliography w3-full w3-container w3-margin-bottom&quot;&gt;
  &lt;p id=&quot;cite-1&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;1.&lt;/span&gt; &lt;small&gt;Smith, H., Hengist, A., Thomas, J., Walhin, J., Heath, P., Perkin, O., . . . Betts, J. (2020). Glucose control upon waking is unaffected by hourly sleep fragmentation during the night, but is impaired by morning caffeinated coffee. &lt;i&gt;British Journal of Nutrition, 124(10), 1114-1120&lt;/i&gt; Retrieved from &lt;a href=&quot;https://doi.org/10.1017/S0007114520001865&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://doi.org/10.1017/S0007114520001865&lt;/a&gt;&lt;/small&gt;
  &lt;/p&gt;
  &lt;p id=&quot;cite-2&quot; class=&quot;bibliography-entry&quot;&gt;
    &lt;span class=&quot;citation-number&quot;&gt;2.&lt;/span&gt; &lt;small&gt;This is known as substitution bias which is discussed in Daniel Kahneman&#39;s book Thinking, Fast and Slow&lt;/small&gt;
  &lt;/p&gt;
&lt;/div&gt;
</content>
  </entry>
</feed>
