<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-08-03T18:10:36+03:00</updated><id>/feed.xml</id><title type="html">fxhw’s website</title><subtitle>a trove of memories</subtitle><entry><title type="html">An Anthology of Notes App entries</title><link href="/2026/05/03/anthology-freshman.html" rel="alternate" type="text/html" title="An Anthology of Notes App entries" /><published>2026-05-03T00:00:00+03:00</published><updated>2026-08-02T23:36:36+03:00</updated><id>/2026/05/03/anthology-freshman</id><content type="html" xml:base="/2026/05/03/anthology-freshman.html"><![CDATA[<p>During my first year at university, I started using the Notes app to record my thoughts. Whenever something stirred, I wrote it down. This post is a selection of those entries, shaped by change.</p>

<p>Will update as I go.</p>

<h2 id="shore">shore</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/eyes.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>12/2/26 00:17</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
ive been so tired lately<br />
like the tide just keeps pulling me under<br />
and I can't do anything about <br />
the sand and debris it drags over me <br /><br />

but I know, I know<br />
that one day the moon will <br />
come, pull the tide back, <br />
and maybe for a moment <br />
I'll be free of it all,<br />
face up to the sky,<br />
eyes glistening in moonlight <br />
before it all comes rushing back
  <span class="quote-author">— 12th of Feb, '26</span>
</blockquote>

<h2 id="irony">irony</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/bless.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>3/3/26 18:46</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
an Iranian student,<br />
studying at an American institution,<br />
as Iranian missiles carve streaks of fire into the sky above me.<br /><br />

i am told i am being ‘liberated’<br />
by an American leader<br />
via the assassination of Iran’s leaders.<br /><br />

i receive updates from the American embassy,<br />
and also messages of safety<br />
from the Iranian-American president of my university. <br /><br />

ahhhh that hyphen, that damn hyphen. Iranian. American. <br /><br />

god bless cosmopolitanism,<br />
god bless that part of me that insists on belonging,<br />
belonging to places that do not belong to each other,<br />
god bless having to carry two names in one body,<br />
and having no where to call home.     
<span class="quote-author">— 3rd of March, '26</span>
</blockquote>

<h2 id="rise">rise</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/lightning.gif" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>25/3/26 18:55</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
when I die,<br />
bury me under the great cypress<br />
don’t erect a headstone for my grave<br />
and when I die,<br />
do not visit my grave<br />
under the great cypress. <br /><br />

for I am not dead.<br /><br />

when the great cypress’ roots wrap my body<br />
when they meet my eyes,<br />
the cypress will see through them all I have seen. <br />
it will see the love, the rage, the contempt yes,<br />
but it will also see itself, standing tall. <br /><br />

for when its roots caress my fingers,<br />
the cypress will feel through them<br />
the pain of gripping a knife, of carving something of your own flesh and bones—<br />
but also the rough certainty of its own bark. <br /><br />

and when its roots coil around my heart,<br />
they will drink from it—<br />
the same love,<br />
the same rage,<br />
the same old contempt for man. <br /><br />

I will rise with it,<br />
taller than I ever stood in life,<br />
my eyes fixed forever on the skyline.<br /><br />

so do not visit me when I die.<br /><br />

if you wish to see me,<br />
look to the cypress—<br />
the one that will not stop staring<br />
into the skyline.
<span class="quote-author">— 26th of March, '26</span>
</blockquote>

<h2 id="geranium">geranium</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/tea.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>25/3/26 18:55</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
in my cold, bitter world<br />
i thought of you.<br />
so that your scent could come and <br />
permeate through my garden<br />
i thought of you,<br />
so that i could hear your laughs,<br />
so that i could perch them like the geraniums,<br />
on the windowsill.<br /><br />
little did I know,<br />
that your laughter was the sky.<br /><br />

the whole sky.
<span class="quote-author">— 11th of April, '26</span>
</blockquote>

<h2 id="postscript-to-self">postscript to self</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/hafez.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>27/12/25 18:03</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
To you, 7 semesters in the future;<br /><br />

Spread your wings, yes, <br />
but don't forget that certainty fractures without warning.<br /><br />

Even Icarus laughed as he fell, as death whispered in his ear.<br /><br />

Did he laugh at the symmetry of ambition, <br />
that the moment of ascent is always one breath <br />
away from the fall, <br /><br />

Or did he laugh at the way the world keeps turning,<br />
even as a fallen body cuts through the air?
<span class="quote-author">— 12th of December, '25</span>
</blockquote>

<h2 id="to-start-empty">to start empty</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/roads.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>28/11/25 23:09</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
in 12 hours, I become a university student.<br /><br />

I will, once again, have something to chase.<br />
something to carve my nights and days around.<br /><br />

and finally, rid myself of the weight of weightlessness,<br /><br />

and feel the edge of purpose cut into me.<br /><br />

in 12 hours, I will, once more, <br />
work for the knife, <br />
let it claim its due, <br />
cut by cut,<br />
hour by hour,<br /><br />

until I am shaped into something it can use.
<span class="quote-author">— 19th of August, '25</span>
</blockquote>

<h2 id="and-to-end-empty">and to end empty</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/hole-of-light.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>28/11/25 23:09</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
slowly<br /><br />

i thought i was done<br />
and i am,<br />
but not in the way you think.<br /><br />

yes,<br />
i don’t wake up early on sundays anymore.<br />
nor do i sleep as soon as i get home. <br />
instead,<br />
i’ve forgotten how to sleep at all.<br /><br />

slowly<br /><br />

you ask me why i’m still stressed.<br />
yes,<br />
there’s nothing left to work toward,<br />
nothing left to carve out of myself<br /><br />

but im still sitting here<br />
staring at what has become of me,<br />
at the edges of what could have been.<br /><br />

slowly<br /><br />

every time i think i am finished,<br />
my body reminds me<br />
consequences don’t arrive on time.<br />
decisions surface only later,<br />
after the storm has already passed.<br /><br />

the truth is<br />
i am being immobilized.<br />
paralyzed by nothing,<br />
which is also everything.<br /><br />

i thought i was done,<br />
and i am<br />
just not in the way you think.<br /><br />

i am spent.<br />
exhausted.<br />
learning how to exist<br />
as nothing<br />
after once being everything.<br /><br />

slowly<br /><br />

i am realizing<br />
i am still working for the knife—<br />
that i still start the day lying<br />
and end with the truth<br /><br />

that my fingers are still clenched.<br />
only now<br />
clenched around nothing<br /><br />

so i drag nothing<br />
along the edges of nothing,<br />
hoping to catch something<br /><br />

slowly,<br /><br />

trying to conjure<br />
what was lost.
<span class="quote-author">— 1st of May, '26</span>
</blockquote>

<h2 id="hayes">hayes</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 50%;" src="/assets/images/hayes.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>5/3/26 19:41</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
you don’t understand<br />
you give me chills,<br />
the ones that climb up my spine,<br />
the ones that leave my mouth dry,<br />
like I’ve swallowed the sea.<br /><br />

you gave me chills last week.<br />
i was bent over an exam, but then<br />
i remembered us,<br />
on that beach, that night,<br />
you told me to pounce on anything, everything<br />
that arrived.<br /><br />

but I didn’t.<br />
I watched the waves instead,<br />
how they pounced at each other,<br />
endlessly<br />
with nothing to lose.<br /><br />

eventually, I told you<br />
your advice sounded familiar<br />
to something I was learning:<br />
the gale-shapley algorithm,<br />
two groups, reaching, choosing.<br /><br />

i said<br /><br />

the ones who move first<br />
who pounce<br />
they get the best they’re allowed to have.<br /><br />

the ones who wait<br />
end up with what’s left<br /><br />

i continued staring at the waves<br /><br />

you gave me chills last week<br />
in that exam room,<br />
when the question found me.<br /><br />

salt in my throat,<br />
graphite blurring,<br />
the tide rising<br /><br />

and suddenly<br />
the waves again,<br />
curving over themselves,<br />
and your voice through the breeze,<br />
insisting,<br />
again and again<br />
pounce.<br /><br />

you gave me chills yesterday.<br />
when i got my exam back,<br /><br />

i noticed it was as if something in me<br />
had moved<br />
before I even knew how to.<br /><br />

like, somewhere between fear<br />
and memory,<br />
i had leapt.<br /><br />

you don’t understand<br />
you give me chills
<span class="quote-author">— 5th of May, '26</span>
</blockquote>

<h2 id="speed">speed</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/speed.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>10/4/26 00:42</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
as a child I never understood why one would speed<br /><br />

why place your life<br />
in the hands of something built to leave<br />
why gamble on momentum<br />
why<br /><br />

but i dropped you off at the airport yesterday<br />
and i would be lying if i said i didn’t gamble.<br /><br />

as a child i never understood what it felt like<br /><br />

to have the wind kiss my face<br />
to have its fingers run through my hair<br />
the way yours once did.<br /><br />

to watch streetlights disappear<br />
before they come into sight<br />
much like you did.<br /><br />

to feel nothing as you gamble everything<br />
on a pile of metal.<br />
to bet on a losing dog,<br />
much like i did.<br /><br />

i still don’t understand why people speed<br /><br />

but it felt great knowing my body was moving at<br />
one hundred eighty<br />
while yours moved at twice that<br /><br />

did you see me from up there?<br />
the car threading between all the others<br /><br />

did you see how i was<br />
blurring the lines in my periphery<br />
blurring the lines between life and death<br />
blurring<br /><br />

blurring until the only thing i felt<br />
was how badly i wanted you back<br /><br />

i still don’t understand speeding<br />
but maybe i loved you like that<br />
and now i understand why it’s hard to stop
<span class="quote-author">— 9th of May, '26</span>
</blockquote>

<h2 id="a-relationship-with-the-sun">a relationship with the sun</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/sun.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>17/6/26 04:50</div>
      </figcaption>
  </figure>
<blockquote class="fxhw-quote">
to heal is to have once loved,<br />
i tell the sun and maybe myself.<br /><br />

i close my eyes and see yours<br />
through the sunlight kissing my eyelids.<br />
i open them and look down at the waves:<br />
dark, serene.<br /><br />

i remember looking into your eyes and realizing that<br />
when you shut them,<br />
the sky loses two of its brightest stars.<br /><br />

i don't even know what i'm healing from.<br /><br />

this place feels like a person,<br />
warm, much like you—<br />
the sun is rising on this port,<br />
where crickets synchronize with my heartbeat, where the lingering night breeze brushes my hair,<br />
where the palm's crown shuffles and shushes my grief,<br />
and the birds periodically pass by to check on me,<br /><br />

i know that i am healing.<br />
the shore approaches to tell me so,<br />
the sun's warmth on my skin tells me so.<br /><br />

to heal is to have once loved, i tell the sun,<br />
and it understands.<br /><br />

i can manage with two fewer stars in the sky.<br /><br />

the sun rises higher now,<br />
and still every time i close my eyes,<br />
there they are:<br />
those two lustrous stars.<br /><br />

ahhhh forough said it best- her name translates to luster;<br /><br />

<p style="color: rgba(243, 233, 233, 0.91);">  
say something to me, please.<br />
i am at the mercy of this window.<br />
i have a relationship with the sun.<br /><br />
</p>
to heal is to have once loved,<br />
the shore would tell you that.<br />
the sun would tell you that.
<span class="quote-author">— 17th of June, '26</span>
</blockquote>

<h2 id="afloat">afloat</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/wind.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>10/7/26 18:45</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
throw me to the wind<br />
I yearn to feel its touch<br />
have it kiss my brow and whisper tales<br />
of devotion, sacrifice, and love.<br />
<br />
throw me to the wind<br />
I beg to feel the morning dew<br />
gather on my skin,<br />
mix with the salt of my eyes<br />
which will finally know freedom.<br />
<br />
throw me to the wind<br />
I ache to rise and to fall<br />
To burn and to suffer<br />
To disappear and be forgotten.<br />
<br />
throw me to the wind<br />
I will carry a smile into its vastness<br />
I will tear out my own roots<br />
And let it take me to its garden.<br />
<br />
And when they find me<br />
face in the grass, smiling<br />
They will find that not even Death<br />
could smother the Love in me.<br />
<br />
what a ruinous thing.
<span class="quote-author">— 10th of July, '26</span>
</blockquote>

<h2 id="sand-salt-and-the-memory-of-you">sand, salt, and the memory of you.</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/alone.jpeg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>10/7/26 18:45</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
the water keeps washing over<br />
your footsteps in the sand<br />
<br />
one<br />
two<br />
three<br />
four<br />
five fingers<br />
<br />
filling up with seawater <br />
i stare at the ebbs and flows<br />
how the sea comes in and washes over <br />
the memory of you<br />
<br />
one<br />
two<br />
three<br />
four<br />
<br />
do you remember when you thought you would die?<br />
scribbling your will on the back of a Cornflakes box<br />
do you remember how afraid you were?<br />
<br />
i do, i think i do<br />
<br />
one<br />
two<br />
three<br />
<br />
when i held you in my arms, kissed your neck<br />
your long hair got stuck in my mouth<br />
we talked about that later<br />
and laughed at how absurd everything had become<br />
do you remember? <br />
<br />
i do, i think i do<br />
<br />
one<br />
two<br />
<br />
we set fire to our lives <br />
let everything burn, until only we remained<br />
do you remember when we also<br />
set fire to your physics textbook<br />
we both hated mechanics<br />
do you remember?<br />
<br />
i do, i think i do<br />
<br />
one<br />
<br />
before you left<br />
i took your left with my right,<br />
took you to the shore<br />
you complained that the sand got in your eyes<br />
I blew into them as hard as i could<br />
you started tearing up<br />
and so did i <br />
<br />
do you remember?<br />
<br />
the tide has risen.  <br />
the sea has washed over the memory of you<br />
and brought with it enough sand<br />
to patch your footsteps. <br />
<br />
do i remember?<br />
i don’t. do you?
<span class="quote-author">— 15th of July, '26</span>
</blockquote>

<h2 id="love">love</h2>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/love.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>10/7/26 18:45</div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
I met Love, after the show,<br />
pressed against the barricade,<br />
it looked like a person still leaning on,<br />
long after the encore <br />
love was the shape of their eyes, still staring,<br />
silently still. <br />
<br />
I met Love, while thrifting<br />
I just caught it in my periphery:<br />
a vintage postcard from indochina<br />
depicting two ladies, shoulder over shoulder <br />
smile over smile. <br />
Love was not shaped like a heart. <br />
it was a 3:2 piece of glossy paper<br />
<br />
I met Love, while driving<br />
both hands on the wheel as it sang<br />
from the passenger seat,<br />
“I got a pocket, got a pocketful of sunshine”<br />
Love looked like singing this song, on a cloudy day.<br />
a windy one, too, where the wind sang along. <br />
<br />
I met Love waiting to get my tetanus shot.<br />
it was a young man holding a phone down to his friend’s ear. <br />
the friend, in a wheelchair, motorcycle burns and right arm in a sling: <br />
“it’s just a small burn mom, im fine, i promise”<br />
Love looked like a bruised hand, <br />
squeezing a shoulder wrapped in gauze<br />
<br />
Oh, I also met Love on Discord,<br />
A deliberate, private friend of three years whom I’ve never really seen,<br />
Never really heard, <br />
telling me there are temperatures to silence.<br />
Warm and cold silences.<br />
I met love realizing theirs was the warm kind.<br />
<br />
I met Love watching my friend shake salt onto his Pad Thai,<br />
looking away from his hovering hands,<br />
I saw the people I had met only a few days ago. <br />
I met Love watching them talk about their lives,<br />
I met Love watching one of them wrap her arm around his, as the salt still fell,<br />
I met Love saying goodbye to them after that meal. <br />
I met Love knowing that was the last I’d see them. <br />
<br />
What is the shape of Love? <br />
Is it a heart?<br />
Oh, definitely not. <br />
<br />
Love hops and hides in concert stages, <br />
in thrift stores, in hospital waiting rooms- waiting for you to notice<br />
that Love is you.<br />
Love is the shape of your outline.<br />
You, Lover, with or without a Lover.
<span class="quote-author">— 1st of August, '26</span>
</blockquote>]]></content><author><name></name></author><category term="poetry" /><summary type="html"><![CDATA[During my first year at university, I started using the Notes app to record my thoughts. Whenever something stirred, I wrote it down. This post is a selection of those entries, shaped by change.]]></summary></entry><entry><title type="html">An open letter to Oman</title><link href="/2025/07/30/to-oman.html" rel="alternate" type="text/html" title="An open letter to Oman" /><published>2025-07-30T00:00:00+03:00</published><updated>2026-06-27T00:46:50+03:00</updated><id>/2025/07/30/to-oman</id><content type="html" xml:base="/2025/07/30/to-oman.html"><![CDATA[<p>Dear Oman,</p>

<p><em>In June, I was forcefully made aware of the illusion of peace.  <strong>you</strong> showed me what it truly looked like.</em></p>

<p>That month, an all out war broke out in my home country, Iran. My 18th summer— the only summer I had before my first year in university— took on the bleakest of colors and lost all its vibrance.</p>

<p>I had been there for 2 weeks, excited, making plans for the rest of summer. But soon enough, I was looking for guides on preventing window glass from shattering. Thoughts of enjoyment and adventure turned into ones of survival and safety.</p>

<p>On more than one occasion I wondered to myself if I would live to see tomorrow or not.</p>

<p>And when a missile struck 2 kilometers away from home, my family decided I was not to stay in Iran any longer. With the airspace shut down, they arranged for me to travel to Bandar Abbas alone to search for any vessel that could take me out.</p>

<p>And that’s when I heard about <strong><em>your</em></strong> ships, Omani ships, carrying civilians back to Oman. After the 8 hour bus ride to the port, I visited <strong><em>your</em></strong> makeshift embassy at Ghods hotel. I pleaded with <strong><em>your</em></strong> delegation. I wasn’t an Omani resident, but I promised I would go straight to Qatar. I begged. Hours of back and forth passed, until I was finally offered a spot on <strong><em>your</em></strong> ship.</p>

<p>It was all over. I had found a way out. I was safe.</p>

<p><em>Until again, life reminded us all of the illusion of peace.</em></p>

<p>The port <strong><em>your</em></strong> boat was docked in was struck. I remember the entire boat shaking. I pulled the window open and saw the scene outside.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-blast-left.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>21/6/25 21:27</div>
      </figcaption>
  </figure>

<p>The water rippled and reflected the bright hue of chaos. I took a picture before being told to turn my phone to flight mode.</p>

<p>Screams, questions, and cries burst throughout the ship.</p>

<p><strong><em>You</em></strong> instructed <strong><em>your</em></strong> ship to go into blackout mode. For a moment, everyone went silent. The lights went out. The only light entering the ship was that of the blazing scene outside— peering through the blinds. The ship remained docked.</p>

<p><em>And yet again, life reminded us all of the illusion of peace.</em></p>

<p>Another blast, this one closer. Off to the right. This time the windows rattled. People fled from the windows.</p>

<p><strong><em>Your</em></strong> ship started moving this time. We floated through the water, away from the port. The window blinds glowed an eerie red, illuminated by the destruction outside.</p>

<p><strong><em>Your</em></strong> officers asked me how I felt. 4 weeks later, I still don’t know what I was feeling, really; at first I thought I was numb to it. That if it was in the stars for me to perish, I would’ve done so that night. One moment alive, the next under water. But I realize I was not numb to it. In moments like these, your body takes control of your conscience and you enter a fugue state. Autopilot.</p>

<p>Only afterward do you grasp the damage done to your conscience. For that reason, I am grateful I found myself in <strong><em>your</em></strong> country in the aftermath.</p>

<p>The rest of the ride there was oddly serene. Some slept; others stared at the horizon, confronting how fragile and helpless we truly are. We were adrift in a boat, in the middle of the Strait of Hormuz. The Strait of Hormuz. The same place I had constantly read about on the news. “Volatile body of water”. “Threatens closure and disruption”.</p>

<p>When we finally got to Khasab, <strong><em>your</em></strong> captain informed us that because of the situation at the port, none of our luggage could make it. <strong><em>You</em></strong> had kept it safe back in Iran, away from the port.</p>

<p>For the residents of Oman, this was fine— they had homes and visas to stay. I was not a resident. The fact I was even on <strong><em>your</em></strong> boat was because of the sympathy of <strong><em>your</em></strong> officers. And now I was in <strong><em>your</em></strong> country, with my passport, phone, and practically nothing else. I was stunned and alone, too confused to fathom what was happening and what I would even begin to do.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-painting.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>Seascape with sailors sheltering from a rainstorm, by painter Bonaventura Peeters the Elder</div>
      </figcaption>
  </figure>

<p><em>And then, <strong>you</strong> reminded me I was in safe hands.</em></p>

<p>At customs, <strong><em>your</em></strong> officers assured me it would all be fine. They gave me numbers to communicate with and people to reach out to. <strong><em>You</em></strong> issued a temporary visa for me. Most of all, they gave me what I desperately needed—assurance.</p>

<p>I believe this protected my conscience, or at the very least mitigated the impact of the sights I had just seen.</p>

<p>The sun had started rising at the port. I remember recalling how beautiful the landscape was. On my right were rugged brown cliffs and shrubbery, and on my left was the wide ocean, a pale blue.</p>

<p><strong><em>You</em></strong> directed us towards buses, and we started heading away from the airport. Conversation soon filled the aisles as us passengers— bound by shared terror and relief— began to process what had happened. Everyone had a different perspective, be were all grateful; grateful that we were alive, and we had <strong><em>you</em></strong> to thank for that.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-night.jpeg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>22/6/25 03:52</div>
      </figcaption>
  </figure>

<p>We made it to Atana Khasab— the hotel <strong><em>you</em></strong> had allocated for us. We were rushed to the buffet while the receptionists prepared rooms for us.</p>

<p>It was grim, really. But I remember finding it so funny at the time. Perhaps it’s in poor taste to find humor in war and destruction, but I was genuinely amused by the absurdity of it: just hours ago, I had been trapped in a warring Iran, running on nothing but willpower, begging for a place on <strong><em>your</em></strong> boat. And now, here I was in peaceful Oman, eating braised salmon at a luxury hotel.</p>

<p>What I suppose I mean is— I felt so untethered from my life. I felt like an observer, watching forces shove and nudge my body across the world. I had quite literally lost control of the steering wheel. I didn’t know what the next hour would bring, let alone tomorrow. And the stark difference between that feeling— the lack of control, the helplessness— and the life I once knew struck me as, in some macabre way, funny.</p>

<p>Artist Bo Burnham once called it <a href="https://www.youtube.com/watch?v=ObOqq1knVxs" target="_blank" class="link">“that funny feeling”</a>— <em>total disassociation, fully out your mind. googling derealization, hating what you find.</em></p>

<p>I didn’t really know what I was, only that I was fully disassociated. A violent quake had come and split my life into <em>pre-</em>war and <em>post-</em>war Faisal— and I wasn’t in control of what was happening to <em>post-</em>war Faisal.</p>

<p>But I was, yet again, assured by <strong><em>your</em></strong> delegation that everything would be alright. I suppose I had lost control of the steering wheel, but I’m grateful <strong><em>you</em></strong> had reached out and taken hold.</p>

<p><em>In that way, <strong>you</strong> reminded me yet again, that I was in safe hands.</em></p>

<p>In my room, I rinsed the chaos from my skin, hand-washed my only set of clothes, and fell onto the bed, weightless. Through the window, I watched the sea breathe, the waves catching the first hints of dawn. Birds began to sing and pierced the stillness of my mind. The sky, bruised with the memory of night, began to brighten.</p>

<p>And somewhere between the ocean’s breath and the chorus of mo(u)rning, I drifted to sleep.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-hotel.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>22/6/25 05:24</div>
      </figcaption>
  </figure>

<p>I woke up to the ring of the hotel telephone.</p>

<p><em>“Breakfast is served! Make sure to come grab a bite before leaving for Muscat.”</em></p>

<p>I slipped into my barely dry clothes, gathered the few belongings I had, headed downstairs. Despite all that had happened, I had an insatiable appetite. I piled two plates up with food and sat in the smoker’s lounge. I don’t smoke; I just wanted to be around other people. I didn’t want to be alone with my thoughts.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-breakfast.jpeg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>22/6/25 10:45</div>
      </figcaption>
  </figure>

<p>I started feeling alive again. Breakfast in front of the turquoise sea— the horizon splitting the view into two different shades of blue— one noticeably darker, more mysterious than the other. <em>pre-</em>war and <em>post-</em>war me, I thought. The panorama of blue was ocassionally joined by the earthy wafts of steam rising from my cup of coffee. Now and then, a thread of cigarette smoke pierced through the lounge, sooty and deep, keeping me grounded to reality. The sounds of people conversing in Farsi, talking about their relatives or homes. And maybe, just maybe,</p>

<p>I saw someone’s eyes crease as they let out a hearty laugh.</p>

<p>And for that instant, I let myself believe in safety again,</p>

<p><em>because of <strong>you</strong>.</em></p>

<p>Like all good things, my moment of peace eventually came to an end. But it filled me with warmth and security— feelings I craved far more intensely than my gnawing hunger.</p>

<p>We boarded <strong><em>your</em></strong> buses yet again, this time bound for the airport. As we pulled into the departures entrance, I quickly realized that this was no regular terminal. <strong><em>You</em></strong> were escorting us aboard <strong><em>your</em></strong> own Royal Airforce.</p>

<p>Again, that funny feeling bubbled up in me. How surreal this journey had been, and how much stranger it was about to become, being carried to safety by a royal aircraft. Who would’ve even thought? Just 2 weeks ago, I was enjoying Iran, surrounded by family. Now, I was somehow in Oman, alone, slowly losing control. But perhaps losing control of the trajectory of my life wasn’t so bad, as long as <strong><em>you</em></strong> were steering the course.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-warship.jpeg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>22/6/25 13:17</div>
      </figcaption>
  </figure>

<p>We were guided across the tarmac towards the silhouette of <strong><em>your</em></strong> <em>Lockheed C-130 Hercules</em>. I remember thinking of how well the sand-green camouflauge worked. The military plane almost melted into the mountains behind it, only <strong><em>your</em></strong> flag interrupting the illusion. <em>That funny feeling</em> possessed my body. I sank into the seat, weightless, resigned to forces far greater than myself.</p>

<p>As the engine started and rumbled, our bodies were pressed into the seat, subjected to force of weightlessness. Oh, the mysterious mechanics through which life operates. How did I end up on the <strong><em>Omani Royal Air Force’s warplane</em></strong>?</p>

<p>Answering myself, I whispered part of an old quatrain I had memorized.</p>

<blockquote class="fxhw-quote">
  <p class="quote-text">
    <p class="quote-text" dir="rtl" style="color: rgba(239, 203, 203, 0.925); letter-spacing: 2.5px;">با چرخ مکن حواله کاندر ره عقل<br />
    چرخ از تو هزار بار بیچاره‌تر است</p><br />
Blame not the heavens through the reasoning mind,<br />
For the heavens are a thousand times more wretched than you.
  </p>
  <span class="quote-author">— Khayyam, Quatrain 48</span>
</blockquote>

<p>Perhaps that illusion of peace— the one life had shattered without hesitation— came from thinking the heavens had our best interests in mind. That they were gentler than our world. Our world, enraptured by war, riddled with destruction, steeped in inequality. But they were not. Their decrees were, if anything, a thousand times more chaotic and indifferent than we could bear to imagine.</p>

<p>I repeated this couplet to myself, until I felt the stillness of sleep take over my body once more. Through clenched teeth, I whispered it again and again, a chorus of mourning against the engine’s chorus of war.</p>

<p>And I drifted off to this duet of chaos and resignation.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width:70%" src="/assets/images/oman-peep.jpeg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>22/6/25 14:41</div>
      </figcaption>
  </figure>

<p>I instantly knew that we had landed when the ramp of plane opened and the humid, sticky air filled the cargo hold. I jolted awake and looked around, half-expecting it all to be a dream.</p>

<p>We were led to the arrivals terminal. For many, the journey was over— they were residents. But what home did I have in a city I had never set foot in before?</p>

<p>I spoke with <strong><em>your</em></strong> officers about what would come next. They told me that <strong><em>you</em></strong> would be in touch and inform us as soon as our luggage arrived. I got the feeling that I was on my own now, finally responsible for what would come next.</p>

<p>I installed <strong><em>your</em></strong> country’s analog to Uber, <em>Yango</em>, and ordered a cab to the cheapest hotel I could find.</p>

<p>I assumed the pleasantries were over. That <strong><em>your</em></strong> plan for me had run its course. I’d been handed back the steering wheel, sent off in a direction unknown.</p>

<p>But then Ahmad— the Omani Yango driver picking me up from the airport— noticed.</p>

<p>Ahmad realized something was off immediately and asked what was wrong. I wasn’t exactly in the mood to describe everything; I just said I was going through a rough spot. He asked how I’d learned Arabic despite not being Arab, and I briefly explained my upbringing. He listened with so much sincerity and patience, then said:</p>

<p>“I live here and know people. You are our guest. If you ever need anything, we are here to serve you.”</p>

<p>And perhaps he was just offering. Being polite. But it stuck with me.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-beach.jpeg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>25/6/25 19:22</div>
      </figcaption>
  </figure>

<p>Ahmad was the first person I met outside of the chaos of war, and he reminded me life could still be normal, peaceful even. But beyond that, he also set the tone for my unplanned stay in <strong><em>your</em></strong> country.</p>

<p>I didn’t know it yet, but I would feel that same generosity again in Oman. And again. And again. In fact, every single local I met was unbelievably welcoming. It didn’t feel like mere formality— these people, <strong><em>your</em></strong> people were genuinely concerned, eager to help in any way they could.</p>

<p>And it wasn’t even out of pity— I didn’t tell any of them how I ended up in Oman. These people rushed to help someone they didn’t even know. All they knew was I was visiting, and that was enough for them to immediately offer whatever they could.</p>

<p>I wasn’t expecting pity— let alone kindness. I wasn’t expecting anything at all, really. After everything that had unfolded, I had almost forgotten what kindness really felt like. What surprised me was that the kindness I encountered wasn’t out of pity or obligation— it was genuine kindness, a sincere eagerness to help someone out, just because you can. <em>A choice to be good.</em> <strong><em>Your</em></strong> people reminded me of that.</p>

<p>I could write a whole book about the sheer kindness I experienced during my stay in Oman, but even that would fail to describe what it felt like being surrounded by <strong><em>your</em></strong> people.</p>

<p>If I were to try to describe it, however, the word I’d use is peace. I felt at peace. Despite everything, despite the displacement, despite the bombing, despite it all, I felt at peace in <strong><em>your</em></strong> land.</p>

<p>Ahmad, like almost every other cab driver, did not accept payment for the ride. They insisted. Gave me their phone numbers.</p>

<p>At the hotel, the manager upgraded my room for free. The receptionist gave me his charger until I could buy one.</p>

<p>Other cab drivers offered coffee, tea, dinner. Very few of them accepted payment.</p>

<p>Sales associates at <a href="/2025/07/02/amouage.html" target="_blank" class="link">Amouage</a> gave me extra samples, never got bored of seeing me. When I paid with cash and they didn’t have change, they ran to an exchange spot to make change for me.</p>

<p>When I was alone at the beach, people came up and talked, bought me drinks.</p>

<p>One elderly gentleman even insisted I pray with him at <strong><em>your</em></strong> Sultan Qaboos Mosque.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-mosque.jpeg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>29/6/25 19:02</div>
      </figcaption>
  </figure>

<p>These interactions made me feel at <strong><em>peace</em></strong>, but I was also dumbfounded. The contrast between what my life was a few days ago and what it had started to become, what had formed around me, was abrupt. War had shattered my perception of peace. But <strong><em>you</em></strong> reframed it. Rebuilt it.</p>

<p>And with the real war quieting down, I started to feel in control over myself again. Over where I was, where I’d go, what’d happen next. I began tracking my luggage using Find My, since my MacBook was inside one of the bags.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 70%" src="/assets/images/oman-mac.png" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>25/5/25 13:50</div>
      </figcaption>
  </figure>

<p>And what was initially a feeling of dread— of being alone in a foreign country— turned into one of odd serenity. I was still alone, sure. But <strong><em>you</em></strong> and <strong><em>your</em></strong> people helped me take back the wheel, and I was so deeply grateful for that. At one point, I even found myself hoping the luggage would take longer to arrive, just so I could keep wandering Muscat and meet more people.</p>

<p>After 8 days of wandering Oman in awe, my screen lit up: my MacBook was in Muscat. A notification came through. My luggage had arrived.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 70%" src="/assets/images/oman-found.png" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>30/6/25 08:39</div>
      </figcaption>
  </figure>

<p>It was a bittersweet moment, but I booked my flight back to Doha for later that afternoon.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-bye.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>30/6/25 15:24</div>
      </figcaption>
  </figure>

<p>8 days ago, I was on board a military transport plane. Now I was sitting on the window seat of a SalamAir commercial airplane. I reflected on what I had felt last time. <em>That funny feeling</em>. I had come full circle. Oh, the quiet way in which life— almost mechanically— becomes symmetric. How funny, to be airborne again. I recalled the Khayyam quatrain once more, but now the full quatrain, complete with the first couplet.</p>

<blockquote class="fxhw-quote">
  <p class="quote-text">
    <p class="quote-text" dir="rtl" style="color: rgba(239, 203, 203, 0.3); letter-spacing: 2.5px;">
      <strong style="color: rgb(235, 214, 214);">نیکی و بدی که در نهاد بشر است<br />
      شادی و غمی که در قضا و قدر است</strong><br /><br />
      با چرخ مکن حواله کاندر ره عقل<br />
      چرخ از تو هزار بار بیچاره‌تر است
    </p><br />
    <strong style="color: rgb(235, 214, 214);">The good and evil that dwell in human nature,<br />
    The joy and sorrow decreed by fate and destiny—</strong><br /><br />
<p style="color: rgba(239, 203, 203, 0.3);">    Blame not the heavens through the reasoning mind,<br />
    For the heavens are a thousand times more wretched than you.</p>
  </p>
  <span class="quote-author">— Khayyam, Quatrain 48</span>
</blockquote>

<p>I had previously resigned myself to the wretched decrees of heaven in that warplane. Blamed them for the mercilessness of the universe. But now, suspended over a calmer sky, I realized that the quatrain began inwards, not outwards. It doesn’t open with the stars or heaven or fate, but with the good and evil in human nature. Before destiny ever intervenes, we are already made of choice. Even if sorrow is written in the stars, goodness is not. Goodness is a choice. It lives in the same human nature that holds cruelty, and it cannot be imposed by the heavens or excused by them either.</p>

<p><strong><em>Your</em></strong> people chose goodness. Against the cosmos’ decree of sorrow, they choose it. Again and again. And that taught me that even if fate may define the conditions, it is human nature that determines the response.</p>

<p>And now I realize that the quatrain never blamed the heavens— they are a thousand times more wretched than us. It pitied them. <em>They</em> are a thousand times more wretched than us. That line used to feel bitter to me. Resigned. But I think on this SalamAir commercial plane– of all places— I finally understood it. The line wasn’t about surrender, it was about letting go of blame, and finding meaning in the only thing we ever truly hold: the self.</p>

<p>I repeated the full couplet to myself, softly this time. I felt the peacefulness of sleep take over my body, slowly. Through relaxed teeth, I sang it again and again, letting its completeness— my newfound understanding of it— carry me.  The engines on this plane hummed too, but they no longer drowned me out. I let the couplet join their hum, not as a chorus of mourning, but one of meaning.</p>

<p>And I drifted off to this duet, knowing that being carried was enough.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/oman-sky.jpeg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>30/6/25 17:32</div>
      </figcaption>
  </figure>

<p>And so, dearest <strong><em>Oman</em></strong>, I am eternally grateful for what you did to me.</p>

<p><em>In June, I was forcefully made aware of the illusion of peace. <strong>you</strong> showed me what it truly looked like.</em></p>

<p>That peace was not silence or distance.</p>

<p>Not numbness or indifference either.</p>

<p>That peace was the quiet strength of people who choose goodness against the odds.</p>

<p>That peace was in the warmth of the tea offered to strangers.</p>

<p><strong><em>You</em></strong> taught me that peace is not the absence of sorrow—</p>

<p>Sorrow was an inextricable part of peace,</p>

<p><em>peace is what we do with it</em></p>

<p><br /><br /><br /></p>

<p><em><strong>Yours</strong> truly,</em></p>

<p><em>Faisal Toosan</em></p>]]></content><author><name></name></author><category term="perfume" /><category term="social" /><summary type="html"><![CDATA[Dear Oman,]]></summary></entry><entry><title type="html">AMOUAGE</title><link href="/2025/07/02/amouage.html" rel="alternate" type="text/html" title="AMOUAGE" /><published>2025-07-02T00:00:00+03:00</published><updated>2026-06-27T00:46:50+03:00</updated><id>/2025/07/02/amouage</id><content type="html" xml:base="/2025/07/02/amouage.html"><![CDATA[<p><em id="fl">T</em>his year introduced me to new passions and hobbies I never thought I’d entertain.</p>

<p>Perfume was one of them.</p>

<p>I never thought I would spend such a significant chunk of my money on perfume. Or that I’d spend hours reading about the <em>linearity</em> of a perfume, its <em>sillage</em>, or its <em>projection</em>. Past me would cackle and label present me pretentious. <em>Sillage? Really?</em></p>

<p>However this obsession with perfumery and fragrances snuck up on me silently, and before I knew it I was buying stands for my perfumes.</p>

<p>Since then, I’d like to think my addiction has slowed down. But there is still one perfume house I always circle back to. One whose <em>sillage</em> and <em>projection</em> I’d gladly be pretentious over.</p>

<p>That perfume house is Amouage.</p>

<h1 id="amouage--omani-heritage">Amouage &amp; Omani Heritage</h1>

<p><a href="https://amouage.com" target="_blank" class="link">The House of Amouage</a> was born in Oman in 1983, under the rule of Sultan Qaboos bin Said Al Said. Commisioned with the aim of preserving Oman’s rich history in global frankincense trade, Amouage has grown into one of the most luxurious and sought after perfume brands.</p>

<p>Oman’s history as a hub in the trade of frankincense and myrrh is central to Amouage’s identity— many of its perfumes feature a smoky frankincense note as a nod to that heritage.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" src="/assets/images/amouage-origin.webp" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>the boswellia sacra, or frankincense tree. image from <a href="https://amouage.com/pages/our-philosophy" target="_blank" class="link">Amouage's website</a></div>
      </figcaption>
  </figure>

<p>Interestingly, while the house’s roots are deeply Omani, the noses behind its creations are often Western— perfumers like Guy Robert, Pierre Negrin, and Quentin Bisch craft Amouage’s scents using rare and traditional Eastern ingredients: oud, amber, myrrh, and most iconically, frankincense.</p>

<p>Branded as “The Gift of Kings”, Amouage offers fragrances that are bold, nuanced, and unapologetically luxurious. In reviving the traditions of Arabian perfumery and marrying them with modern expertise, the house has built a legacy on the meeting point between East and West.</p>

<blockquote class="fxhw-quote">
<p class="quote-text">Frankincense is part of Oman’s identity. You smell it at the airport, in people’s homes— it’s everywhere. It’s also the signature that unifies our work at Amouage.</p>
  <span class="quote-author">— Renaud Salmon, Creative Director at Amouage</span>
</blockquote>

<figure class="figure-default">
   <img class="expandable-image image-default" src="/assets/images/amouage-frank.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>omani frankincense. image from <a href="https://www.instagram.com/p/DHA5dJRNl0f/" target="_blank" class="link">Amouage's social media</a></div>
      </figcaption>
  </figure>

<h1 id="discovering-amouage"><em>Discovering Amouage</em></h1>

<p>I had always known of Amouage— their small stand at Doha’s airport always seemed full of people— but I had never really experienced any of their fragrances.</p>

<p>That was until earlier this year when my perfume hobby started. I started researching Amouage and their fragrance collections.</p>

<p>Amouage— <em>waves</em> in Arabic— had, by far, the most overwhelmingly positive reviews. People would gush over it in the reviews, and I thought they were simply exaggerating, as many perfume enthusiasts do.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" src="/assets/images/amouage-boutique.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div><a href="https://www.theplan.it/eng/award-2023-Retail/the-eclipse-bringing-emotion-and-visual-gravity-through-uncompromising-brutalism-herone" target="_blank" class="link">Amouage's boutique</a> in the Mall of Oman</div>
      </figcaption>
  </figure>

<p>I decided to pick up a bottle, just to see what it was all about. I checked and found a retail store selling a full bottle of <em>Interlude Man</em> for a decent price.</p>

<h2 id="interlude"><em>Interlude</em></h2>

<blockquote class="fxhw-quote">
<p class="quote-text">I interpret what I see and feel into scents. All the social and natural chaos and disorder surrounding us today can be translated to a much more intimate level. The interlude moment is a reflection of all the trials and tribulations one overcomes to attain personal satisfaction and achievement.</p>
  <span class="quote-author">— Christopher Chong, former Creative Director at Amouage</span>
</blockquote>

<figure class="figure-default">
   <img class="expandable-image image-default" src="/assets/images/amouage-interlude-box.webp" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div><a href="https://amouage.com/products/interlude-man-100ml?pr_prod_strat=e5_desc&amp;pr_rec_id=dcc4a4044&amp;pr_rec_pid=8897004044580&amp;pr_ref_pid=8897012433188&amp;pr_seq=uniform" target="_blank" class="link">Interlude Man Box</a></div>
      </figcaption>
  </figure>

<p>When I recieved <em>Interlude</em>, I was immediately blown away by the packaging.</p>

<p>With niche perfumery, you expect purposeful, intentful presentation, especially when you dish out over 380 USD for a perfume. And of all niche perfumes I’ve purchased, Amouage easily takes the cake for the most gorgeous packaging.</p>

<figure class="figure-default">
     <img class="expandable-image image-default" src="/assets/images/amouage-box-me.jpg" /> 
        <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
        <div>unboxing Interlude, my own image</div>
        </figcaption>
    </figure>

<p>The bottle itself blew me away too.</p>

<p>Styled like a traditional Omani dagger— a <em>Khanjar</em>— the flacon is adorned with the Amouage emblem, a 12 pointed star. The cap is weighty and crowned with a gorgeous sapphire blue Swarovski crystal, also reflecting Khanjar patterns.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 70%" src="/assets/images/amouage-interlude.webp" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div><a href="https://amouage.com/products/interlude-man-100ml?pr_prod_strat=e5_desc&amp;pr_rec_id=dcc4a4044&amp;pr_rec_pid=8897004044580&amp;pr_ref_pid=8897012433188&amp;pr_seq=uniform" target="_blank" class="link">Interlude Man:</a>
29% oil concentration, 6 weeks ageing: 3 weeks maceration, 3 weeks maturation</div>
      </figcaption>
  </figure>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 60%" src="/assets/images/amouage-khanjar.webp" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>the traditional Omani Khanjar. <a href="https://www.zawya.com/en/life/culture/omans-khanjar-gets-world-heritage-status-i5psormi" target="_blank" class="link">source</a></div>
      </figcaption>
  </figure>

<p>Even before spraying, <em>Interlude</em> made its presence known.
As I removed the cap, a wave of incense hit me; resinous, deep incense.</p>

<p>I sprayed it once on my wrist and took a whiff.</p>

<p>I still don’t know what <em>Interlude</em> smells like, exactly. But I had read about how frankincense was harvested, and I think it serves as a great analogy to the fragrance’s profile.</p>

<h3 id="interlude--harvesting-frankincense"><em>Interlude</em> &amp; harvesting <em>frankincense</em></h3>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 80%" src="/assets/images/amouage-tree.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div><a href="https://seedsforgarden.com/products/5-boswellia-sacra-seeds-frankincense-tree-seeds-10-boswellia-serrata-indian-frankincense-seeds" target="_blank" class="link">image source</a></div>
      </figcaption>
  </figure>

<p>a lone <em>boswellia sacra</em> tree stands in the sun-parched Omani landscape. the frankincense tree stands, alone. a testament to resilience.</p>

<p>a harvester approaches.</p>

<p>he is immediately hit by notes of sharp, medicinal greenery. not lush, ripe greenery, but rather sharpened, angular, dry, spiced greenery which draws him closer— not gently though.</p>

<div class="sidebar"><div class="sidebar-content">Interlude, like the tree, opens with spicy-green top notes of <span class="alert">Oregano</span>, <span class="alert">Pepper</span>, and <span class="alert">Bergamot</span>. The Oregano loudly clashes with the presence of the Bergamot, making the first few whiffs of Interlude feel scorched and spicy. This makes interlude smell very much like potent turmeric in the first hour.</div></div>

<div class="sidebar"><div class="sidebar-content">In the background, like the dusty terrain surrounding the tree, notes of a humble <span class="alert">Patchouli</span> and dry <span class="alert">Oud</span> pierce the top notes of greenery. <span class="alert">Leather</span> is also present.</div></div>

<p>the harvester draws his <em>mengaf</em>, a curved blade.
he strikes the tree, cutting through the bark, exposing its pale flesh. the tree bleeds.</p>

<div class="sidebar"><div class="sidebar-content">Just like that, Interlude dissipates. The freshness of the opening matures into something denser. The top notes bleed away, leaving behind the heart notes of <span class="alert">Frankincense</span> and <span class="alert">Amber</span>, dark and smoky. The scent is no longer sharp--- it’s heated, wounded, chaotic. And from the wounds bleed something completely new--- an almost bitter-sweet, layered resinous scent.</div></div>

<div class="sidebar"><div class="sidebar-content">Despite this, the herbal aspect of Interlude never completely disappears. The tree doesn't die as a result of being cut. The greenery in Interlude just dries down into something more tangy, cold, layered.</div></div>

<p>frankincense, a resin meant to protect the tree against foreign predators, bleeds from the tree. it also serves to prevent the tree from losing its most valuable resource: water.</p>

<p>as the exposed resin dries, it crystallizes into frankincense.</p>

<div class="sidebar"><div class="sidebar-content">So too does Interlude begin to crystallize. The chaos mellows. The Amber grounds it. The Frankincense smolders rather than burns. This part of the fragrance feels like watching the tree close over a wound. Slow, deliberate, wise. Exposed, but healing and emanating whiffs of a bitter citrus as it does.</div></div>

<figure class="figure-default">
   <img class="expandable-image image-default" src="/assets/images/amouage-harvest.webp" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>Oman guide collecting frankincense - Copyright Anantara - <a href="https://www.euronews.com/travel/2024/12/30/frankincense-i-uncovered-the-story-behind-the-traditional-christmas-scent-on-a-trip-to-oma" target="_blank" class="link">source</a></div>
      </figcaption>
  </figure>

<p>over time, the tree heals and regenerates a layer of bark where it was struck.</p>

<p>then, the harvester returns. he strikes the tree again, harvesting the frankincense and creating new cuts. this process is repeated several times. each time, the frankincense becomes more concentrated, more fragrant.</p>

<div class="sidebar"><div class="sidebar-content">Finally, Interlude settles into unexpected harmony. The Leather and Oud, almost charred, work beautifully well together, wrapping you in a cloak of security and protection. I do not personally sense any 'chaos' from the perfume after 4-5 hours</div></div>

<p><em>The harvester is gone.</em></p>

<p><em>And the tree, again, begins to heal.</em></p>

<h3 id="interlude-performance"><em>Interlude</em> performance</h3>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 70%" src="/assets/images/amouage-interlude-flame.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>source: <a href="https://www.instagram.com/p/DCMMdhktO9x/" target="_blank" class="link">Amouage's social media</a></div>
      </figcaption>
  </figure>

<p>As with all Amouage perfumes, the performance on <em>Interlude</em> is stellar. In fact, Interlude might be the best performing Amouage.</p>

<p>On skin, I get 6-8 hours of consistent projection before it settles into a bitter-herbal skin scent.</p>

<p>On clothes, it is eternal: it literally will not dissipate until you wash the article of clothing.</p>

<p>I use 2-3 sprays max on pulse points during the colder seasons. This would probably suffocate in closed, hot spaces.</p>

<p>Very lingering <em>sillage</em> too, and the perfume exudes presence as you move. You don’t wear <em>Interlude</em> as much as you <em>carry</em> it with you.</p>

<p>Overall, it is very easy to let <em>Interlude</em> wear you, not the other way around. It is genuinely a very challenging perfume to wear. It is, definitionally, a statement perfume.</p>

<p>Unapologetically dark and smokey, <em>Interlude</em> does not demand you understand it at all. But in my opinion <em>Interlude</em> tells a tale of pain, rupture, chaos, repair, beauty. And if you want to witness that, then <em>Interlude</em> is a masterpiece worth enduring.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 70%" src="/assets/images/amouage-interlude-insta.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>Interlude. <a href="https://www.instagram.com/p/DGsa6nuNQoJ/?img_index=2" target="_blank" class="link">source</a></div>
      </figcaption>
  </figure>

<h1 id="decision"><em>Decision</em></h1>

<blockquote class="fxhw-quote">
<p class="quote-text">Uncompromising, distinctive and incandescent, Decision captures the paradox that lies at the core of all of life’s most powerful decisions: it is focused on its goal while remaining open to countless possibilities.</p>
  <span class="quote-author">— Amouage</span>
</blockquote>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 70%" src="/assets/images/amouage-foreshadow.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div></div>
      </figcaption>
  </figure>

<p>After falling in love with <em>Interlude</em>, all other perfumes smelled dull to me. I have not bought any perfumes since buying <em>Interlude</em>.</p>

<p>Except <em>Decision</em>, also by Amouage.</p>

<p>Against all odds and decisions, <a href="https://www.faisaltoosan.com/2025/07/30/to-oman.html" target="_blank" class="link">I found myself in Oman recently.</a> Oman, the birthplace of Amouage.</p>

<p>There, I got to wander the old souq of Mutrah. I was bombarded by a thousand different scents. Piles of real frankincense, sold by the kilogram. Vendors begging you to try their perfume oils. Potent spices piled up in neat dunes.</p>

<p>I also visited several Amouage boutiques. I think I visited so many times that the representatives genuinely got bored of seeing me there so often.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 70%" src="/assets/images/amouage-gift.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div></div>
      </figcaption>
  </figure>

<p>And 2 days before I left Oman, I smelled <em>Decision</em>.</p>

<p>I had walked in to buy a dark, brooding perfume like <em>Interlude</em>, maybe <em>Memoir</em> or <em>Epic</em>. But the representative, after hearing I already owned Interlude, recommended <em>Decision</em>.</p>

<p>I <em>decided</em> to try <em>Decision</em>.</p>

<h2 id="apex-of-oman-jabal-shams">Apex of Oman, Jabal Shams</h2>

<p>Renaud Salmon, Creative Director at Amouage, shares the scene that inspired this perfume.</p>

<p>He describes his journey to Jabal Shams, the highest peak in Oman, rising over 3000 meters.</p>

<blockquote class="fxhw-quote">
<p class="quote-text">“When I arrived at the base of the mountain and started walking,” says Salmon, “something caught my eye. Across the terrain were what looked like conifers at first, but when I got closer to them, I saw they were juniper trees – their branches twisted into unusual shapes.” Many junipers are survivors of electrical storms, struck by lightning that turns their sap into steam, causing the bark to split and fossilise. Legend says that these trees carry a mystical quality, and their wood is sometimes also used to burn at home like frankincense.</p>
  <span class="quote-author">— Renaud Salmon, to Vogue Arabia</span>
</blockquote>

<div class="sidebar"><div class="sidebar-content">Immediately, on the first whiff, I was hit by a wave of <span class="alert">Citrus</span>, almost overbearing. The citrus here smells alive, unripe. If Interlude's citrus was dark, bitter, dry, then Decision's citrus was light, unripe, bright. There's also a photorealistic <span class="alert">Metallic</span> note in Decision, contrasting the freshness of the <span class="alert">Juniper</span>. Bursting with life, Decision almost captures a snapshot of citrus in motion—like metallic, glimmering lightning striking a lush tree. </div></div>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 75%" src="/assets/images/amouage-juniper.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>a Juniper tree, struck by lightning. from <a href="https://www.instagram.com/p/DG0RPbstc0g/?img_index=1" target="_blank" class="link">Amouage's social media.</a></div>
      </figcaption>
  </figure>
<blockquote class="fxhw-quote">
<p class="quote-text">After this striking opening, the light spreads further, aided by the gleaming sheen of Atlas Cedarwood.</p>
  <span class="quote-author">— Amouage</span>
</blockquote>

<div class="sidebar"><div class="sidebar-content">But that wasn't the only contrast to Interlude. As the citrus faded, it revealed a woody <span class="alert">Frankincense</span> note that was the complete opposite of the charred, smokey myrhh in Interlude. <span class="alert">Incense</span> is also present, but it is tame, subdued in the presence of the metallic note. It felt as though the <span class="alert">Resins</span> in Decision were not forced out by a harvester, as in Interlude. They felt voluntary—like the tree made a conscious decision to gift its own ichor. </div></div>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 80%" src="/assets/images/amouage-juniper-closeup.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>bark of a Juniper tree. from <a href="https://www.instagram.com/p/DG0RPbstc0g/?img_index=1" target="_blank" class="link">Amouage's social media.</a></div>
      </figcaption>
  </figure>

<blockquote class="fxhw-quote">
<p class="quote-text">Finally, a warm Vanilla in the base conveys the profoundly liberating effect of acceptance.</p>
  <span class="quote-author">— Amouage</span>
</blockquote>

<div class="sidebar"><div class="sidebar-content">In the distance, I begin to smell a lively, mint-like <span class="alert">Patchouli</span>. It plays wonderfully with the resins and gave the perfume a quiet air of sophistication and complexity. The <span class="alert">Vanilla</span> doesn’t emerge until about an hour in, and contrary to the official description, it isn’t warm. It feels cold—frozen there by the metallic “lightning” note that arcs through the fragrance.</div></div>

<p><em>Most trees die when struck by lightning.</em></p>

<p><em>But the Juniper tree decides to live.</em></p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 80%" src="/assets/images/amouage-decision-official.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>Decision, on <a href="https://www.instagram.com/p/DHIX9EJtcHt/" target="_blank" class="link">Amouage's social media</a></div>
      </figcaption>
  </figure>

<h2 id="decision-performance"><em>Decision</em> performance</h2>

<p><em>Decision</em> is no <em>Interlude</em> in projection and sillage. Its more calm, less theatrical and doesn’t really seek to prove anything loudly as with <em>Interlude</em>. If <em>Interlude</em> was the scent of tragedy and healing, then <em>Decision</em> is the breath of calm after deciding to heal.</p>

<p>On skin, <em>Decision</em> performs moderately well, projecting loudly for 3-4 hours before becoming a present yet tamed scent. After 9 hours, it becomes a creamy-spicy skin scent.</p>

<p>On clothes, this might perform even better than <em>Interlude</em>. It sticks around forever and refuses to let go. I sprayed <em>Decision</em> once on my watch’s strap when I bought it, and almost 2 weeks later, I can still smell it.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 75%" src="/assets/images/amouage-decision-unboxing.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>unboxing Decision, my own image</div>
      </figcaption>
  </figure>

<p>I can see <em>Decision</em> worn in every season, just maybe not during peak heat, where the sweetness of the resins could become overbearingly cloying. Otherwise, go heavier on the trigger with 4-6 sprays.</p>

<p>The sillage is moderate on <em>Decision</em>, and I help it linger a bit more by doing a spray on my nape.</p>

<p>However, this perfume is still not an easy wear. The metallic-sweet note can be off-putting or clinical to some, but if you found <em>Interlude</em> wearable, then <em>Decision</em> comes as gentler, cooler, and more restrained.</p>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 60%" src="/assets/images/amouage-decision-detail.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>embossed packaging of Decision, my own image</div>
      </figcaption>
  </figure>

<p>Some believe lightning is punishment, divine wrath.</p>

<p>But in <em>Decision</em>, Amouage reinterprets lightning as revelation.</p>

<p>The fragrance strikes first with unripe citrus, split suddenly by metal.
And yet, it never feels angry.
The frankincense and resins ground it— composed, restrained.</p>

<p>If <em>Interlude</em> was a wound torn open, a chaotic bleeding of heat and smoke, <em>Decision</em> is the scar that remains after healing.</p>

<p>It doesn’t shout. It doesn’t demand.</p>

<p>It simply is— clear, measured, whole.</p>

<p>Wearing <em>Interlude</em> feels like being possessed by fire.</p>

<p>Wearing <em>Decision</em> feels like standing in the aftermath of lightning, unburnt.</p>

<p>Decision is not about destruction.
It is about clarity,</p>

<p>about choosing to live after the storm—
and finding beauty in what remains.</p>

<style>
    .instagram-wrapper {
  display: flex;
  justify-content: center; /* Center the blockquote */
  width: 100%; /* Take up full width of parent */
  margin: 20px 0; /* Optional spacing above/below */
}

.instagram-media {
  width: 80% !important;
  max-width: 540px !important;
  min-width: 300px;
}

</style>

<div class="instagram-wrapper">
<blockquote class="instagram-media" data-instgrm-captioned="" data-instgrm-permalink="https://www.instagram.com/reel/DJgQ4SMoQ11/?utm_source=ig_embed&amp;utm_campaign=loading" data-instgrm-version="14" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:16px;"> <a href="https://www.instagram.com/reel/DJgQ4SMoQ11/?utm_source=ig_embed&amp;utm_campaign=loading" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank"> <div style=" display: flex; flex-direction: row; align-items: center;"> <div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;"></div></div></div><div style="padding: 19% 0;"></div> <div style="display:block; height:50px; margin:0 auto 12px; width:50px;"><svg width="50px" height="50px" viewBox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-511.000000, -20.000000)" fill="#000000"><g><path d="M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631"></path></g></g></g></svg></div><div style="padding-top: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;">View this post on Instagram</div></div><div style="padding: 12.5% 0;"></div> <div style="display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;"><div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);"></div> <div style="background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;"></div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);"></div></div><div style="margin-left: 8px;"> <div style=" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;"></div> <div style=" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)"></div></div><div style="margin-left: auto;"> <div style=" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);"></div> <div style=" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);"></div> <div style=" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);"></div></div></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;"></div></div></a><p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;"><a href="https://www.instagram.com/reel/DJgQ4SMoQ11/?utm_source=ig_embed&amp;utm_campaign=loading" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;" target="_blank">A post shared by AMOUAGE (@amouageofficial)</a></p></div></blockquote>
<script async="" src="//www.instagram.com/embed.js"></script>
</div>

<h1 id="tangent-on-the-pretentious-nature-of-perfume-hobbies">tangent on the ‘pretentious’ nature of perfume hobbies</h1>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 90%" src="/assets/images/amouage-harvest.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>rose harvest on Jabal Akhdar, source: <a href="https://www.instagram.com/p/DIneweptc2G/?img_index=1" target="_blank" class="link">Amouage's social media</a></div>
      </figcaption>
  </figure>

<p>I am well aware how out of touch and ostentatious a perfume hobby may seem. Spending hours reading about fragrances, spending unimaginable sums of money on what, to most people, is scented alcohol; all this talk of <em>projection</em> and <em>sillage</em>. It all seems so bourgeois and insane.</p>

<p>But I encourage you to look at it in a different lens: Our sense of smell is one of our main 5 senses that structure how we experience the world.</p>

<p>We spend hundreds— even thousands— on <strong>sight</strong> (fashion, apparel), <strong>sound</strong> (headphones, concert tickets), <strong>touch</strong> (fabrics, furniture), and <strong>taste</strong> (fine dining).</p>

<p>All of these are demonstrations of consumerism, I understand. But we appease all these senses with little social consequence. No one bats an eye when you spend 300 USD+ on a pair of Sony Headphones or 100 USD on a night out.</p>

<p>But when it comes to <strong>smell</strong>, one of the most intimate and emotional senses, indulgence becomes ‘pretentious’.</p>

<p>A common counterargument is that perfumes are rapid consumables. However, a well-made fragrance offers years of use. At 100ml, you’re looking at around 1000–1200 sprays— that’s three years of scent if you apply it three times a week.</p>

<p>Perfume, in that sense, is actually one of the more <em>enduring</em> luxuries.</p>

<h1 id="amouage">AMOUAGE</h1>

<figure class="figure-default">
   <img class="expandable-image image-default" style="width: 75%" src="/assets/images/amouage-hilt.jpg" /> 
      <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
      <div>khanjar hilt, source: <a href="https://www.instagram.com/p/DCMMdhktO9x/" target="_blank" class="link">Amouage's social media</a></div>
      </figcaption>
  </figure>

<p>Amouage is “only expensive once, after that it’s priceless”.</p>

<p>Beyond marketing flourish, I think this line captures the ethos of the house perfectly.</p>

<p>From the beginning, Amouage set out to revive the forgotten grandeur of Arab perfumery and introduce it to the West— not as mimicry, but as a dialogue. And in doing so, it forged its own identity.</p>

<p>An identity linked with fragrances that are challenging, transcendental, and ritualistic.</p>

<p>An identity rooted in Omani identity, built upon the backs of local artisans, sourcing ingredients like frankincense from protected Omani regions.</p>

<p>An identity which brings massive pride to the Omani people and challenges Western perfumery giants like Dior.</p>

<p>It has formed this identity all while still costing less compared to niche brands like Creed (which costs far more per milliliter). All while maintaining the quality of ingredients and artistry of the brand.</p>

<p>I truly believe that Amouage is a perfume house people should try at least once. If price is a barrier, be on the lookout for samples. You could even split a bottle with someone. Or wait for a discounter selling on clearance: I got Interlude for 180 USD. I wear it once a week or so, and it changes the color of my day every time.</p>

<p>Perfume may not be essential. But it can be transformative.</p>

<p><em>And Amouage, the Gift of Kings, reminds you why scent matters.</em></p>]]></content><author><name></name></author><category term="perfume" /><category term="social" /><summary type="html"><![CDATA[This year introduced me to new passions and hobbies I never thought I’d entertain.]]></summary></entry><entry><title type="html">Reflecting on Stanford’s Code In Place 2025</title><link href="/2025/06/05/code-in-place.html" rel="alternate" type="text/html" title="Reflecting on Stanford’s Code In Place 2025" /><published>2025-06-05T00:00:00+03:00</published><updated>2026-06-27T00:46:50+03:00</updated><id>/2025/06/05/code-in-place</id><content type="html" xml:base="/2025/06/05/code-in-place.html"><![CDATA[<h1 id="introduction">Introduction</h1>

<p>Sometime in early April, a former teacher of mine let me know about <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwiq4sLE-eeNAxXh8LsIHXO6HcQQFnoECBoQAQ&amp;url=https%3A%2F%2Fcodeinplace.stanford.edu%2F&amp;usg=AOvVaw3T7nZjHcUIhFUA569C8QjB&amp;opi=89978449" target="_blank" class="link"> Stanford’s Code In Place Program</a>, an online 6-week course offered by Stanford aimed at teaching introductory CS content from their flagship course— <strong>CS106A</strong>— for free.</p>

<p>I first considered joining as a student— I mean, It looked great! Attend a live zoom with a teacher every week, get certification, and work on a final project (I <strong>LOVE</strong> final projects).</p>

<p><img src="/assets/images/cip-list.png" style="width: 100%; border-radius:10px;" /></p>

<p>But then looking at the content, it seemed pretty rudimentary.. This was meant to be an introductory course after all. I had known Python pretty well, so I decided to instead volunteer to become a <strong>Section Leader</strong> (SL)— the person hosting each of the “sections”: Zoom meetings where 10-15 students join and work on a problem together and clarify any of their concerns.</p>

<p>But then again, I’d have to teach for 6 weeks, spanning my school exams, APs, and even graduation. I was worried I wouldn’t be able to keep up with the responsibilities.</p>

<p>Still, I applied anyway. And now, two months later, I’m sitting here writing this reflection—having just finished leading a section of 16 students through CS106A. Fittingly, at the time of writing this, I would usually receive a reminder telling me section is in 24 hours :(</p>

<h1 id="applying">Applying</h1>

<p>The application process to become a section leader was pretty simple:</p>

<ul>
  <li>
    <p>I needed to provide a few short responses about myself and why I’d like to teach, what prior experience I have, etc.</p>
  </li>
  <li>
    <p>Solve a few Python problems using their Karel tool (more on this later!)</p>
  </li>
  <li>
    <p>Provide some sample help with debugging where I’d be given some erroneous code and I’d have to help debug it without saying what is wrong explicitly.</p>
  </li>
  <li>
    <p>And most significantly, I’d have to film a short, 5-6 minute teaching demo where I go through a  problem and explain how to solve it with Python. This video me the longest to complete, and I had to retake it a handful of times.
After completing the application, I received an email and waited for the decision to come out. I got in!</p>
  </li>
</ul>

<p>￼<img src="/assets/images/cip-celeb.jpg" style="width: 50%; border-radius:10px; display:block; margin-left:auto; margin-right:auto;" /></p>

<h1 id="onboarding">Onboarding</h1>

<p>After getting accepted, I had to pledge that I would make and prepare for section over 6 weeks. I then had the option to choose what time and date I wanted to hold section, and there were offerings from Wednesday to Saturday if I recall correctly. I personally picked Friday 4 PM my time. I also notably had an option to refer two students to the program and they would be automatically accepted.</p>

<p>I now had access to the Code In Place platform. A small on screen tutorial showed me around the website. I will attempt to summarize each tab.</p>

<h1 id="the-website">The Website</h1>
<p><img src="/assets/images/cip-tabs.png" style="float: left; width: 20%; border-radius: 10px; margin: 0 30px 30px 0;" /></p>
<ul>
  <li>
    <h2 id="home">Home:</h2>
    <p>Here, you are able to either pick the Teacher Home or Student Home.</p>
  </li>
</ul>

<h3 id="the-teacher-home">The Teacher Home:</h3>
<p>would allow you to view all your students, the number of assignments they’ve completed, the number of lectures (online videos) they’ve watched, and which sections they have attended. Additionally, it would allow you to go to their actual solutions for each assignment and run it for yourself on the Stanford provided IDE.</p>

<h3 id="the-student-home">The Student home:</h3>

<p>emulates what a student would see, as expected. It is neatly organized into week by week lectures, assignments, and any additional tests or events.</p>

<ul>
  <li>
    <h2 id="code">Code:</h2>
  </li>
</ul>

<p>In this tab, you would be able to create your own projects and run them with the Stanford IDE or access a list of all assignments and work on them. There are also optional questions which are much more algorithmically challenging to solve.</p>

<p><img src="/assets/images/cip-teacher.png" style="float: left; width: 20%; border-radius: 10px; margin: 0 30px 30px 0; clear:both;" /></p>

<ul>
  <li>
    <h2 id="lessons">Lessons:</h2>
    <p>Here, you could access all the pre-recorded lectures in case you want to brush up on concepts before section. You also had access to “readers” for Karel and Python, which are basically self-contained textbooks outlining everything (and more!) you needed to know about them. I used the lessons here to see what the students knew exactly and adjust section accordingly.</p>
  </li>
  <li>
    <h2 id="sl-training">SL Training:</h2>
    <p>In this tab, you had access to a SL “teacher’s handbook” with a bunch of advice and content. You also had an option to open a testing Zoom room, just to get used to Zoom and troubleshoot. Additionally, there were also 3 pre-recorded training videos you had to watch in order to actually lead section. They involved topics such as: orienting your students, interacting with them, and also organizing section.</p>
  </li>
  <li>
    <h2 id="section">Section:</h2>
    <p>This is the main directory you’d be operating in. This tab has all of the data you need to lead and operate section. On it, you would have to RSVP for section each week, and if you’d be able to make it, you would get an option to open a Zoom meeting 15 minutes before your section time. We also had an option here to make an announcement which would appear on all of your students’ section tabs as well. There was also a table indicating each week’s topics, resources, code, and solutions. The resources included the main lesson plan, a slides deck, objectives, code, etc.</p>
  </li>
</ul>

<p>It also had bonus optional extensions for each of the problems, which my students found particularly stimulating.</p>

<ul>
  <li>
    <h2 id="forum">Forum:</h2>
    <p>The forum was a particularly useful way of communicating with the entire platform. Similar to Stack Exchange, you would make a post on the appropriate forum and people would be able to like and reply to it.</p>
  </li>
</ul>

<h3 id="main-forum">Main Forum:</h3>
<p>Everyone in the program can access this forum</p>
<h3 id="section-forum">Section Forum:</h3>
<p>Only you and students in your own section had access to this forum.
On the Section forum, you also had an option to email all of your students and make announcements which would appear at the top of the forum.</p>
<h3 id="teachers-forum">Teacher’s Forum:</h3>
<p>A forum only with Code In Place staff and teachers.</p>
<h3 id="main-x-forum">Main X Forum:</h3>
<p>A forum with experiences students: students not assigned to a section who would navigate the course alone.</p>

<p>The forum/platform’s WYSIWYG text editor was very convenient, as you could format text in several different ways and also embed links, code, quotes, images, and a lot more. You also had the option to make your posts private or anonymous.</p>

<p><img src="/assets/images/cip-wysiwyg.png" style="display:block; width: 70%; border-radius: 10px; margin-left:auto; margin-right:auto;" /></p>

<ul>
  <li>
    <h2 id="teachnow">TeachNow:</h2>
    <p>This was one of the most exciting features for me. You could, at any time, use TeachNow to connect to a student who has been struggling on a problem (they would be able to request for help) via Zoom and help them out. You would be able to share your screens and go through it together. This was an amazing opportunity and it was open to other students to volunteer as well. In fact, if a section leader missed their section for any reason, one of the ways they could compensate was by completing 4 TeachNow sessions for each missed section.</p>
  </li>
  <li>
    <h2 id="connections">Connections:</h2>
    <p>A lesser used feature for me. In this tab, you would be able to see the profiles of 4 other Code In Placers (Section Leaders, Students, Experienced Students, etc.) and ask to connect with them on platforms of your choosing (most did LinkedIn). These profiles would refresh every 4 hours. After making connections, they would appear in the bottom of this tab.</p>
  </li>
  <li>
    <h2 id="about">About:</h2>
    <p>This tab is similar to an FAQ: it has a bunch of information about Code in Place, section, responsibilities, and everything in between. More on responsibilities later.</p>
  </li>
  <li>
    <h2 id="events">Events:</h2>
    <p>This tab has a collection of Zoom events Stanford highlights regarding Code In Place and CS in general. I saw a few interesting ones about pedagogy, a hackathon, and a final project showcase. There is also (at the time of writing) an upcoming event on training AI auto-graders, which I am planning to participate in.</p>
  </li>
</ul>

<h1 id="training-for-section">Training for Section</h1>

<p>Before leading my first section, all section leaders had to join a 1.5 hour live training session where we went through the course expectations and standards. It was led by a head <strong>Teaching Assistant</strong> (TA) who was a former SL herself. She was our main point of contact regarding any issues or problems we had with section, including if we couldn’t make section. We were also put into breakout rooms and practiced teaching with other section leaders and shared feedback together. We had to do this twice throughout the course— once before our first section and once after— for a total of 3 hours of live training. The second session was particularly productive as we all shared resources we were planning to use for section. Further practice sessions were also carried out at the same time weekly, but they were not mandatory.</p>

<h1 id="first-section">First Section</h1>

<p>Finally, it was time for my first section. I remember being insanely nervous for it, so much so I thought I’d develop a case of restless leg syndrome because of how much I was fidgeting. I also remembered the founders of Code in Place— Mehran Sahami and Chris Piech— sharing tips they had for what to do before teaching and tried to go through them. I played some of my favorite music, and when I could finally open the meeting, I did.</p>

<p>At first, I only had 2-3 students join despite having 15 students in my section. I told them <em>(and myself!)</em> people would start joining and that we were quite early. I was luckily right, and soon I had to constantly accept people from the Zoom waiting room. This was actually one of the technical difficulties I had in the first section— I would have to constantly accept people manually. Luckily it was resolved by my second section.</p>

<p>What struck me the most was the great diversity of people wanting to code— <em>medical students, entrepreneurs, chemistry majors, flooring professionals, and even other CS students looking to learn Python</em>. This diversity was motivating, but beyond that it also became a great way to show how in-demand basic coding skills have become. I tailored a few analogies to the students’ backgrounds; I showed the flooring professional a Karel assignment we had where we had to tile the grid in a specific pattern, similar to actual tile layouts.</p>

<p>I really emphasized setting the culture for my section in the first session we had, and it percolated over to the next sessions very well. When we had everyone in the meeting (I think 13-15) people, we all introduced ourselves for a good 10 minutes before moving on to the actual problem, which was a vestige of Code in Place’s COVID origins: We had to use Karel (a small robot guided by Python) to “build hospitals” on a grid of cells given a certain condition was met.</p>

<p>Karel only had four commands, which made it very easy to learn. It could <code class="language-java">turn_left()</code>, <code class="language-java">turn_right()</code>, <code class="language-java">move()</code>, <code class="language-java">put_beeper()</code>, <code class="language-java">pick_beeper()</code>, and also had a few methods which returned booleans like <code class="language-java">front_is_clear()</code>. This made it really useful for practicing functional decomposition and teaching core programming paradigms. Furthermore, you weren’t allowed to use variables or return statements with Karel, forcing experienced students to come up with algorithms they wouldn’t have thought of before <em>(see Section 2 problem!)</em>.</p>

<p>Before starting to code, I made it clear that I would prefer if everyone had their cameras on, just so I could gauge their understanding by looking at their faces every now and then. I think this was super important and it set the standard for the rest of section, as I would always have a majority with cameras on.</p>

<p>The problem itself went by pretty well, we went through different routes and explained why they wouldn’t work or how we would adjust them. I also tried as much as possible to let the students themselves write the code, so in the end we could have a chimera of code and functions working together to solve the problem.</p>

<p>Another aim was to handle <strong>off-by-one errors</strong>. The Stanford IDE made this very convenient: it allowed us to see code execute line by line. I think a great advantage of Code in Place was the ability to code in front of the students. It allowed us to actually run the code and see what happens in real time and how simple changes, even in code order, can lead to very different results. We also had built-in Karel &amp; basic Python documentation which allowed us to quickly check for what method names or outputs. Overall the coding experience was great and I did not run into any technical difficulties on the IDE.</p>

<p>Teaching the problem and seeing how curious and willing to learn the students were quickly chipped away at my angst and moved me to the “zone” I’m sure you’ve felt if you’ve taught before. Everything just comes out smoothly and if it does not, it becomes a learning opportunity.</p>

<p>We finished teaching the problem and I clarified any concerns the students had. We finished just in time, and I had a bit of free time afterwards so I decided to stay in the Zoom meeting just to see if anyone would warm up and feel more comfortable to ask more questions or just have a little chat. Thus, the after-section-yap-session was born, a huge part of our section’s culture. After every section, I would let the students know that section was over and they were free to leave, but I would remain in the meeting if anyone would like to ask anything or chat. This worked super well, as people started asking me more about coding and also myself. Maybe 8-9 students stayed every time, and we would start by clearing up some more important concerns about Code in Place or CS, then moved on to just chatting about our lives. We got to know each other very well as a result of these “yap sessions”, and a student later said they always looked forward to them after section.</p>

<h1 id="missing-section-protocol">Missing Section Protocol</h1>

<p>Before I move onto the remaining sections, I’d also like to highlight what would happen if you missed a section. Thankfully I made all of my sections (there was no <strong>WAY</strong> I was missing my yap sessions), but Stanford had outlined what would happen pretty clearly:</p>

<ul>
  <li>If you missed your very first section, then it would automatically be “disbanded”— I’m assuming this means you would be dismissed as section leader.</li>
  <li>For the remainder of sections, if you miss section by RSVP’ing that you can’t show up and also letting the head TA know, then you would be given a choice of covering for another SL who couldn’t make their section or completing 4 TeachNow sessions. In both cases, you would still receive your certificate at the end.</li>
  <li>If you do not RSVP and don’t inform your head TA, then Stanford reserved the right to disband your section.</li>
</ul>

<p>Students evidently had similar conditions, I think it went something like:</p>
<ul>
  <li>Attend a make-up session</li>
  <li>Complete final project</li>
  <li>Do the optional diagnostic test at the end of the course</li>
</ul>

<h1 id="subsequent-sections-and-some-section-culture">Subsequent sections and some section culture</h1>

<p>After the first section, I realized how special section really was to me. I first thought that the responsibility of managing section would be too great for me to manage— that I’d be overburdening myself in peak exam season. But section was a place where I could go to give back to the community and also “zoom out” from all the stress of exams. It genuinely had such a positive impact on me that I’ve vowed to volunteer to lead section again next year. However, I will always look back at this first group of students with beaming pride and gratitude. They truly made section so lively and enjoyable.</p>

<p>In my next sections, we had 2 new students who were joining from other sections— one to join a temporary make-up session and another looking for a new section. I wear it as a token of great pride that the second student liked us so much (I hope!) that he joined us for the rest of the course! So I now had 16 students every section.</p>

<h2 id="section-2">Section 2</h2>

<p>The second section had a more algorithmically challenging problem– Karel had to distribute a pile of <span class="math">$n$</span> beepers across the row it stood on. Again, Karel cannot count (no variables or returns), so this problem was a bit harder for the students.</p>

<p>We went through different algorithmic ideas and wrote faulty code before reaching the canonical solution. Writing the faulty code was very productive– both the students and I got to brush up our debugging skills!</p>

<p>I also started trying different things for upcoming sections.</p>

<h2 id="bcode">bCode</h2>

<p>I needed a platform allowing several people to collaborate on one IDE while also allowing me to monitor everyone’s work. <a href="https://106a.vercel.app&lt;" target="_blank" class="link">bCode</a> fit the bill perfectly.</p>

<p>For my third section, I decided to use bCode to allow people to all work on the problems in either breakout rooms or individually. The UI is pretty intuitive, and you’re able to set starter code up and allow students to run their code. We organized everyone into groups based on their breakout room number, and everyone got to work. I think this was one of the most productive tools I used. I would check in on all the breakout rooms periodically to check for issues and ensure everyone was collaborating. It worked especially well with some of the people who used chat to communicate, because they began to open up and interact via mic in these breakout rooms.</p>

<p>Beyond highlighting the obvious wide variety of solutions that existed for a single problem, it also allowed for some pretty neat (and funny) learning moments afterwards when we reviewed everyone’s code.</p>

<h3 id="gpt-antics">GPT antics</h3>

<p>One of the funniest moments (in my opinion) in section occurred when we were working on building a program to convert weight on Earth to any of the 7 other planets (sorry Pluto..). For context, the conversion factors were given in the problem. But we had also recently learnt how to call GPT within the problem. So when we were reviewing everyone’s code at the end of the bCode session, I moved to someone’s code and noticed the first line was <code class="language-python">from ai import call_gpt</code>.</p>

<p><em>Oh no.</em> Had they just asked GPT to solve the entire problem?</p>

<p><em>No.</em> They had taken the planetary input and asked GPT to generate the conversion factor for them. This avoided checking against the user input, something I’m assuming they struggled with. After realizing what he had done, the entire section burst into laughter and the incident became a running joke in section.</p>

<h2 id="menti-polls">Menti Polls</h2>

<p>Another tool I used were polls, via <a href="https://www.menti.com" target="_blank" class="link">Menti</a>. They allowed me to give the students some freedom, and I allowed them to vote on if they wanted to work individually or in breakout rooms. It was also completely anonymous. We also used Menti to simulate the behavior of a short game we were tasked with building. Overall, Menti was easy to use and I would definitely use it again for polling.</p>

<h2 id="extensions-to-problems">Extensions to problems</h2>

<p>One of the most enjoyable and productive things we also did, in my opinion, was build our own extensions to the problems. It allowed us to really get into the programming mindset and think of how the different parts of our program worked together, beyond what was given in the problem. A notable example of this was in a problem where we were tasked with using graphics to draw a bunch of random circles. The function generating the random color was already given to the students, but our extension involved building it ourselves with <code class="language-java">random.randint()</code> instead. And later, we extended that beyond the predefined colors and into any hex color.</p>

<p>I also tried encouraging this mindset by telling them to think of how some of the predefined methods (eg: for the <code class="language-python">random</code> package: <code class="language-java">shuffle()</code>, etc.) worked under the hood before telling them to try building their own implementations of them.</p>

<h2 id="discord-server">Discord Server</h2>

<p>In our 5th section, I decided to make a small discord server for the students, just so we could stay connected in the future and also if any of them needed help with their final projects, they could communicate together there. This worked pretty well, and people are sharing their projects and also asking for help decently often. We also made a resources channel with some resources for if they want to further their knowledge.</p>

<h2 id="moving-away-from-karel">Moving away from Karel</h2>

<p>Another fun moment in section was when we finally moved away from Karel and into actual Python. In the last Karel section, I had expressed my disdain for Karel’s unintuitive orientation.</p>

<p>See; at first glance, you’d assume Karel’s “left” refers to the cell to our left. But no—Karel is viewed from above, and her left is actually the cell above her in our perspective. Still, the little feet at the bottom suggest a side view. It’s confusing, and methods like <code class="language-java">left_is_clear()</code> don’t help.</p>

<p><img src="/assets/images/cip-karel.png" style="display:block; width: 30%; border-radius: 10px; margin-left:auto; margin-right:auto;" /></p>

<p>By our final Karel session, I changed the Karel icon in the IDE settings to a turtle—which made it clearer that we were viewing the robot from the top. This led to a cathartic rant during our yap session… and a celebratory meme in the next week’s Python section:</p>

<p><img src="/assets/images/cip-meme.png" style="display:block; width: 70%; border-radius: 10px; margin-left:auto; margin-right:auto;" />
￼</p>

<p>Yes, I’m very proud of my meme-making skills :P</p>

<h1 id="final-section">Final Section</h1>

<p>And finally, one week ago, I hosted my final section. It was bittersweet, but the problem we worked on was quite fitting for the final section— it involved making a terminal game of Heads Up, and everyone would get a turn to describe a word that I had to guess. After finishing section, I had planned out a Menti game where we would all vote on a few superlatives for each other <em>(“most likely to forget an indent..”, etc.)</em>, which gave us a bit more closure. We also had a longer than usual yap session and also took a few pictures together.</p>

<p>And that was it— 6 weeks of Stanford Code In Place, ending with a click on “End Meeting for All”  :(</p>

<h1 id="what-i-would-do-differently">What I would do differently</h1>

<p>Honestly, this was one of the best experiences I think I could’ve had. My students were ideal, the technical issues were minimal, it was easy to navigate and explain the content. I would genuinely recommend volunteering as SL to anyone reading this, regardless if you have prior teaching experience or not.</p>

<p>I’m having to think really hard in order to point to something specific to change, but here’s a (non-)comprehensive list:</p>
<ul>
  <li>Deviate from the Stanford problems a bit more. I think my students learnt best when we strayed a bit from the course and tried applying things on our own. Not to say I won’t use the problems, but I definitely will dedicate more time next time to expanding on them and creating more elaborate extensions.</li>
  <li>Make it more interactive for people who only used chat. I think I only had 3-4 people who didn’t use mic at first, but in the final sections they had warmed up. But I will definitely try addressing it next time by coaxing them into turning it on if possible. The Zoom chat as is isn’t very productive for the style of programming we were doing. Maybe I could somehow give them access to directly comment on the IDE.</li>
</ul>

<p>I suppose I will update this as list as things come to mind :)</p>

<h1 id="closure">Closure</h1>

<p>Leading section was an incredible opportunity that I am infinitely grateful for discovering. It genuinely surprised me how close we grew in such little time— how rewarding it felt to be able to give back to a group of people looking to learn how to code. Despite starting off quite anxious, I found myself energized each week by the diversity and also growth of my students. Teaching really challenged me to think more clearly, communicate effectively, and build a fun environment worth coming back to every week. It was also a lot of dedication for these students: show up every week, do 30+ assignments, watch lectures, build a final project, and do a final test.</p>

<p>I’m leaving this experience with a full heart, a screenshot of a zoom grid, and the certainty that these students— whether they keep coding or not— will do incredible things.
What started as a spontaneous application between my exam prep ended up becoming one of the highlights of my year. I’m incredibly thankful to my students <em>(I know I’ve said this ad nauseam)</em>, but also to the entire Code In Place team who made all of this possible behind the scenes.</p>

<p>I walked in hoping to give back— what I didn’t expect was how much I’d take away.</p>

<p>I can’t wait to do it all over again next year.</p>

<p><strong>Thank you, CIP 2025 &lt;3</strong></p>

<p><img src="/assets/images/cip-final.png" style="display:block; width: 70%; border-radius: 10px; margin-left:auto; margin-right:auto;" /></p>]]></content><author><name></name></author><category term="social" /><category term="cs" /><summary type="html"><![CDATA[Introduction]]></summary></entry><entry><title type="html">Surreal numbers &amp;amp; the shortest proof that 1+1=2</title><link href="/2025/04/09/surreal-successor.html" rel="alternate" type="text/html" title="Surreal numbers &amp;amp; the shortest proof that 1+1=2" /><published>2025-04-09T00:00:00+03:00</published><updated>2026-06-27T00:46:50+03:00</updated><id>/2025/04/09/surreal-successor</id><content type="html" xml:base="/2025/04/09/surreal-successor.html"><![CDATA[<script>
  document.addEventListener("DOMContentLoaded", function () {
    const img = document.querySelector("figure.fig-main .blog-image-main");
    if (img) {
      img.style.boxShadow = "none";
      img.style.opacity = "1";
    }
  });
</script>

<p>$\newcommand{\surs}[2]{\langle\, #1 \, \mid \, #2 \, \rangle}$
$\newcommand{\sur}[2]{\langle\, \{#1\} \, \mid \, \{#2\} \, \rangle}$
$\newcommand{\surr}[1]{\langle\, \{#1\} \, \mid \, \null \, \rangle}$
$\newcommand{\surl}[1]{\langle\, \null \, \mid \, \{#2\} \, \rangle}$
<em id="fl">A</em> few days ago, I was chatting with a friend about some math. We were both bored and had a severe itch to discover <span style="font-style: italic">something</span> new. They sent me a meme <sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup> which challenged the reader to try proving <span class="math">$1+1=2$</span>. That can’t be hard can it? We both knew of the infamous Whitehead &amp; Russell proof <sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup> which took 162 pages to prove this seemingly self-explanatory proposition, but <span style="font-style: italic">surely</span> there was an easier way to do it… right?</p>

<p>Well, I set out to find this way, if it even existed. And honestly, I’m grateful I did, because I discovered something so much more interesting. <a href="https://www.scientificamerican.com/article/surreal-numbers-are-a-real-thing-heres-how-to-make-them/" target="_blank" class="link">The Surreal Numbers</a>.</p>

<h1 id="conway-knuth-and-affairs-in-hotels">Conway, Knuth, and Affairs in Hotels</h1>

<p>I found out that <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwiA-5T1z9eMAxXcxgIHHfSXAx4QFnoECAkQAQ&amp;url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FJohn_Horton_Conway&amp;usg=AOvVaw3QcojdfIia18AJgBfot1dD&amp;opi=89978449" target="_blank" class="link">John Conway</a>, an English mathematician who also created the <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" target="_blank" class="link">Conway Game of Life</a> <sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">3</a></sup>had come up with 2 simple rules which give birth to all the numbers we know of and more.</p>

<p>I decided to look into it and found out about Donald Knuth’s <sup id="fnref:4"><a href="#fn:4" class="footnote" rel="footnote" role="doc-noteref">4</a></sup> book <a href="https://books.google.es/books/about/Surreal_Numbers.html?id=ZUkwDc3FokgC&amp;redir_esc=y" target="_blank" class="link">Surreal Numbers: How Two Ex-students Turned on to Pure Mathematics and Found Total Happiness : a Mathematical Novelette</a>.</p>

<p>He claims to have wrote it on a Hotel getaway with his wife <sup id="fnref:5"><a href="#fn:5" class="footnote" rel="footnote" role="doc-noteref">5</a></sup> after meeting Conway, who described to him the rules and nuances of The Surreals. Conway says he wrote the vital parts on a tissue and then reconstructed them, over the course of 7 days, in his hotel. He published his work as a novella afterwards.</p>

<p>The book is beautifully written as a dialogue between two characters who discover a tablet containing inscriptions about Conway’s rules for the Surreals. They then reconstruct the surreals– just as Knuth himself does– and discover their properties in a very natural, authentic way. I could not recommend it more! <sup id="fnref:6"><a href="#fn:6" class="footnote" rel="footnote" role="doc-noteref">6</a></sup></p>

<p>This blog post will follow my recent exploration of this book, as well as the Surreals and any notes I have made on them. I will most likely create a second post on <span class="math">$\omega$</span>, so look out for that!</p>

<h1 id="constructing-the-surreals">Constructing the Surreals</h1>

<p>The entire Surreal number system can be defined by two rules. We will be revisiting these rules extremely often, so get familiar with their every nuance.</p>

<div class="math-def">
  <div class="math-def-title">
    <div id="math-title">The rules</div>
  </div>
  <div class="math-content">1. Any Surreal number is a <span style="font-style:italic">form</span> of two sets <span class="math">$\sur{X_L}{X_R}$</span>, where:
  <div class="math">$$\forall x_L\in X_L, x_R\in X_R, x_L \ngeq x_R \iff X_L \ngeq X_R$$</div>
  2. A binary relation is defined on the set of surreals <span class="math">$\leq$</span> such that:
  <div class="math">$$x\leq y \iff X_L \ngeq y \wedge x\ngeq Y_R$$</div> 
  where <span class="math">$X_L \ngeq y$</span> iff there does not exist <span class="math">$x_L\in X_L$</span> such that <span class="math">$y\leq x_L$</span>, and the same reasoning applies to the second relation where <span class="math">$\nexists y_R \in Y_R \text{ s.t } y_R\leq x$</span>
  </div>
</div>

<p>For now, these rules may seem nebulous, but they will make more sense as we make use of them.</p>

<h2 id="day-0-but-where-are-all-the-numbers">Day 0: <em>but where are all the numbers?</em></h2>

<p>As it stands, we have 2 rules and… well, nothing to apply them to. Nothing. <em>nothing</em>. Here’s an idea: let’s let the first number be composed of <em>nothing!</em></p>

<p>As in, let our first number, call it <span class="math">$X_0$</span> for now, have:</p>
<div class="math">$$\newcommand{\null}{\varnothing}X_L=\varnothing=\text{empty set}=X_R$$</div>
<p>And so,</p>
<div class="math">$$X_0=\sur{\null}{\varnothing}$$</div>
<p>To verify that <span class="math">$X_0$</span> is actually a number by the surreal rules, let’s check that <span class="math">$X_0$</span> does indeed satisfy rule 1:</p>

<p>Okay well.. we need to prove that for all <span class="math">$x_R \in X_R$</span>, there <em>does not exist</em> any <span class="math">$x_L \in X_L$</span> such that <span class="math">$x_L&gt;=x_R$</span>..</p>

<p>But there’s a problem: there doesn’t even exist any <span class="math">$x_L$</span> and <span class="math">$x_R$</span> in <span class="math">$\null$</span> for us to compare. Hence, Rule 1 holds vacuously! <span class="math">$X_0$</span> is indeed a surreal number.</p>

<p>This is great! Because we can use the null set for comparisons, it makes our work so much easier. We can create so many forms now.</p>

<p>As our conclusion for Day 0, let’s call this progenitor number <span class="math">$0$</span>. We will see that the surreal zero also behaves like the real zero soon.</p>

<div class="math-def">
  <div class="math-def-title">
    <div id="math-title">Surreal Zero</div>
  </div>
  <div class="math-content">Let <span class="math">$\null$</span> be the empty set. Then:
  <div class="math">$$0=\sur{\null}{\null}$$</div></div>
</div>

<h2 id="day-1-comparisons-with-nothing">Day 1: <em>comparisons with nothing</em></h2>

<p>Time to use combinations of <span class="math">$0$</span> and <span class="math">$\null$</span> to create new numbers! Let’s call <sup id="fnref:7"><a href="#fn:7" class="footnote" rel="footnote" role="doc-noteref">7</a></sup></p>

<div class="math">$$X_1=\sur{\{0\}}{\null}, X_2=\sur{\null}{\{0\}}$$</div>

<p>Since we have a total of 3 numbers <sup id="fnref:8"><a href="#fn:8" class="footnote" rel="footnote" role="doc-noteref">8</a></sup> now, we can begin comparing them with the binary relation described in Rule 2!</p>

<div class="mathcol">
  <div class="mathchild">
  <span class="math">$0\stackrel{?}{\leq}0$</span>
  <div class="math">\begin{align*}
  x&amp;=0=y\\
  X_L &amp;\stackrel{?}{\ngeq} y \\
  x_L&amp;\nexists, \checkmark\\
  x&amp;\stackrel{?}{\ngeq} Y_R \\
  y_R&amp;\nexists, \checkmark  
  \end{align*}</div>
  <span class="math">$0\leq 0\checkmark$</span>
  </div>
  <div class="mathchild">
  <span class="math">$0\stackrel{?}{\leq}X_1$</span>
  <div class="math">\begin{align*}
  X_L&amp;=\null=X_R\\
  Y_L&amp;=\{0\}, Y_R=\null\\
  X_L&amp;\stackrel{?}{\ngeq}y, \checkmark\\
  x=0&amp;\stackrel{?}{\ngeq}Y_R=\null, \checkmark
  \end{align*}</div>
  <span class="math">$0\leq X_1\checkmark$</span>
  </div>

  <div class="mathchild">
  <span class="math">$X_2\stackrel{?}{\leq}0$</span>
  <div class="math">\begin{align*}
  X_L&amp;=\{0\}, X_R=\null\\
  Y_L&amp;=\null=Y_R\\
  X_L=0&amp;\stackrel{?}{\ngeq}0, \checkmark\\
  x&amp;\stackrel{?}{\ngeq}Y_R=\null, \checkmark
  \end{align*}</div>
  <span class="math">$0\leq X_1\checkmark$</span>
  </div>
</div>

<p>Nice! We’ve ordered some of the surreals. But notice that this <span class="math">$X_1, X_2$</span> behave just like our usual <span class="math">$1,-1$</span> in the reals…</p>

<p>As in, in the reals, we have <span class="math">$0\leq 1$</span> and here too, <span class="math">$0\leq X_1$</span>, and a similar reasoning follows for <span class="math">$X_2$</span>.</p>

<p>One can also intuit that <span class="math">$X_1 \nleq X_2$</span>, as well as <span class="math">$X_1 \nleq 0$</span> and <span class="math">$0\nleq X_2$</span>, and it then intuitively holds that <span class="math">$0&lt;X_1$</span> and <span class="math">$X_2&lt;0$</span>, but we still haven’t really defined what it means for two numbers to be “equal”. We’ll get to this later.</p>

<p>So, by Day 1, we conclude:</p>

<div class="math-def">
  <div class="math-def-title">
    <div id="math-title">By Day 1: Field identities!</div>
  </div>
  <div class="math-content">
  <ul>
  <li><span class="math">$0\leq 0$</span></li>
  <li><span class="math">$X_1 = 1, X_2 =-1$</span></li>
  <li><span class="math">$0\leq 1, -1\leq 0$</span></li>
  </ul>
  
  </div>
</div>

<h2 id="interlude-infinite-birth-and-tosets"><em>interlude;</em> infinite birth and tosets</h2>

<p>Before we begin comparing our newly generated numbers with each other and make new surreals on Day 2, it is useful for us to start reflecting on the nature of the rules.</p>

<p>First off, you may’ve noticed that when we compare two numbers <span class="math">$x\leq y$</span>, we are quantifying every number in the first’s leftmost set. That is, we say <span class="math">$\forall x_L \in X_L, x_L \ngeq y$</span>. But intuitively, if we pick <span class="math">$\max(X_L)=x_L$</span> instead, we can do just one comparison instead of as many are in <span class="math">$X_L$</span>! Because we are guaranteed to be comparing the biggest element of this left set and ensuring it is not bigger than <span class="math">$y$</span>, then no others in the left set are bigger than <span class="math">$y$</span>.</p>

<p>A similar reasoning follows where we pick <span class="math">$\min(Y_R)$</span> to compare with <span class="math">$x$</span>.</p>

<p>2/8/25: guess i need to complete this huh</p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p><img src="/assets/images/1-plus-1-meme.png" style="width: 70%; border-radius:10px;  margin-bottom:10px;" /> <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p><img src="/assets/images/russel.png" style="width: 70%; border-radius:10px; margin-bottom:10px;" /> <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3">
      <p>I should honestly make a whole blog just about this, but it follows a 2D universe of cells, each of which can be alive or dead, with rules determining if a cell will live or not.</p>

      <p>Sadly, Conway passed away in 2020 from COVID. xkcd published this gif later on, titled <a href="https://xkcd.com/2293/" target="_blank" class="link">RIP John Conway</a></p>

      <p><img src="/assets/images/rip-conway.gif" style="width: 50%; border-radius:10px; margin-bottom:10px; margin-left:auto; margin-right:auto;" /> <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4">
      <p>CompSci god. He created the TeX typesetting system, and all math on this page is rendered using TeX (well, MathJax) <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5">
      <p>imagine having a wife and still running away with her to a hotel to, in Knuth’s own words, “experience what it’d be like to have a little affair in a hotel room”. CompSci people are just different. <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6">
      <p>for another (longer) book which has the same dialogue format, see <span class="alert">Concepts, Problems, and Solutions in School Calculus: A Dialogue Approach by Tarasov and Kumar</span>. <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:7">
      <p>Now, <span class="math">$X_1, X_2$</span> are both numbers since there is no element in the empty set to generate comparisons with. In fact, we will come upon a result soon where any number with an empty left or right set is a valid surreal form. <a href="#fnref:7" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8">
      <p><span class="math">$\surs{\{0\}}{\{0\}}$</span> is not a valid form. Why? <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="math" /><summary type="html"><![CDATA[$\newcommand{\surs}[2]{\langle\, #1 \, \mid \, #2 \, \rangle}$ $\newcommand{\sur}[2]{\langle\, \{#1\} \, \mid \, \{#2\} \, \rangle}$ $\newcommand{\surr}[1]{\langle\, \{#1\} \, \mid \, \null \, \rangle}$ $\newcommand{\surl}[1]{\langle\, \null \, \mid \, \{#2\} \, \rangle}$ A few days ago, I was chatting with a friend about some math. We were both bored and had a severe itch to discover something new. They sent me a meme 1 which challenged the reader to try proving $1+1=2$. That can’t be hard can it? We both knew of the infamous Whitehead &amp; Russell proof 2 which took 162 pages to prove this seemingly self-explanatory proposition, but surely there was an easier way to do it… right? Well, I set out to find this way, if it even existed. And honestly, I’m grateful I did, because I discovered something so much more interesting. The Surreal Numbers. Conway, Knuth, and Affairs in Hotels I found out that John Conway, an English mathematician who also created the Conway Game of Life 3had come up with 2 simple rules which give birth to all the numbers we know of and more. I decided to look into it and found out about Donald Knuth’s 4 book Surreal Numbers: How Two Ex-students Turned on to Pure Mathematics and Found Total Happiness : a Mathematical Novelette. He claims to have wrote it on a Hotel getaway with his wife 5 after meeting Conway, who described to him the rules and nuances of The Surreals. Conway says he wrote the vital parts on a tissue and then reconstructed them, over the course of 7 days, in his hotel. He published his work as a novella afterwards. The book is beautifully written as a dialogue between two characters who discover a tablet containing inscriptions about Conway’s rules for the Surreals. They then reconstruct the surreals– just as Knuth himself does– and discover their properties in a very natural, authentic way. I could not recommend it more! 6 This blog post will follow my recent exploration of this book, as well as the Surreals and any notes I have made on them. I will most likely create a second post on $\omega$, so look out for that! Constructing the Surreals The entire Surreal number system can be defined by two rules. We will be revisiting these rules extremely often, so get familiar with their every nuance. The rules 1. Any Surreal number is a form of two sets $\sur{X_L}{X_R}$, where: $$\forall x_L\in X_L, x_R\in X_R, x_L \ngeq x_R \iff X_L \ngeq X_R$$ 2. A binary relation is defined on the set of surreals $\leq$ such that: $$x\leq y \iff X_L \ngeq y \wedge x\ngeq Y_R$$ where $X_L \ngeq y$ iff there does not exist $x_L\in X_L$ such that $y\leq x_L$, and the same reasoning applies to the second relation where $\nexists y_R \in Y_R \text{ s.t } y_R\leq x$ For now, these rules may seem nebulous, but they will make more sense as we make use of them. Day 0: but where are all the numbers? As it stands, we have 2 rules and… well, nothing to apply them to. Nothing. nothing. Here’s an idea: let’s let the first number be composed of nothing! As in, let our first number, call it $X_0$ for now, have: $$\newcommand{\null}{\varnothing}X_L=\varnothing=\text{empty set}=X_R$$ And so, $$X_0=\sur{\null}{\varnothing}$$ To verify that $X_0$ is actually a number by the surreal rules, let’s check that $X_0$ does indeed satisfy rule 1: Okay well.. we need to prove that for all $x_R \in X_R$, there does not exist any $x_L \in X_L$ such that $x_L&gt;=x_R$.. But there’s a problem: there doesn’t even exist any $x_L$ and $x_R$ in $\null$ for us to compare. Hence, Rule 1 holds vacuously! $X_0$ is indeed a surreal number. This is great! Because we can use the null set for comparisons, it makes our work so much easier. We can create so many forms now. As our conclusion for Day 0, let’s call this progenitor number $0$. We will see that the surreal zero also behaves like the real zero soon. Surreal Zero Let $\null$ be the empty set. Then: $$0=\sur{\null}{\null}$$ Day 1: comparisons with nothing Time to use combinations of $0$ and $\null$ to create new numbers! Let’s call 7 $$X_1=\sur{\{0\}}{\null}, X_2=\sur{\null}{\{0\}}$$ Since we have a total of 3 numbers 8 now, we can begin comparing them with the binary relation described in Rule 2! $0\stackrel{?}{\leq}0$ \begin{align*} x&amp;=0=y\\ X_L &amp;\stackrel{?}{\ngeq} y \\ x_L&amp;\nexists, \checkmark\\ x&amp;\stackrel{?}{\ngeq} Y_R \\ y_R&amp;\nexists, \checkmark \end{align*} $0\leq 0\checkmark$ $0\stackrel{?}{\leq}X_1$ \begin{align*} X_L&amp;=\null=X_R\\ Y_L&amp;=\{0\}, Y_R=\null\\ X_L&amp;\stackrel{?}{\ngeq}y, \checkmark\\ x=0&amp;\stackrel{?}{\ngeq}Y_R=\null, \checkmark \end{align*} $0\leq X_1\checkmark$ $X_2\stackrel{?}{\leq}0$ \begin{align*} X_L&amp;=\{0\}, X_R=\null\\ Y_L&amp;=\null=Y_R\\ X_L=0&amp;\stackrel{?}{\ngeq}0, \checkmark\\ x&amp;\stackrel{?}{\ngeq}Y_R=\null, \checkmark \end{align*} $0\leq X_1\checkmark$ Nice! We’ve ordered some of the surreals. But notice that this $X_1, X_2$ behave just like our usual $1,-1$ in the reals… As in, in the reals, we have $0\leq 1$ and here too, $0\leq X_1$, and a similar reasoning follows for $X_2$. One can also intuit that $X_1 \nleq X_2$, as well as $X_1 \nleq 0$ and $0\nleq X_2$, and it then intuitively holds that $0&lt;X_1$ and $X_2&lt;0$, but we still haven’t really defined what it means for two numbers to be “equal”. We’ll get to this later. So, by Day 1, we conclude: By Day 1: Field identities! $0\leq 0$ $X_1 = 1, X_2 =-1$ $0\leq 1, -1\leq 0$ interlude; infinite birth and tosets Before we begin comparing our newly generated numbers with each other and make new surreals on Day 2, it is useful for us to start reflecting on the nature of the rules. First off, you may’ve noticed that when we compare two numbers $x\leq y$, we are quantifying every number in the first’s leftmost set. That is, we say $\forall x_L \in X_L, x_L \ngeq y$. But intuitively, if we pick $\max(X_L)=x_L$ instead, we can do just one comparison instead of as many are in $X_L$! Because we are guaranteed to be comparing the biggest element of this left set and ensuring it is not bigger than $y$, then no others in the left set are bigger than $y$. A similar reasoning follows where we pick $\min(Y_R)$ to compare with $x$. 2/8/25: guess i need to complete this huh  &#8617;  &#8617; I should honestly make a whole blog just about this, but it follows a 2D universe of cells, each of which can be alive or dead, with rules determining if a cell will live or not. Sadly, Conway passed away in 2020 from COVID. xkcd published this gif later on, titled RIP John Conway  &#8617; CompSci god. He created the TeX typesetting system, and all math on this page is rendered using TeX (well, MathJax) &#8617; imagine having a wife and still running away with her to a hotel to, in Knuth’s own words, “experience what it’d be like to have a little affair in a hotel room”. CompSci people are just different. &#8617; for another (longer) book which has the same dialogue format, see Concepts, Problems, and Solutions in School Calculus: A Dialogue Approach by Tarasov and Kumar. &#8617; Now, $X_1, X_2$ are both numbers since there is no element in the empty set to generate comparisons with. In fact, we will come upon a result soon where any number with an empty left or right set is a valid surreal form. &#8617; $\surs{\{0\}}{\{0\}}$ is not a valid form. Why? &#8617;]]></summary></entry><entry><title type="html">Why Linear Congruence Generators aren’t really random &amp;amp; how to break them</title><link href="/2025/03/01/why-lcgs.html" rel="alternate" type="text/html" title="Why Linear Congruence Generators aren’t really random &amp;amp; how to break them" /><published>2025-03-01T00:00:00+03:00</published><updated>2026-06-25T19:21:54+03:00</updated><id>/2025/03/01/why-lcgs</id><content type="html" xml:base="/2025/03/01/why-lcgs.html"><![CDATA[<p><em id="fl">T</em>he other day, I was messing with Java and its <code class="language-java">Math.Random()</code> static method. For those not familiar with what this method does, it generates a ‘random’ double in the range <span class="math">$[0,1)$</span>. 
I messed around with this method a bit before I figured out I could transform this range to any <span class="math">$[a,b]$</span> I wanted, <span class="math">$a,b \in \mathbb{Z}$</span>, by doing:<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup></p>
<pre class="line-numbers"><code class="language-java">int randInt = (int) ((b-a+1)*Math.Random()+a) </code></pre>

<p>Pretty neat, right?</p>

<p>So I went on and decided to generate a few random numbers to test out what I had:</p>

<pre class="line-numbers"><code class="language-java">int a = 1;
int b = 10;
int numSamples = 20;
ArrayList&lt;Integer&gt; l = new ArrayList&lt;&gt;();
for (int i=0; i&lt;numSamples; i++){
    int rand = (int) ((b - a + 1) * Math.random() + a);
    l.add(rand);
}
for (int num: l){
    System.out.print(num+", ");
}
</code></pre>

<pre class="command-line language-bash" data-user="root" data-host="localhost" tabindex="0">
<code class="language-bash">3, 2, 8, 4, 1, 5, 5, 3, 10, 1, 9, 1, 1, 2, 9, 1, 2, 3, 2, 7, 
Process finished with exit code 0</code>
</pre>

<p>To my surprise, this ‘random’ number generator had generated <span class="math">$1$</span> 5 times, making <span class="math">$\frac 1 4$</span> of all numbers generated a <span class="math">$1$</span>…</p>

<p>Perhaps it was just the scarce sample size, I thought, and I decided to better visualize my data:</p>

<pre class="line-numbers"><code class="language-java">int a = 1;
int b = 10;
int numSamples = 30;
ArrayList&lt;Integer&gt; l = new ArrayList&lt;&gt;();
HashMap&lt;Integer, Integer&gt; hashMap = new HashMap&lt;&gt;();

// initialize map 
for (int i = a; i &lt;= b; i++) {
    hashMap.put(i, 0);
}

// insert random ints into list
for (int i = 0; i &lt; numSamples; i++) {
    int rand = (int) ((b - a + 1) * Math.random() + a);
    l.add(rand);
}

// move list to map
for (int i : l) {
    hashMap.put(i, hashMap.get(i) + 1);
}

// print
System.out.println("Results:");
for (int key : hashMap.keySet()) {
    System.out.println(key + ": " + hashMap.get(key));
}
</code></pre>

<pre class="command-line language-bash" data-user="root" data-host="localhost" tabindex="0">
<code class="language-bash">Results:
1: 1
2: 1
3: 6
4: 5
5: 3
6: 0
7: 4
8: 6
9: 1
10: 3

Process finished with exit code 0</code>
</pre>

<p><span class="math">$3,8$</span> 6 times?! That doesn’t seem random at all! Repeating with 100 samples:</p>

<pre class="command-line language-bash" data-user="root" data-host="localhost" tabindex="0">
<code class="language-bash">Results:
1: 4
2: 15
3: 10
4: 15
5: 10
6: 11
7: 6
8: 13
9: 6
10: 10

Process finished with exit code 0</code>
</pre>

<p>Hmm… Still very out of proportion..</p>

<p>I eventually tried a million samples and the results, although more uniform, still seemed unpredictable. Why was this? I went and asked ChatGPT for answers.</p>
<h1 id="introduction-to-lcgs">Introduction to LCGs</h1>
<p>GPT postulated that the inaccuracy comes from my several <span class="alert">floating arithmetic</span><sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup> operations perhaps resulting in errors— exacerbated by my casting of the double to an int.</p>

<p>However, it also mentioned that these results may just be coincidental, as <code class="language-java">Math.Random()</code> uses a <span class="alert">Linear Congruential Generator (LCG)</span> to generate numbers, which is statistically reliable but not cryptgraphically so.</p>

<p>This concession piqued my interest. Why wasn’t something random seeming not reliable? And why was the distinction between statistical reliability and cryptographical reliablity important? So I set out to find more about these LCGs, coming across their definition.</p>

<div class="math-def" id="def-LCG">Given an initial state $X_0$, an LCG generates subsequent 'random' numbers by using:
$$X_{n+1}=aX_n +b \pmod m$$

where $a$ is called the <span class="alert">multiplier</span>, $b$ the <span class="alert">addend</span>, and $m$ the <span class="alert">modulus</span> or base.
</div>

<p>The state in this definition is derived from some source of entropy, like the system’s time.</p>

<p>So it then takes the state, and using some absurdly large modulus and weird addends and multipliers, determines the next state. For example, for <span class="math">$X_0=23, a=13, b=5, m=48$</span>, we have:</p>

<div class="math">\begin{align*}
X_1 &amp;= aX_0 +b \pmod m = 13(23)+5 \pmod{48} = 16\\
X_2 &amp;= aX_1 +b \pmod m = 13(17)+5 \pmod{48} =21\\
X_3 &amp;= aX_2 +b \pmod m = 13(47)+5 \pmod{48} =38\\
\vdots
\end{align*}</div>

<p>In fact, this sequence has been proven to only repeat after <span class="math">$m$</span> terms by the <a class="link" target="_blank" href="https://www.howardrudd.net/mathematics/hull-and-dobells-first-theorem/">Hull-Dobell Theorem</a>. That is, this will generate a sequence of random numbers for 48 times, after which it returns to <span class="math">$X_0$</span> and repeats. You can test this out yourself by implementing an <code class="language-java">lcg()</code> method yourself and running it in a loop. <sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">3</a></sup></p>

<p>And, as it turns out the sequences generated by such an algorithm are indeed statistically random<sup id="fnref:4"><a href="#fn:4" class="footnote" rel="footnote" role="doc-noteref">4</a></sup>. So what about cryptographic reliability? We know the method is deterministic, that is, we can find the next numbers of the sequence given some— but only if we also know the parameters <span class="math">$a, b, m$</span>. But we don’t!</p>

<p>Well, it turns out that a little bit of number theory magic and wizardry can be performed to find <span class="math">$a, b, m$</span> by manipulating terms of the sequence.</p>

<h1 id="breaking-lcgs">Breaking LCGs</h1>
<p>This section will be dedicated to reviewing a method on how to break LCGs, motivated (but heavily adjusted and standardized<sup id="fnref:5"><a href="#fn:5" class="footnote" rel="footnote" role="doc-noteref">5</a></sup>) by <a class="link" target="_blank" href="https://www.cs.umd.edu/~gasarch/COURSES/456/F18/notes/crackrand.pdf">James Reeds’ initial demonstration</a> in 1977.</p>

<p>To break an LCG, it suffices to be able to predict the next term in a sequence of given consecutive terms by finding <span class="math">$a, b, m$</span>.</p>

<h2 id="finding-the-modulus">Finding the modulus</h2>

<p>We begin by getting any 3 numbers generated by a LCG, call them <span class="math">$X_n, X_{n+1}, X_{n+2}$</span>. Then, by <a class="link" href="#def-LCG">the definition of an LCG</a>:</p>

<div class="math">\begin{align}
X_n &amp;= aX_{n-1} +b &amp;&amp;\pmod m \tag{I}\\
X_{n+1} &amp;= aX_{n} +b &amp;&amp;\pmod m \tag{II}\\
X_{n+2} &amp;= aX_{n+1} +b &amp;&amp;\pmod m \tag{III}
\end{align}</div>

<p>Recall that the definition of modular arithmetic is as follows:</p>

<div class="math-def" id="def-mod">
For $X,a,b,c,d,M \in \mathbb{Z}$:
$$X=a \pmod b \iff (X-a)\mid b \iff \frac{b}{(X-a)}=k$$

where $a\mid b$ means <span class="alert">a divides b</span>, so $\frac{b}{a}=k$ for some $k\in\mathbb{Z}$.<br />

It is also useful to demonstrate some facts whose proofs are trivial and left as an exercise to the reader. 
<ul>
  <li>If $a=b\pmod m$ and $c=d\pmod m$, then:
$(a\pm c)=(b\pm d) \pmod m$</li>
  <li>If $a=b\pmod m$, then $ca=cb \pmod m$</li>
  <li>If $a=0\pmod m$, then it means that $a$ is some multiple of $m$</li>
</ul>
</div>

<p>So we may subtract <span class="math">$\text{(I)}$</span> from <span class="math">$\text{(II)}$</span> and <span class="math">$\text{(II)}$</span> from <span class="math">$\text{(III)}$</span> to obtain the following, eliminating <span class="math">$b$</span>:</p>

<div class="math">\begin{align}
X_{n+1}-X_{n} &amp;= aX_n-aX_{n-1}  = a(X_n-X_{n-1}) &amp;&amp;\pmod m\tag{IV}\\
X_{n+2}-X_{n+1} &amp;= aX_{n+1}-aX_n  = a(X_{n+1}-X_n) &amp;&amp;\pmod m\tag{V}
\end{align}</div>

<p>Then, multiply <span class="math">$\text{(IV)}$</span> by <span class="math">$(X_{n+1}-X_n)$</span> and <span class="math">$\text{(V)}$</span> by <span class="math">$(X_n-X_{n-1})$</span> and subtract the resulting equations to eliminate <span class="math">$a$</span>:</p>

<div class="math">\begin{align}
(X_{n+1}-X_{n})(X_{n+1}-X_n) &amp;= \cancel{a(X_n-X_{n-1})(X_{n+1}-X_n)} &amp;&amp;\pmod m\\
-(X_{n+2}-X_{n+1})(X_n-X_{n-1}) &amp;= \cancel{a(X_{n+1}-X_n)(X_n-X_{n-1})} &amp;&amp;\pmod m \\ 
(X_{n+1}-X_{n})^2-(X_{n+2}-X_{n+1})(X_n-X_{n-1}) &amp;= 0 \pmod m \tag{VI}
\end{align}</div>

<p>So many <span class="math">$X$</span>s! But now we have gotten rid of both <span class="math">$a, b$</span>, albeit at the cost of our eyes having to see some of the most disgusting notation on Earth. So let’s try to clean this up;</p>

<p>You may notice that <span class="math">$(X_{n+2}-X_{n+1})$</span> in (VI) can be rewritten as <span class="math">$(X_{(n+1)+1}-X_{(n+1)})$</span>…</p>

<p>Also, <span class="math">$(X_{n}-X_{n-1})=(X_{(n-1)+1}-X_{(n-1)})$</span></p>

<p>This is great because now we can set:</p>

<div class="math">\begin{align*}
S_n &amp;= X_{n+1}-X_n &amp;&amp;\pmod m \\
\text{and so, (VI) becomes:}\\
Q_n &amp;= S_{n+1}^2-S_{n+2} S_n &amp;&amp;\pmod m\\
\text{which we just showed:}\\
Q_n &amp;= 0 &amp;&amp;\pmod m
\end{align*}</div>

<p>Okay, now take a deep breath. The hardest part is <em>almost</em> over.</p>

<p>Now, this indicates that <span class="math">$Q_n$</span> is a multiple of <span class="math">$m$</span>. That is, <span class="math">$Q_n =k_n m$</span> for some <span class="math">$0&lt;=k&lt;Q_n$</span>. Furthermore, we notice that <span class="math">$Q_n/m=k_n$</span> implies that <span class="math">$m$</span> is a divisor of <span class="math">$Q_n$</span>.</p>

<p>Consider <span class="math">$L_n$</span>, a set of all divisors of <span class="math">$Q_n$</span>. Then:</p>

<div class="math">$$L_n \equiv \{1, d_1, d_2, d_3, \ldots \}$$</div>

<p>Where <span class="math">$m$</span> must be in this list. Now, if <span class="math">$m$</span> is in the interior of the set, then it isn’t really mathematically striking. However, if <span class="math">$m$</span> is the <em>largest element</em> of this set, then it is called the <span class="alert">Greatest Divisor</span> of <span class="math">$Q_n$</span>, which can be forcefully computed by several algorithms<sup id="fnref:6"><a href="#fn:6" class="footnote" rel="footnote" role="doc-noteref">6</a></sup>.</p>

<p>These algorithms can be extended to find the Greatest Common Divisor of two (or more) numbers, denoted by <span class="math">$\gcd(a,b)$</span>.</p>

<p>With this in mind, consider <span class="math">$\gcd(Q_{n},Q_{n+1})$</span>. Observe<sup id="fnref:7"><a href="#fn:7" class="footnote" rel="footnote" role="doc-noteref">7</a></sup>:</p>

<div class="math">\begin{align*}
\gcd(Q_{n},Q_{n+1})&amp;=\gcd(k_n m,k_{n+1}m)\\
&amp;=m\gcd(k_n, k_{n+1})
\end{align*}</div>

<p>But we wish to seek <span class="math">$\gcd(Q_{n},Q_{n+1})=m$</span>…</p>

<div class="math">\begin{align*}
\gcd(Q_{n},Q_{n+1})&amp;=m\\
m\gcd(k_n, k_{n+1})&amp;=m\\
\gcd(k_n, k_{n+1})&amp;=1
\end{align*}</div>

<p>To those of you who are familiar with number theory, this just lit the brightest bulb in your head.</p>

<p>To those of you who aren’t, here’s why:</p>

<p>In number theory, it is a well-known fact that the probability that 2 integers are co-prime<sup id="fnref:8"><a href="#fn:8" class="footnote" rel="footnote" role="doc-noteref">8</a></sup> is <span class="math">$\frac{6}{\pi^2}$</span>, <span class="math">$\pi$</span> sneaking its way into the probability through the <a class="link" target="_blank" href="https://en.wikipedia.org/wiki/Riemann_zeta_function">Reimann-Zeta function</a>, which can be used to express the probability that <span class="math">$n$</span> integers are co-prime with <span class="math">$\frac{1}{\zeta(n)}$</span><sup id="fnref:9"><a href="#fn:9" class="footnote" rel="footnote" role="doc-noteref">9</a></sup></p>

<p>Euler, in one of his many strokes of genius, proved that <span class="math">$\zeta(2)=\frac{\pi^2}{6}$</span><sup id="fnref:10"><a href="#fn:10" class="footnote" rel="footnote" role="doc-noteref">10</a></sup>. Thus the probability of our two integers being co-prime is <span class="math">$\frac{1}{\zeta(2)}=\frac{6}{\pi^2}\approx 60\%$</span>. And this probability increases exponentially for greater numbers of integers given, allowing us to find <span class="math">$m$</span> with fantastic certainty— if we simply generate <span class="math">$\gcd(Q_1, Q_2, Q_3, \ldots, Q_{n-3})$</span>.</p>

<p>Luckily for us, any good computer is able to do this with high efficiency. Thus, <span class="math">$m$</span> is found.<sup id="fnref:11"><a href="#fn:11" class="footnote" rel="footnote" role="doc-noteref">11</a></sup></p>

<pre class="line-numbers"><code class="language-java">class modulusFinder{
    private int[] outputs; // the lcg outputs, len&gt;=3
    private int[] Sn; // Xn+1-Xn
    private int[] Qn; // Sn+1^2 -Sn+2*Sn
    private int mod;

    public modulusFinder(int[] outputs){
        this.outputs=outputs;
        Sn= new int[outputs.length-1];
        for (int i=0; i&lt;outputs.length-1; i++){
            Sn[i]=outputs[i+1]-outputs[i];
        }
        Qn=new int[Sn.length];
        for (int i=0; i&lt; Sn.length-2; i++){
            Qn[i]=Sn[i+1]*Sn[i+1]-Sn[i+2]*Sn[i];
        }
        mod=gcdArr(Qn); // call gcd of all Qn
    }
    /* finds the gcd of two numbers using a modified euclidean algo */
    public static int gcd(int x, int y){
        if (y == 0) return x;
        return gcd(y, x%y);
    }
    /* calls gcd on all elements of an array */
    public static int gcdArr(int[] arr) {
        int result = arr[0];
        for (int i : arr) {
            result = gcd(result, i);
            if (result == 1) return 1;
        }
        return result;
    }

    /* what we built up to. */
    public void getModulus(){
        System.out.println("The modulus m is: "+mod);
    }
}
</code></pre>
<h2 id="finding-the-multiplier">Finding the multiplier</h2>
<p>From here on out, everything becomes quite trivial.
Recall <span class="math">$\text{(V)}$</span>:</p>

<div class="math">\begin{align*}
X_{n+2}-X_{n+1} &amp;= a(X_{n+1}-X_n) &amp;&amp;\pmod m \tag{V}\\
a &amp;= (X_{n+2}-X_{n+1})(X_{n+1}-X_n)^{-1} &amp;&amp;\pmod m
\end{align*}</div>

<p>where <span class="math">$(X_{n+1}-X_n)^{-1}$</span> is the <span class="alert">modular inverse of the argument</span><sup id="fnref:12"><a href="#fn:12" class="footnote" rel="footnote" role="doc-noteref">12</a></sup> with respect to <span class="math">$m$</span>. Thus, <span class="math">$a$</span> is found.</p>

<pre class="line-numbers"><code class="language-java">/* returns coefficients of bezouts identity &amp; the gcd. */
public static int[] extendedgcd(int a, int b){
    if (b==0){
        int[] base = {a, 1, 0}; // the base case has gcd(a,0)=a(1)+0(0)
        return base;
    }
    int[] subdiv = extendedgcd(b, a%b); // break up the problem 
    int gcd =subdiv[0]; 
    int subdivX = subdiv[1];
    int subdivY = subdiv[2];
    int divX = subdivY;
    int divY= subdivX-(a/b)*subdivY;
    int[] div = {gcd, divX, divY};
    return div;
}
/* takes the inverse, with precondition of coprimality of parameters */
public static int modInv(int a, int m){
    int[] result = extendedgcd(a,m);
    int inv = result[1];
    return (inv%m +m) % m;
}
</code></pre>

<h2 id="finding-the-addend">Finding the addend</h2>
<p>Finally, recall <span class="math">$\text{(II)}$</span>.</p>
<div class="math">\begin{align*}
X_{n+1} &amp;= aX_{n} +b &amp;&amp;\pmod m \tag{II}\\
b &amp;= X_{n+1}-aX_{n} &amp;&amp;\pmod m
\end{align*}</div>

<p>Plain and simple, we are done!</p>

<h2 id="final-code-">Final Code <sup id="fnref:13"><a href="#fn:13" class="footnote" rel="footnote" role="doc-noteref">13</a></sup></h2>
<p>The following code breaks any LCG, implementing the math we outlined in this blog, provided you have over 5 outputs of the LCG and there is no processing done to the outputs.</p>

<pre class="line-numbers"><code class="language-java">class lcgCracker{
    private int[] outputs; // the lcg outputs, len&gt;=5, preferably more
    private int[] Sn; // Xn+1-Xn
    private int[] Qn; // Sn+1^2 -Sn+2*Sn
    private int mod;
    private int mult;
    private int add;
    private int next;

    public lcgCracker(int[] outputs){
        this.outputs=outputs;
        Sn= new int[outputs.length-1];
        for (int i=0; i&lt;outputs.length-1; i++){
            Sn[i]=outputs[i+1]-outputs[i];
        }
        Qn=new int[Sn.length];
        for (int i=0; i&lt; Sn.length-2; i++){
            Qn[i]=Sn[i+1]*Sn[i+1]-Sn[i+2]*Sn[i];
        }
        mod=gcdArr(Qn); // call gcd of all Qn
        // compute multiplier (a)
        mult = ((outputs[1] - outputs[2]) * modInv((outputs[0] - outputs[1]), mod)) % mod;
        if (mult &lt; 0) mult += mod; // ensure positive

        // compute addend (b)
        add = (outputs[1] - mult * outputs[0]) % mod;
        if (add &lt; 0) add += mod; // ensure positive

        // Predict the next term
        next = (mult * outputs[outputs.length - 1] + add) % mod;
        if (next &lt; 0) next += mod; // ensure positive
    }

    /* returns coefficients of bezouts identity &amp; the gcd. */
    public static int[] extendedgcd(int a, int b){
        if (b==0){
            int[] base = {a, 1, 0}; // the base case has gcd(a,0)=a(1)+0(0)
            return base;
        }
        int[] subdiv = extendedgcd(b, a%b); // break up the problem
        int gcd =subdiv[0];
        int subdivX = subdiv[1];
        int subdivY = subdiv[2];
        int divX = subdivY;
        int divY= subdivX-(a/b)*subdivY; // see footnote 13
        int[] div = {gcd, divX, divY};
        return div;
    }

    /* calls gcd on all elements of an array */
    public static int gcdArr(int[] arr) {
        int result = arr[0];
        for (int i : arr) {
            result = Math.abs(extendedgcd(result, i)[0]);
            if (result == 1) return 1;
        }
        return result;
    }

    /* takes the inverse, with precondition of coprimality of parameters */
    public static int modInv(int a, int m){
        a = (a % m + m) % m; // this code is because of java's modulo operator shenanigans.
        int[] result = extendedgcd(a,m);
        int inv = result[1];
        return (inv%m +m) % m;
    }
    public void runCracker(){
        System.out.println("The multiplier is: "+mult);
        System.out.println("The addend is: "+add);
        System.out.println("The modulus is: "+mod);
        System.out.println("And the next term in the lcg is: "+ next);
    }
}

</code></pre>

<h1 id="javas-lcg-attempts-at-cryptographic-reliability">Java’s LCG: Attempts at cryptographic reliability</h1>

<p>I encourage you to try running this code with your own LCG implementation and test it out! See if our math checks out!</p>

<p>However, if you try to call this class on outputs generated from, say Java’s LCG, it won’t return the right parameters at all. Why is this?</p>

<p>After some digging, I found the code responsible for Java’s <code class="language-java">Math.Random()</code> method:</p>

<pre class="line-numbers"><code class="language-java">/**
     * The internal state associated with this pseudorandom number generator.
     * (The specs for the methods in this class describe the ongoing
     * computation of this value.)
     */
    private final AtomicLong seed;

    private static final long multiplier = 0x5DEECE66DL; // 25214903917
    private static final long addend = 0xBL; // 11
    private static final long mask = (1L &lt;&lt; 48) - 1; // 1L is 1, shift to left 48 units for 10000000.... then -1 to get 01111... (48 times)

    protected int next(int bits) {
        long oldseed, nextseed;
        AtomicLong seed = this.seed;
        do {
            oldseed = seed.get();
            nextseed = (oldseed * multiplier + addend) &amp; mask;
        } while (!seed.compareAndSet(oldseed, nextseed));
        return (int)(nextseed &gt;&gt;&gt; (48 - bits)); // shift nextseed by 48-bits right ; fill the left with 48-bits zeroes
    }

    @Override
    public long nextLong() {
        // it's okay that the bottom word remains signed.
        return ((long)(next(32)) &lt;&lt; 32) + next(32); //gens a 64 bit number, upper half is next(32), lower half is next(32) (second call)
    }

    default double nextDouble() {
        return (nextLong() &gt;&gt;&gt; (Double.SIZE - Double.PRECISION)) * 0x1.0p-53; //extract top 53 bits only, and multiply by 2exp-53 to map to a decimal in 0,1
    }
// the math class then calls this nextdouble method for .Random()
</code></pre>

<p>So much processing of <code class="language-java">next(bits)</code>! The makers of Java’s LCG probably realized that LCGs… well, aren’t the most secure, and decided to add several layers of processing to make it a bit more secure;</p>

<ul class="method-anal">

<li> <code class="language-java">protected int next(int bits)</code>: this is the actual call to the LCG, and the code is self explanatory, except perhaps for the return statement. What the return statement does is it takes the new generated state, and actually <em>shift</em> it 48 minus the input to the right. This means whatever our binary representation for the state was, would be preceded by  <span class="math">$48-\text{bits}$</span> <span class="math">$0$</span>s.</li>
<li> <code class="language-java">public long nextLong()</code>: this method takes a LCG state with 16 leading 0s, shift it 32 bits to the left (remove those leading 0s), then add that to another, newly generated state with 32 leading zeroes. This creates a new number whose binary representation has an upper half consisting of the first call's binary representation and lower second call, generating a 64-bit number.</li>
<li> <code class="language-java">default double nextDouble()</code>: Finally, this is the method called by <code class="language-java">Math.Random()</code>. It takes the output of <code class="language-java">nextLong()</code>, an already processed state, and take only the top 53 bits. Then, it maps that to the interval <span class="math">$[0,1)$</span> by division as needed.</li>

</ul>

<p>Despite all this processing, however, the output is <em>still not random</em>.</p>

<p><a class="link" target="_blank" href="https://www.math.cmu.edu/~af1p/Texfiles/LINEARCONGRU.pdf">Frieze, Kannan, Lagarias</a> outlined an algorithm in a 1984 IEEE presentation which mathematically proved that all LCGs are predictable <em>in polynomial time</em>, given that two fifths of the original sequence’s leading bits were provided. This built on prior solutions to breaking LCGs with all the bits of the outputs, and demonstrated that—contrary to prior belief— manipulation of LCG outputs does NOT make them secure.</p>

<p><a class="link" target="_blank" href="https://www.math.cmu.edu/~af1p/Texfiles/RECONTRUNC.pdf">Frieze, Kannan, Lagarias, <em>et al.</em></a> later went on to strengthen their result to any linear congruences manipulating the outputs in 1988.</p>

<h1 id="conclusion">Conclusion</h1>

<p>Well wasn’t that one hell of a trip? We’ve just built a Java class to break LCGs!</p>

<p>What I hope to convey through this post is the immense power that a solid grasp of mathematics— in this case, number theory— can have in Computer Science.</p>

<p>If you’ve taken a look at the timeline on my <a class="link" target="_blank" href="/index.html">home page</a>, you’ll know that my passion for math predates my interest in CS. But once I saw how seamlessly math and CS complement<sup id="fnref:14"><a href="#fn:14" class="footnote" rel="footnote" role="doc-noteref">14</a></sup> each other, I found myself yearning to dive deeper into the intersection<sup id="fnref:15"><a href="#fn:15" class="footnote" rel="footnote" role="doc-noteref">15</a></sup> between these two fields. It’s a space that continues to fuel my curiosity, and I’m excited to explore it further.</p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p><span class="math" style="color: rgb(126,16,16);filter: brightness(50%);">$[0,1)\to (0,b-a+1)\to (a,b+1) \to [a,b]$</span> <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>See <a class="link" target="_blank" href="https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems" style="color: rgb(126,16,16);">Floating-point arithmetic accuracy problems</a> <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3">
      <pre class="line-numbers">    <code class="language-java">    public static int lcg(int x, int a, int b, int m){
            return (a*x+b)%m;}
</code>
</pre>
      <pre class="line-numbers"><code class="language-java">    int state=23;
    int xn=state;
    int count=0;
    while ((count==0) || (xn!=state)){
        xn = lcg(xn,13,5,48);
        count++;
    }
    System.out.println(count);
</code></pre>
      <p><a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4">
      <p>See Knuth’s <em>The Art of Computer Programming</em> Chapter 3.2, in which he proves this fact. <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5">
      <p>Reeds’ original note does not develop a solid algorithm to break LCGs, it only serves to demonstrate that they <em>are</em> breakable. <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6">
      <p>See the <a class="link" target="_blank" style="color: rgb(126,16,16);" href="https://en.wikipedia.org/wiki/Euclidean_algorithm">Euclidean Algorithm</a>. <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:7">
      <p>To show that <span class="math" style="filter: brightness(50%);">$\gcd(ma,mb)=m\gcd(a,b)$</span> holds, consider Bezout’s Identity (to prove this, use the division algorithm!), which states that <span class="math" style="filter: brightness(50%);">$\gcd(a,b)=ax+by$</span> for some <span class="math" style="filter: brightness(50%);">$x,y\in\mathbb{Z}$</span>. Then;</p>
      <div class="math" style="filter: brightness(50%);">$$\gcd(ma,mb)=max+mby=m(ax+by)=m\gcd(a,b)$$</div>
      <p><a href="#fnref:7" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8">
      <p>They share no prime factors, ie: their <span class="math" style="filter: brightness(50%);">$\gcd()$</span> is 1, which is exactly what we have. <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:9">
      <p>See <a class="link" target="_blank" href="https://en.wikipedia.org/wiki/Coprime_integers#Probability_of_coprimality" style="color: rgb(126,16,16);">Probability of coprimality of many integers</a> <a href="#fnref:9" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:10">
      <p>I also have a ground-breaking proof of this problem but its too complicated to <span class="math" style="filter: brightness(50%);">$\LaTeX$</span> and won’t fit in the footnotes anyway. <a href="#fnref:10" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:11">
      <p>Of course, this requires at least 2 outputs of <span class="math" style="filter: brightness(50%);">$Q_n$</span>, meaning it requires 5 LCG outputs, with which it will break the LCG with roughly 60% certainty <span class="math" style="filter: brightness(50%);">$\left(\frac{6}{\pi^2}\right)$</span>. With 6 outputs, this becomes <span class="math" style="filter: brightness(50%);">$\frac{1}{\zeta(3)}\approx 83\%$</span> <a href="#fnref:11" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:12">
      <p>This can also done using an extension of the Euclidean algorithm called the <a class="link" target="_blank" href="https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm" style="color: rgb(126,16,16);">Extended Euclidean Algorithm</a>. It does this by noting that since the inverse <span class="math" style="filter: brightness(50%);">$X$</span> of <span class="math" style="filter: brightness(50%);">$a \pmod m$</span> exists iff:</p>
      <div class="math" style="filter: brightness(50%);">\begin{align*}
aX &amp;= 1 &amp;&amp;\pmod m\\
\implies \frac{aX-1}{m}&amp;=k\implies aX+m(-k)=1
\end{align*}</div>
      <p>which prompts the usage of Bezout’s identity to find the coefficients through recording the remainders of the algorithm. If the coprimality clause is not met, then one can adjust the formula through algebra and try again. Perhaps I shall make a blog post building up the modular inverse from the division algorithm..? <a href="#fnref:12" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:13">
      <p>How the extended GCD algorithm works, in short, is by reducing our problem to <span class="math" style="color: rgb(126,16,16);filter: brightness(50%);">$\gcd(b, b\pmod a)$</span> (verify this is the same as <span class="math" style="color: rgb(126,16,16);filter: brightness(50%);">$\gcd(a,b)$</span> using <a class="link" target="_blank" href="#def-mod" style="color: rgb(126,16,16);">Definition of modular arithmetics</a>).</p>
      <div class="math" style="filter: brightness(50%);">\begin{align*}
\gcd(b, b\pmod a)&amp;=\gcd(a,b)\\
&amp;= bx'+(b\pmod a)y'\\
&amp;=bx'+\left(a-\lfloor a/b \rfloor b\right)y'\\
&amp;=bx'+ay'-b\lfloor a/b \rfloor y'\\
&amp;=ay'+b\left(x'-\lfloor a/b \rfloor y'\right)\\
\gcd(a,b)&amp;=ay'+b\left(x'-\lfloor a/b \rfloor y'\right)
\end{align*}</div>
      <p>where <span class="math" style="color: rgb(126,16,16);filter: brightness(50%);">$x’, y’$</span> are the bezout coefficients of the subproblem. We know this will always terminate at <code class="language-java">{gcd, 1, 0}</code>, since <span class="math" style="color: rgb(126,16,16);filter: brightness(50%);">$x’=1, y’=0$</span> because <span class="math" style="color: rgb(126,16,16);filter: brightness(50%);">$\gcd(a,0)=a=a(1)+0(0)$</span>, and so we exploit that to find the rest, moving upwards. <a href="#fnref:13" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:14">
      <p>math pun! <a href="#fnref:14" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:15">
      <p>ok, this is the last math pun i promise.. <a href="#fnref:15" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="math" /><category term="cryptography" /><category term="java" /><summary type="html"><![CDATA[The other day, I was messing with Java and its Math.Random() static method. For those not familiar with what this method does, it generates a ‘random’ double in the range $[0,1)$. I messed around with this method a bit before I figured out I could transform this range to any $[a,b]$ I wanted, $a,b \in \mathbb{Z}$, by doing:1 int randInt = (int) ((b-a+1)*Math.Random()+a) Pretty neat, right? So I went on and decided to generate a few random numbers to test out what I had: int a = 1; int b = 10; int numSamples = 20; ArrayList&lt;Integer&gt; l = new ArrayList&lt;&gt;(); for (int i=0; i&lt;numSamples; i++){ int rand = (int) ((b - a + 1) * Math.random() + a); l.add(rand); } for (int num: l){ System.out.print(num+", "); } 3, 2, 8, 4, 1, 5, 5, 3, 10, 1, 9, 1, 1, 2, 9, 1, 2, 3, 2, 7, Process finished with exit code 0 To my surprise, this ‘random’ number generator had generated $1$ 5 times, making $\frac 1 4$ of all numbers generated a $1$… Perhaps it was just the scarce sample size, I thought, and I decided to better visualize my data: int a = 1; int b = 10; int numSamples = 30; ArrayList&lt;Integer&gt; l = new ArrayList&lt;&gt;(); HashMap&lt;Integer, Integer&gt; hashMap = new HashMap&lt;&gt;(); // initialize map for (int i = a; i &lt;= b; i++) { hashMap.put(i, 0); } // insert random ints into list for (int i = 0; i &lt; numSamples; i++) { int rand = (int) ((b - a + 1) * Math.random() + a); l.add(rand); } // move list to map for (int i : l) { hashMap.put(i, hashMap.get(i) + 1); } // print System.out.println("Results:"); for (int key : hashMap.keySet()) { System.out.println(key + ": " + hashMap.get(key)); } Results: 1: 1 2: 1 3: 6 4: 5 5: 3 6: 0 7: 4 8: 6 9: 1 10: 3 Process finished with exit code 0 $3,8$ 6 times?! That doesn’t seem random at all! Repeating with 100 samples: Results: 1: 4 2: 15 3: 10 4: 15 5: 10 6: 11 7: 6 8: 13 9: 6 10: 10 Process finished with exit code 0 Hmm… Still very out of proportion.. I eventually tried a million samples and the results, although more uniform, still seemed unpredictable. Why was this? I went and asked ChatGPT for answers. Introduction to LCGs GPT postulated that the inaccuracy comes from my several floating arithmetic2 operations perhaps resulting in errors— exacerbated by my casting of the double to an int. However, it also mentioned that these results may just be coincidental, as Math.Random() uses a Linear Congruential Generator (LCG) to generate numbers, which is statistically reliable but not cryptgraphically so. This concession piqued my interest. Why wasn’t something random seeming not reliable? And why was the distinction between statistical reliability and cryptographical reliablity important? So I set out to find more about these LCGs, coming across their definition. Given an initial state $X_0$, an LCG generates subsequent 'random' numbers by using: $$X_{n+1}=aX_n +b \pmod m$$ where $a$ is called the multiplier, $b$ the addend, and $m$ the modulus or base. The state in this definition is derived from some source of entropy, like the system’s time. So it then takes the state, and using some absurdly large modulus and weird addends and multipliers, determines the next state. For example, for $X_0=23, a=13, b=5, m=48$, we have: \begin{align*} X_1 &amp;= aX_0 +b \pmod m = 13(23)+5 \pmod{48} = 16\\ X_2 &amp;= aX_1 +b \pmod m = 13(17)+5 \pmod{48} =21\\ X_3 &amp;= aX_2 +b \pmod m = 13(47)+5 \pmod{48} =38\\ \vdots \end{align*} In fact, this sequence has been proven to only repeat after $m$ terms by the Hull-Dobell Theorem. That is, this will generate a sequence of random numbers for 48 times, after which it returns to $X_0$ and repeats. You can test this out yourself by implementing an lcg() method yourself and running it in a loop. 3 And, as it turns out the sequences generated by such an algorithm are indeed statistically random4. So what about cryptographic reliability? We know the method is deterministic, that is, we can find the next numbers of the sequence given some— but only if we also know the parameters $a, b, m$. But we don’t! Well, it turns out that a little bit of number theory magic and wizardry can be performed to find $a, b, m$ by manipulating terms of the sequence. Breaking LCGs This section will be dedicated to reviewing a method on how to break LCGs, motivated (but heavily adjusted and standardized5) by James Reeds’ initial demonstration in 1977. To break an LCG, it suffices to be able to predict the next term in a sequence of given consecutive terms by finding $a, b, m$. Finding the modulus We begin by getting any 3 numbers generated by a LCG, call them $X_n, X_{n+1}, X_{n+2}$. Then, by the definition of an LCG: \begin{align} X_n &amp;= aX_{n-1} +b &amp;&amp;\pmod m \tag{I}\\ X_{n+1} &amp;= aX_{n} +b &amp;&amp;\pmod m \tag{II}\\ X_{n+2} &amp;= aX_{n+1} +b &amp;&amp;\pmod m \tag{III} \end{align} Recall that the definition of modular arithmetic is as follows: For $X,a,b,c,d,M \in \mathbb{Z}$: $$X=a \pmod b \iff (X-a)\mid b \iff \frac{b}{(X-a)}=k$$ where $a\mid b$ means a divides b, so $\frac{b}{a}=k$ for some $k\in\mathbb{Z}$. It is also useful to demonstrate some facts whose proofs are trivial and left as an exercise to the reader. If $a=b\pmod m$ and $c=d\pmod m$, then: $(a\pm c)=(b\pm d) \pmod m$ If $a=b\pmod m$, then $ca=cb \pmod m$ If $a=0\pmod m$, then it means that $a$ is some multiple of $m$ So we may subtract $\text{(I)}$ from $\text{(II)}$ and $\text{(II)}$ from $\text{(III)}$ to obtain the following, eliminating $b$: \begin{align} X_{n+1}-X_{n} &amp;= aX_n-aX_{n-1} = a(X_n-X_{n-1}) &amp;&amp;\pmod m\tag{IV}\\ X_{n+2}-X_{n+1} &amp;= aX_{n+1}-aX_n = a(X_{n+1}-X_n) &amp;&amp;\pmod m\tag{V} \end{align} Then, multiply $\text{(IV)}$ by $(X_{n+1}-X_n)$ and $\text{(V)}$ by $(X_n-X_{n-1})$ and subtract the resulting equations to eliminate $a$: \begin{align} (X_{n+1}-X_{n})(X_{n+1}-X_n) &amp;= \cancel{a(X_n-X_{n-1})(X_{n+1}-X_n)} &amp;&amp;\pmod m\\ -(X_{n+2}-X_{n+1})(X_n-X_{n-1}) &amp;= \cancel{a(X_{n+1}-X_n)(X_n-X_{n-1})} &amp;&amp;\pmod m \\ (X_{n+1}-X_{n})^2-(X_{n+2}-X_{n+1})(X_n-X_{n-1}) &amp;= 0 \pmod m \tag{VI} \end{align} So many $X$s! But now we have gotten rid of both $a, b$, albeit at the cost of our eyes having to see some of the most disgusting notation on Earth. So let’s try to clean this up; You may notice that $(X_{n+2}-X_{n+1})$ in (VI) can be rewritten as $(X_{(n+1)+1}-X_{(n+1)})$… Also, $(X_{n}-X_{n-1})=(X_{(n-1)+1}-X_{(n-1)})$ This is great because now we can set: \begin{align*} S_n &amp;= X_{n+1}-X_n &amp;&amp;\pmod m \\ \text{and so, (VI) becomes:}\\ Q_n &amp;= S_{n+1}^2-S_{n+2} S_n &amp;&amp;\pmod m\\ \text{which we just showed:}\\ Q_n &amp;= 0 &amp;&amp;\pmod m \end{align*} Okay, now take a deep breath. The hardest part is almost over. Now, this indicates that $Q_n$ is a multiple of $m$. That is, $Q_n =k_n m$ for some $0&lt;=k&lt;Q_n$. Furthermore, we notice that $Q_n/m=k_n$ implies that $m$ is a divisor of $Q_n$. Consider $L_n$, a set of all divisors of $Q_n$. Then: $$L_n \equiv \{1, d_1, d_2, d_3, \ldots \}$$ Where $m$ must be in this list. Now, if $m$ is in the interior of the set, then it isn’t really mathematically striking. However, if $m$ is the largest element of this set, then it is called the Greatest Divisor of $Q_n$, which can be forcefully computed by several algorithms6. These algorithms can be extended to find the Greatest Common Divisor of two (or more) numbers, denoted by $\gcd(a,b)$. With this in mind, consider $\gcd(Q_{n},Q_{n+1})$. Observe7: \begin{align*} \gcd(Q_{n},Q_{n+1})&amp;=\gcd(k_n m,k_{n+1}m)\\ &amp;=m\gcd(k_n, k_{n+1}) \end{align*} But we wish to seek $\gcd(Q_{n},Q_{n+1})=m$… \begin{align*} \gcd(Q_{n},Q_{n+1})&amp;=m\\ m\gcd(k_n, k_{n+1})&amp;=m\\ \gcd(k_n, k_{n+1})&amp;=1 \end{align*} To those of you who are familiar with number theory, this just lit the brightest bulb in your head. To those of you who aren’t, here’s why: In number theory, it is a well-known fact that the probability that 2 integers are co-prime8 is $\frac{6}{\pi^2}$, $\pi$ sneaking its way into the probability through the Reimann-Zeta function, which can be used to express the probability that $n$ integers are co-prime with $\frac{1}{\zeta(n)}$9 Euler, in one of his many strokes of genius, proved that $\zeta(2)=\frac{\pi^2}{6}$10. Thus the probability of our two integers being co-prime is $\frac{1}{\zeta(2)}=\frac{6}{\pi^2}\approx 60\%$. And this probability increases exponentially for greater numbers of integers given, allowing us to find $m$ with fantastic certainty— if we simply generate $\gcd(Q_1, Q_2, Q_3, \ldots, Q_{n-3})$. Luckily for us, any good computer is able to do this with high efficiency. Thus, $m$ is found.11 class modulusFinder{ private int[] outputs; // the lcg outputs, len&gt;=3 private int[] Sn; // Xn+1-Xn private int[] Qn; // Sn+1^2 -Sn+2*Sn private int mod; public modulusFinder(int[] outputs){ this.outputs=outputs; Sn= new int[outputs.length-1]; for (int i=0; i&lt;outputs.length-1; i++){ Sn[i]=outputs[i+1]-outputs[i]; } Qn=new int[Sn.length]; for (int i=0; i&lt; Sn.length-2; i++){ Qn[i]=Sn[i+1]*Sn[i+1]-Sn[i+2]*Sn[i]; } mod=gcdArr(Qn); // call gcd of all Qn } /* finds the gcd of two numbers using a modified euclidean algo */ public static int gcd(int x, int y){ if (y == 0) return x; return gcd(y, x%y); } /* calls gcd on all elements of an array */ public static int gcdArr(int[] arr) { int result = arr[0]; for (int i : arr) { result = gcd(result, i); if (result == 1) return 1; } return result; } /* what we built up to. */ public void getModulus(){ System.out.println("The modulus m is: "+mod); } } Finding the multiplier From here on out, everything becomes quite trivial. Recall $\text{(V)}$: \begin{align*} X_{n+2}-X_{n+1} &amp;= a(X_{n+1}-X_n) &amp;&amp;\pmod m \tag{V}\\ a &amp;= (X_{n+2}-X_{n+1})(X_{n+1}-X_n)^{-1} &amp;&amp;\pmod m \end{align*} where $(X_{n+1}-X_n)^{-1}$ is the modular inverse of the argument12 with respect to $m$. Thus, $a$ is found. /* returns coefficients of bezouts identity &amp; the gcd. */ public static int[] extendedgcd(int a, int b){ if (b==0){ int[] base = {a, 1, 0}; // the base case has gcd(a,0)=a(1)+0(0) return base; } int[] subdiv = extendedgcd(b, a%b); // break up the problem int gcd =subdiv[0]; int subdivX = subdiv[1]; int subdivY = subdiv[2]; int divX = subdivY; int divY= subdivX-(a/b)*subdivY; int[] div = {gcd, divX, divY}; return div; } /* takes the inverse, with precondition of coprimality of parameters */ public static int modInv(int a, int m){ int[] result = extendedgcd(a,m); int inv = result[1]; return (inv%m +m) % m; } Finding the addend Finally, recall $\text{(II)}$. \begin{align*} X_{n+1} &amp;= aX_{n} +b &amp;&amp;\pmod m \tag{II}\\ b &amp;= X_{n+1}-aX_{n} &amp;&amp;\pmod m \end{align*} Plain and simple, we are done! Final Code 13 The following code breaks any LCG, implementing the math we outlined in this blog, provided you have over 5 outputs of the LCG and there is no processing done to the outputs. class lcgCracker{ private int[] outputs; // the lcg outputs, len&gt;=5, preferably more private int[] Sn; // Xn+1-Xn private int[] Qn; // Sn+1^2 -Sn+2*Sn private int mod; private int mult; private int add; private int next; public lcgCracker(int[] outputs){ this.outputs=outputs; Sn= new int[outputs.length-1]; for (int i=0; i&lt;outputs.length-1; i++){ Sn[i]=outputs[i+1]-outputs[i]; } Qn=new int[Sn.length]; for (int i=0; i&lt; Sn.length-2; i++){ Qn[i]=Sn[i+1]*Sn[i+1]-Sn[i+2]*Sn[i]; } mod=gcdArr(Qn); // call gcd of all Qn // compute multiplier (a) mult = ((outputs[1] - outputs[2]) * modInv((outputs[0] - outputs[1]), mod)) % mod; if (mult &lt; 0) mult += mod; // ensure positive // compute addend (b) add = (outputs[1] - mult * outputs[0]) % mod; if (add &lt; 0) add += mod; // ensure positive // Predict the next term next = (mult * outputs[outputs.length - 1] + add) % mod; if (next &lt; 0) next += mod; // ensure positive } /* returns coefficients of bezouts identity &amp; the gcd. */ public static int[] extendedgcd(int a, int b){ if (b==0){ int[] base = {a, 1, 0}; // the base case has gcd(a,0)=a(1)+0(0) return base; } int[] subdiv = extendedgcd(b, a%b); // break up the problem int gcd =subdiv[0]; int subdivX = subdiv[1]; int subdivY = subdiv[2]; int divX = subdivY; int divY= subdivX-(a/b)*subdivY; // see footnote 13 int[] div = {gcd, divX, divY}; return div; } /* calls gcd on all elements of an array */ public static int gcdArr(int[] arr) { int result = arr[0]; for (int i : arr) { result = Math.abs(extendedgcd(result, i)[0]); if (result == 1) return 1; } return result; } /* takes the inverse, with precondition of coprimality of parameters */ public static int modInv(int a, int m){ a = (a % m + m) % m; // this code is because of java's modulo operator shenanigans. int[] result = extendedgcd(a,m); int inv = result[1]; return (inv%m +m) % m; } public void runCracker(){ System.out.println("The multiplier is: "+mult); System.out.println("The addend is: "+add); System.out.println("The modulus is: "+mod); System.out.println("And the next term in the lcg is: "+ next); } } Java’s LCG: Attempts at cryptographic reliability I encourage you to try running this code with your own LCG implementation and test it out! See if our math checks out! However, if you try to call this class on outputs generated from, say Java’s LCG, it won’t return the right parameters at all. Why is this? After some digging, I found the code responsible for Java’s Math.Random() method: /** * The internal state associated with this pseudorandom number generator. * (The specs for the methods in this class describe the ongoing * computation of this value.) */ private final AtomicLong seed; private static final long multiplier = 0x5DEECE66DL; // 25214903917 private static final long addend = 0xBL; // 11 private static final long mask = (1L &lt;&lt; 48) - 1; // 1L is 1, shift to left 48 units for 10000000.... then -1 to get 01111... (48 times) protected int next(int bits) { long oldseed, nextseed; AtomicLong seed = this.seed; do { oldseed = seed.get(); nextseed = (oldseed * multiplier + addend) &amp; mask; } while (!seed.compareAndSet(oldseed, nextseed)); return (int)(nextseed &gt;&gt;&gt; (48 - bits)); // shift nextseed by 48-bits right ; fill the left with 48-bits zeroes } @Override public long nextLong() { // it's okay that the bottom word remains signed. return ((long)(next(32)) &lt;&lt; 32) + next(32); //gens a 64 bit number, upper half is next(32), lower half is next(32) (second call) } default double nextDouble() { return (nextLong() &gt;&gt;&gt; (Double.SIZE - Double.PRECISION)) * 0x1.0p-53; //extract top 53 bits only, and multiply by 2exp-53 to map to a decimal in 0,1 } // the math class then calls this nextdouble method for .Random() So much processing of next(bits)! The makers of Java’s LCG probably realized that LCGs… well, aren’t the most secure, and decided to add several layers of processing to make it a bit more secure; protected int next(int bits): this is the actual call to the LCG, and the code is self explanatory, except perhaps for the return statement. What the return statement does is it takes the new generated state, and actually shift it 48 minus the input to the right. This means whatever our binary representation for the state was, would be preceded by $48-\text{bits}$ $0$s. public long nextLong(): this method takes a LCG state with 16 leading 0s, shift it 32 bits to the left (remove those leading 0s), then add that to another, newly generated state with 32 leading zeroes. This creates a new number whose binary representation has an upper half consisting of the first call's binary representation and lower second call, generating a 64-bit number. default double nextDouble(): Finally, this is the method called by Math.Random(). It takes the output of nextLong(), an already processed state, and take only the top 53 bits. Then, it maps that to the interval $[0,1)$ by division as needed. Despite all this processing, however, the output is still not random. Frieze, Kannan, Lagarias outlined an algorithm in a 1984 IEEE presentation which mathematically proved that all LCGs are predictable in polynomial time, given that two fifths of the original sequence’s leading bits were provided. This built on prior solutions to breaking LCGs with all the bits of the outputs, and demonstrated that—contrary to prior belief— manipulation of LCG outputs does NOT make them secure. Frieze, Kannan, Lagarias, et al. later went on to strengthen their result to any linear congruences manipulating the outputs in 1988. Conclusion Well wasn’t that one hell of a trip? We’ve just built a Java class to break LCGs! What I hope to convey through this post is the immense power that a solid grasp of mathematics— in this case, number theory— can have in Computer Science. If you’ve taken a look at the timeline on my home page, you’ll know that my passion for math predates my interest in CS. But once I saw how seamlessly math and CS complement14 each other, I found myself yearning to dive deeper into the intersection15 between these two fields. It’s a space that continues to fuel my curiosity, and I’m excited to explore it further. $[0,1)\to (0,b-a+1)\to (a,b+1) \to [a,b]$ &#8617; See Floating-point arithmetic accuracy problems &#8617; public static int lcg(int x, int a, int b, int m){ return (a*x+b)%m;} int state=23; int xn=state; int count=0; while ((count==0) || (xn!=state)){ xn = lcg(xn,13,5,48); count++; } System.out.println(count); &#8617; See Knuth’s The Art of Computer Programming Chapter 3.2, in which he proves this fact. &#8617; Reeds’ original note does not develop a solid algorithm to break LCGs, it only serves to demonstrate that they are breakable. &#8617; See the Euclidean Algorithm. &#8617; To show that $\gcd(ma,mb)=m\gcd(a,b)$ holds, consider Bezout’s Identity (to prove this, use the division algorithm!), which states that $\gcd(a,b)=ax+by$ for some $x,y\in\mathbb{Z}$. Then; $$\gcd(ma,mb)=max+mby=m(ax+by)=m\gcd(a,b)$$ &#8617; They share no prime factors, ie: their $\gcd()$ is 1, which is exactly what we have. &#8617; See Probability of coprimality of many integers &#8617; I also have a ground-breaking proof of this problem but its too complicated to $\LaTeX$ and won’t fit in the footnotes anyway. &#8617; Of course, this requires at least 2 outputs of $Q_n$, meaning it requires 5 LCG outputs, with which it will break the LCG with roughly 60% certainty $\left(\frac{6}{\pi^2}\right)$. With 6 outputs, this becomes $\frac{1}{\zeta(3)}\approx 83\%$ &#8617; This can also done using an extension of the Euclidean algorithm called the Extended Euclidean Algorithm. It does this by noting that since the inverse $X$ of $a \pmod m$ exists iff: \begin{align*} aX &amp;= 1 &amp;&amp;\pmod m\\ \implies \frac{aX-1}{m}&amp;=k\implies aX+m(-k)=1 \end{align*} which prompts the usage of Bezout’s identity to find the coefficients through recording the remainders of the algorithm. If the coprimality clause is not met, then one can adjust the formula through algebra and try again. Perhaps I shall make a blog post building up the modular inverse from the division algorithm..? &#8617; How the extended GCD algorithm works, in short, is by reducing our problem to $\gcd(b, b\pmod a)$ (verify this is the same as $\gcd(a,b)$ using Definition of modular arithmetics). \begin{align*} \gcd(b, b\pmod a)&amp;=\gcd(a,b)\\ &amp;= bx'+(b\pmod a)y'\\ &amp;=bx'+\left(a-\lfloor a/b \rfloor b\right)y'\\ &amp;=bx'+ay'-b\lfloor a/b \rfloor y'\\ &amp;=ay'+b\left(x'-\lfloor a/b \rfloor y'\right)\\ \gcd(a,b)&amp;=ay'+b\left(x'-\lfloor a/b \rfloor y'\right) \end{align*} where $x’, y’$ are the bezout coefficients of the subproblem. We know this will always terminate at {gcd, 1, 0}, since $x’=1, y’=0$ because $\gcd(a,0)=a=a(1)+0(0)$, and so we exploit that to find the rest, moving upwards. &#8617; math pun! &#8617; ok, this is the last math pun i promise.. &#8617;]]></summary></entry><entry><title type="html">Sepideh Zarrat &amp;amp; The Saffron Crocus</title><link href="/2025/02/28/sepideh-zarrat.html" rel="alternate" type="text/html" title="Sepideh Zarrat &amp;amp; The Saffron Crocus" /><published>2025-02-28T00:00:00+03:00</published><updated>2026-06-27T00:46:50+03:00</updated><id>/2025/02/28/sepideh-zarrat</id><content type="html" xml:base="/2025/02/28/sepideh-zarrat.html"><![CDATA[<p><button id="toggle-lang" class="lang-button">تغییر به فارسی</button></p>
<figure class="figure">
       <img class="figure-image expandable-image" id="main" src="/assets/images/main-painting.jpeg" />
</figure>

<div class="disclaimer">
<img class="alert-img" src="/assets/images/alert.png" />
All images of Sepideh Zarrat's artwork are her intellectual property. All rights are reserved, and no one is permitted to use, reproduce, or distribute these images for any purpose without her explicit permission. This includes, but is not limited to, their use in NFT productions or any other commercial or non-commercial projects.
Any unauthorized copying or misuse is illegal and will result in legal repercussions.
<br /><br />
<p dir="rtl" class="farsi-disc">
  تمامی تصاویر آثار سپیده ذرات متعلق به او بوده و تمامی حقوق محفوظ است.   <br />
  هیچ‌کس بدون اجازه‌ی صریح او حق استفاده، تکثیر، یا انتشار این تصاویر را برای هیچ منظوری ندارد. <br />   
  این شامل، اما محدود به، استفاده در تولید NFT یا هر پروژه‌ی تجاری و غیرتجاری دیگر نیز می‌شود.<br />
  هرگونه کپی‌برداری یا سوءاستفاده غیرمجاز غیرقانونی بوده و با پیگرد قانونی مواجه خواهد شد.
</p>
</div>

<div id="english-content">

On the last day of February, I visited an art gallery in Qatar. The theme was all things Iran--- culture, history, tradition. As an Iranian myself, I naturally gravitated towards most of the art there--- from the floral, woven rugs to the whirling, fantastical portraits.

Yet amidst all of this, one artist stood apart.

In the final exhibit of the gallery, <a class="link" target="_blank" href="https://www.instagram.com/sepideh.zarrat/">Sepideh Zarrat</a> sat painting, back against the entrance. To her right, her past works burst against the pale white wall—-- vivid, untamed, each telling a story both deeply personal and undeniably universal.

I stood, stunned. I took pictures. I asked for her contact.
</div>

<div id="english-content">

I could try to capture her art in my own words, but no description could truly hold its essence. Instead, here is an interview I conducted with her--- an attempt into understanding the three collections she shared that day.

</div>
<div id="farsi-content" dir="rtl">
در آخرین روز فوریه، به گالری هنری‌ای در قطر رفتم. موضوع نمایشگاه ایران بود—فرهنگ، تاریخ، سنت. من که خود ایرانی‌ام، طبیعتاً جذب بسیاری از آثار آنجا شدم؛ از فرش‌های گل‌دار و بافته‌شده گرفته تا پرتره‌های خیال‌انگیز.

اما در میان همه‌ی این آثار، یک هنرمند جدا از بقیه می‌درخشید.

در آخرین بخش نمایشگاه، <a class="link" target="_blank" href="https://www.instagram.com/sepideh.zarrat/">سپیده ذرات</a> نشسته بود و نقاشی می‌کرد.

سمت راستش، آثارش روی دیوار سفید و بی‌روح زنده و رها منفجر شده بودند—پرشور، بی‌مهار، هر یک روایت‌گر داستانی که هم عمیقاً شخصی بود و هم بی‌چون‌وچرا جهانی.

خشکم زد. عکس گرفتم. اسم پیجش را گرفتم.


</div>

<div id="farsi-content" dir="rtl">
می‌توانم تلاش کنم هنر او را با کلمات خودم توصیف کنم، اما هیچ توصیفی قادر به دربرگرفتن جمال آن نیست.

در عوض، این گفت‌وگویی است که با او داشتم—تلاشی برای درک سه مجموعه‌ای که آن روز به نمایش گذاشت.
</div>
<div id="sepideh-box">
  <div class="sepideh-title" id="english-content">featured artist</div>  <div class="sepideh-title" id="farsi-content">هنرمند برجسته</div>
  <img class="figure-image expandable-image" id="sepideh-portrait" src="/assets/images/sepideh.jpeg" style="display: block; position: inherit; left: 0; transform: none;" />
  <div id="insta">
    <a class="link" target="_blank" href="https://www.instagram.com/sepideh.zarrat/" style="text-decoration: underline;">@sepideh.zarrat</a>
  </div>
</div>

<p><em id="questions"><span id="english-content">Your work has a very organic, almost untamed quality. Do you start with a structured vision, or do the forms emerge spontaneously as you create?</span><span id="farsi-content">
  کارهاتون یه کیفیت ارگانیک و رها دارن. آیا با یه ایده مشخص شروع می‌کنین، یا فرم‌ها حین خلق اثر به‌صورت خودجوش شکل می‌گیرن؟
</span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<p><em id="questions"><span id="english-content">Many of your pieces have an ethereal, almost surreal quality. Are there specific influences—artistic, philosophical, or literary—that shape your aesthetic?</span><span id="farsi-content">
  خیلی از آثارتون یه حس اثیری و سوررئال دارن. چه چیزهایی روی سبک و زیبایی‌شناسی شما تأثیر گذاشتن؟ (هنر، فلسفه، ادبیات…)
</span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<p><em id="questions"><span id="english-content">Your use of line and movement is incredibly dynamic. How do you balance fluidity and precision in your technique?</span><span id="farsi-content">
  استفاده شما از خط و حرکت خیلی پویاست. چطور بین رهایی و دقت تعادل برقرار می‌کنین؟
</span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<figure class="figure" id="beating-of-tars">
       <img class="expandable-image figure-image" src="/assets/images/triangular-painting.png" />
          <figcaption class="fig-cap" style="font-size: 14px; width:fit-content; margin-left:auto; margin-right:auto;">
          <div id="english-content">A selection from her collection Beating of "T&amacr;rs"</div>
          <div id="farsi-content">
          از مجموعه ضربان تارها
          </div>
          </figcaption>
</figure>

<p><em id="questions"><span id="english-content">How does your cultural background influence your art? Do Persian poetry and symbolism often inspire your work?</span><span id="farsi-content">
  پیشینه فرهنگی‌تون چقدر روی هنرتون تأثیر گذاشته؟ آیا شعر و نمادگرایی ایرانی نقش بزرگی توی کارهاتون دارن؟
</span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<p><em id="questions"><span id="english-content">What message or experience do you hope viewers take away from your paintings?</span> <span id="farsi-content">
  دوست دارین بیننده‌ها از آثار شما چه تجربه‌ای بگیرن یا چه حسی رو با خودشون ببرن؟
</span></em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<div class="title-container" id="collection">
            <h1 class="title" id="collection">
              <span id="english-content">Zar-Paran, <em>Gold-Threads (Saffron)</em></span>
              <span id="farsi-content">زرپران </span>
            </h1>
          </div>

<figure class="figure">
       <img class="figure-image expandable-image" id="saffron" src="/assets/images/saffron.jpeg" />
</figure>
<p><em id="questions"><span id="english-content">What inspired you to depict the saffron crocus in such an intricate and abstract way?</span><span id="farsi-content">
  چی شد که گل زعفران رو به این شکل به تصویر کشیدین؟
</span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<p><em id="questions"><span id="english-content">In one of your interviews, you mentioned that the fact that saffron farmers sing to the saffron plant before it blooms impacted your collection. How so?</span> <span id="farsi-content">
  تو یکی از مصاحبه‌هاتون گفتین که قبل از اینکه زعفرون سر از خاک دربیاره براش ساز می‌زنن. این موضوع چه تأثیری روی مجموعه‌تون گذاشت؟
</span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<p><em id="questions"><span id="english-content">Saffron has deep cultural and historical significance in many places—does your painting connect to any personal or symbolic meaning?</span> <span id="farsi-content"> زعفران توی فرهنگ‌ها و تاریخ‌های مختلف جایگاه خاصی داره—آیا این نقاشی برای شما یه معنای شخصی یا نمادین داره؟ </span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<p><em id="questions"><span id="english-content">The delicate balance between chaos and structure in your work is fascinating. How do you decide how much control to impose on the lines?</span><span id="farsi-content">
  توی کارتون یه تعادل خاص بین آشوب و نظم وجود داره که خیلی جذابه. چطور تصمیم می‌گیرین که چقدر کنترل روی خطوط داشته باشین؟
</span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<figure class="figure">
       <img class="figure-image expandable-image" id="saffron2" src="/assets/images/saffron-2.jpeg" />
</figure>

<figure class="figure">
    <div class="figure-container">
        <img class="figure-image-n expandable-image" id="saffronX" src="/assets/images/saffron-a.jpeg" />
        <img class="figure-image-n expandable-image" id="saffronX" src="/assets/images/saffron-b.jpeg" />
    </div>
</figure>

<div class="title-container" id="collection">
            <h1 class="title" id="collection">
              <span id="english-content">Based on the works of <em>Mowlana</em> </span>
             <span id="farsi-content">از شعرهای مولانا </span>
            </h1>
          </div>

<figure class="figure">
    <div class="figure-container">
        <img class="figure-image-n expandable-image" id="mowlana1" src="/assets/images/black-fire.jpeg" />
        <img class="figure-image-n expandable-image" id="mowlana1" src="/assets/images/dancing-flame.jpeg" />
    </div>
</figure>
<p><em id="questions"><span id="english-content">How did this particular Mowlana poem influence your artistic choices?</span> <span id="farsi-content"> این شعر خاص از مولانا چطور روی انتخاب‌های هنری شما تأثیر گذاشت؟  </span>  </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<p><em id="questions"><span id="english-content">Your use of color and flowing, tangled forms evokes both motion and emotion. How do you translate poetry into visual language?</span>
<span id="farsi-content">ترکیب رنگ‌ها و فرم‌های درهم‌تنیده توی کارهاتون حس حرکت و احساس رو منتقل می‌کنه. چطور شعر رو به زبان بصری ترجمه می‌کنین؟ </span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<figure class="figure">
    <div class="figure-container" id="mobile-stack">
        <img class="figure-image-n expandable-image" id="mowlana2" src="/assets/images/chaotic-tree.jpeg" />
        <img class="figure-image-n expandable-image" id="mowlana2" src="/assets/images/spiraling-bush.jpeg" />
        <img class="figure-image-n expandable-image" id="mowlana2" src="/assets/images/scorched-earth.jpeg" />
    </div>
</figure>

<div class="title-container" id="collection">
            <h1 class="title" id="collection">
              <span id="english-content">Jabr-e-Jaari, <em>Flowing Constraint</em> </span>
            <span id="farsi-content">جَبْرِجاری</span></h1>
          </div>

<figure class="figure">
    <div class="figure-container">
        <img class="figure-image-n expandable-image" id="jabrjari" src="/assets/images/jabr-1.jpeg" />
        <img class="figure-image-n expandable-image" id="jabrjari" src="/assets/images/jabr-2.jpeg" />
        <img class="figure-image-n expandable-image" id="jabrjari" src="/assets/images/jabr-3.jpeg" />
    </div>
</figure>

<p><em id="questions"><span id="english-content">The swirling dark lines forming the faces create an almost dreamlike or fragmented identity. Is there a particular story behind this piece?</span><span id="farsi-content">
  خطوط درهم و تیره‌ای که چهره‌ها رو شکل می‌دن، یه حس رؤیایی یا هویت تکه‌تکه‌شده ایجاد می‌کنن. آیا داستان خاصی پشت این اثر هست؟
</span></em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<p><em id="questions"><span id="english-content">The contrast between the bold yellow background and the dark forms is striking. What role does color play in shaping the mood of your work?</span><span id="farsi-content">
  تضاد بین پس‌زمینه زرد و فرم‌های تیره خیلی چشمگیره. رنگ چه نقشی توی شکل دادن حال و هوای این کار داره؟
</span> </em></p>

<p><em id="sep">S</em><em class="epideh">epideh Zarrat:</em></p>

<script>
document.addEventListener("DOMContentLoaded", function () {
    const images = document.querySelectorAll(".expandable-image");

    // Create overlay element
    const overlay = document.createElement("div");
    overlay.classList.add("image-overlay");
    document.body.appendChild(overlay);

    let expandedImage = document.createElement("img");
    expandedImage.classList.add("expanded-image");
    overlay.appendChild(expandedImage);

    function checkMobile() {
        return window.matchMedia("(max-width: 768px)").matches;
    }

    images.forEach(img => {
        img.addEventListener("click", function (event) {
            event.stopPropagation(); // Prevents immediate closing
            showImage(img);
        });
    });

    overlay.addEventListener("click", function () {
        hideImage();
    });

    if (!checkMobile()) {
        expandedImage.addEventListener("mouseleave", function () {
            hideImage();
        });
    }

    function showImage(img) {
        expandedImage.src = img.src;
        overlay.classList.add("active");
    }

    function hideImage() {
        overlay.classList.remove("active");
    }
});

  </script>

<script>
document.addEventListener("DOMContentLoaded", function () {
    const toggleButton = document.getElementById("toggle-lang");
    const postTitle = document.getElementById("post-title");

    const englishTitle = "Sepideh Zarrat & The Saffron Crocus";
    const farsiTitle = "سپیده ذرات و گل زرپران";

    let currentLang = localStorage.getItem("language") || "english";

    function updateLanguage(fade = false) {
        if (fade) {
            toggleButton.classList.add("hidden");
            postTitle.classList.add("hidden");

            setTimeout(() => {
                applyLanguageChange();

                toggleButton.classList.remove("hidden");
                postTitle.classList.remove("hidden");
            }, 500);
        } else {
            applyLanguageChange();
        }
    }

    function applyLanguageChange() {

        const englishElements = document.querySelectorAll("#english-content");
        const farsiElements = document.querySelectorAll("#farsi-content");


        englishElements.forEach((el) => {
            el.style.visibility = currentLang === "english" ? "visible" : "hidden";
            el.style.position = currentLang === "english" ? "relative" : "absolute";
        });

        farsiElements.forEach((el) => {
            el.style.visibility = currentLang === "farsi" ? "visible" : "hidden";
            el.style.position = currentLang === "farsi" ? "relative" : "absolute";
        });
        postTitle.classList.toggle("farsi-title", currentLang === "farsi");


        postTitle.textContent = currentLang === "english" ? englishTitle : farsiTitle;
        toggleButton.textContent = currentLang === "english" ? "تغییر به فارسی" : "Switch to English";
    }

    toggleButton.addEventListener("click", function () {

        currentLang = currentLang === "english" ? "farsi" : "english";
        localStorage.setItem("language", currentLang);


        updateLanguage(true);
    });


    updateLanguage();
});
</script>]]></content><author><name></name></author><category term="art" /><category term="persian" /><summary type="html"><![CDATA[تغییر به فارسی All images of Sepideh Zarrat's artwork are her intellectual property. All rights are reserved, and no one is permitted to use, reproduce, or distribute these images for any purpose without her explicit permission. This includes, but is not limited to, their use in NFT productions or any other commercial or non-commercial projects. Any unauthorized copying or misuse is illegal and will result in legal repercussions. تمامی تصاویر آثار سپیده ذرات متعلق به او بوده و تمامی حقوق محفوظ است. هیچ‌کس بدون اجازه‌ی صریح او حق استفاده، تکثیر، یا انتشار این تصاویر را برای هیچ منظوری ندارد. این شامل، اما محدود به، استفاده در تولید NFT یا هر پروژه‌ی تجاری و غیرتجاری دیگر نیز می‌شود. هرگونه کپی‌برداری یا سوءاستفاده غیرمجاز غیرقانونی بوده و با پیگرد قانونی مواجه خواهد شد. On the last day of February, I visited an art gallery in Qatar. The theme was all things Iran--- culture, history, tradition. As an Iranian myself, I naturally gravitated towards most of the art there--- from the floral, woven rugs to the whirling, fantastical portraits. Yet amidst all of this, one artist stood apart. In the final exhibit of the gallery, Sepideh Zarrat sat painting, back against the entrance. To her right, her past works burst against the pale white wall—-- vivid, untamed, each telling a story both deeply personal and undeniably universal. I stood, stunned. I took pictures. I asked for her contact. I could try to capture her art in my own words, but no description could truly hold its essence. Instead, here is an interview I conducted with her--- an attempt into understanding the three collections she shared that day. در آخرین روز فوریه، به گالری هنری‌ای در قطر رفتم. موضوع نمایشگاه ایران بود—فرهنگ، تاریخ، سنت. من که خود ایرانی‌ام، طبیعتاً جذب بسیاری از آثار آنجا شدم؛ از فرش‌های گل‌دار و بافته‌شده گرفته تا پرتره‌های خیال‌انگیز. اما در میان همه‌ی این آثار، یک هنرمند جدا از بقیه می‌درخشید. در آخرین بخش نمایشگاه، سپیده ذرات نشسته بود و نقاشی می‌کرد. سمت راستش، آثارش روی دیوار سفید و بی‌روح زنده و رها منفجر شده بودند—پرشور، بی‌مهار، هر یک روایت‌گر داستانی که هم عمیقاً شخصی بود و هم بی‌چون‌وچرا جهانی. خشکم زد. عکس گرفتم. اسم پیجش را گرفتم. می‌توانم تلاش کنم هنر او را با کلمات خودم توصیف کنم، اما هیچ توصیفی قادر به دربرگرفتن جمال آن نیست. در عوض، این گفت‌وگویی است که با او داشتم—تلاشی برای درک سه مجموعه‌ای که آن روز به نمایش گذاشت. featured artist هنرمند برجسته @sepideh.zarrat Your work has a very organic, almost untamed quality. Do you start with a structured vision, or do the forms emerge spontaneously as you create? کارهاتون یه کیفیت ارگانیک و رها دارن. آیا با یه ایده مشخص شروع می‌کنین، یا فرم‌ها حین خلق اثر به‌صورت خودجوش شکل می‌گیرن؟ Sepideh Zarrat: Many of your pieces have an ethereal, almost surreal quality. Are there specific influences—artistic, philosophical, or literary—that shape your aesthetic? خیلی از آثارتون یه حس اثیری و سوررئال دارن. چه چیزهایی روی سبک و زیبایی‌شناسی شما تأثیر گذاشتن؟ (هنر، فلسفه، ادبیات…) Sepideh Zarrat: Your use of line and movement is incredibly dynamic. How do you balance fluidity and precision in your technique? استفاده شما از خط و حرکت خیلی پویاست. چطور بین رهایی و دقت تعادل برقرار می‌کنین؟ Sepideh Zarrat: A selection from her collection Beating of "T&amacr;rs" از مجموعه ضربان تارها How does your cultural background influence your art? Do Persian poetry and symbolism often inspire your work? پیشینه فرهنگی‌تون چقدر روی هنرتون تأثیر گذاشته؟ آیا شعر و نمادگرایی ایرانی نقش بزرگی توی کارهاتون دارن؟ Sepideh Zarrat: What message or experience do you hope viewers take away from your paintings? دوست دارین بیننده‌ها از آثار شما چه تجربه‌ای بگیرن یا چه حسی رو با خودشون ببرن؟ Sepideh Zarrat: Zar-Paran, Gold-Threads (Saffron) زرپران What inspired you to depict the saffron crocus in such an intricate and abstract way? چی شد که گل زعفران رو به این شکل به تصویر کشیدین؟ Sepideh Zarrat: In one of your interviews, you mentioned that the fact that saffron farmers sing to the saffron plant before it blooms impacted your collection. How so? تو یکی از مصاحبه‌هاتون گفتین که قبل از اینکه زعفرون سر از خاک دربیاره براش ساز می‌زنن. این موضوع چه تأثیری روی مجموعه‌تون گذاشت؟ Sepideh Zarrat: Saffron has deep cultural and historical significance in many places—does your painting connect to any personal or symbolic meaning? زعفران توی فرهنگ‌ها و تاریخ‌های مختلف جایگاه خاصی داره—آیا این نقاشی برای شما یه معنای شخصی یا نمادین داره؟ Sepideh Zarrat: The delicate balance between chaos and structure in your work is fascinating. How do you decide how much control to impose on the lines? توی کارتون یه تعادل خاص بین آشوب و نظم وجود داره که خیلی جذابه. چطور تصمیم می‌گیرین که چقدر کنترل روی خطوط داشته باشین؟ Sepideh Zarrat: Based on the works of Mowlana از شعرهای مولانا How did this particular Mowlana poem influence your artistic choices? این شعر خاص از مولانا چطور روی انتخاب‌های هنری شما تأثیر گذاشت؟ Sepideh Zarrat: Your use of color and flowing, tangled forms evokes both motion and emotion. How do you translate poetry into visual language? ترکیب رنگ‌ها و فرم‌های درهم‌تنیده توی کارهاتون حس حرکت و احساس رو منتقل می‌کنه. چطور شعر رو به زبان بصری ترجمه می‌کنین؟ Sepideh Zarrat: Jabr-e-Jaari, Flowing Constraint جَبْرِجاری The swirling dark lines forming the faces create an almost dreamlike or fragmented identity. Is there a particular story behind this piece? خطوط درهم و تیره‌ای که چهره‌ها رو شکل می‌دن، یه حس رؤیایی یا هویت تکه‌تکه‌شده ایجاد می‌کنن. آیا داستان خاصی پشت این اثر هست؟ Sepideh Zarrat: The contrast between the bold yellow background and the dark forms is striking. What role does color play in shaping the mood of your work? تضاد بین پس‌زمینه زرد و فرم‌های تیره خیلی چشمگیره. رنگ چه نقشی توی شکل دادن حال و هوای این کار داره؟ Sepideh Zarrat:]]></summary></entry><entry><title type="html">On the uniqueness of Binary</title><link href="/2025/02/05/on-the-uniqueness-of-binary.html" rel="alternate" type="text/html" title="On the uniqueness of Binary" /><published>2025-02-05T00:00:00+03:00</published><updated>2026-06-27T00:46:50+03:00</updated><id>/2025/02/05/on-the-uniqueness-of-binary</id><content type="html" xml:base="/2025/02/05/on-the-uniqueness-of-binary.html"><![CDATA[<p><em id="fl">A</em>s someone who enjoys math and (more recently) CS, it is only appropriate that I open my blog with a concept related to the two.</p>

<p>In this post, I intend to demonstrate how the binary system is the smallest such system which can be used to represent every single integer uniquely in one way, providing motivation for why binary is often called the “language of computers” (other than beep boop).</p>

<p>The word <em>binary</em> comes from the latin word <em>bini</em>, which means “two together”. It hence makes sense that the binary number system has only two numerals, represented by <span class="math">$0$</span> and <span class="math">$1$</span>. For comparison, the number system we are all used to—the base-10 system— has 10 different numerals which we can count on our fingers <sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup>.</p>

<p>This means numbers in binary only contain these two numerals, for example <span class="math">$110101$</span> is a binary number. But how does one count with this system?</p>

<h1 id="counting-in-binary">Counting in Binary</h1>
<p>Counting using the binary number system is quite simple. Like our base-10 system, the leftmost symbol has the highest value in binary, and as you proceed rightward, the values become smaller. In base-10, however, you only ‘increment the right’ after the left symbol has surpassed 9, resetting that symbol. This is contrasted to binary, where you only have 0s and 1s and ‘increment the right’ immediately if the left symbol is a 1, resetting it back to a zero.</p>

<p>For example, in base-10, when counting, we proceed as:</p>
<div class="math">$$000, 001, 002, 003, 004, 005, 006, 007, 008, 009, \mathbf{010},\ldots, 019,\mathbf{020}, \ldots, 099, \mathbf{100}, \ldots $$</div>

<p>However, in base-2:</p>
<div class="math">$$000, 001, 010, 011, 100, 101, 110, 111, \ldots $$</div>

<p>But what does each symbol, called a <em>bit</em>, represent?</p>

<p>You may correctly guess that it is something related to the digit 2— after all our entire counting system is based on 2 symbols. Its helpful to think of a binary number as a board of switches— either on (<span class="math">$1$</span>) or off (<span class="math">$0$</span>).</p>

<p>So, the example we gave in the introduction is:</p>

<div class="math">$$110101= \text{on, on, off, on, off, on}$$</div>

<p>and in this system, what is on or off is a <em>power of 2<em>! That is;</em></em></p>

<div class="math">\begin{align*}
&amp;2^5 &amp;&amp;2^4 &amp;&amp;&amp;\,2^3 &amp;&amp;&amp;&amp;\,2^2 &amp;&amp;&amp;&amp;&amp;2^1 &amp;&amp;&amp;&amp;&amp;&amp;2^0\\
&amp;1 &amp;&amp;1 &amp;&amp;&amp;0 &amp;&amp;&amp;&amp;1 &amp;&amp;&amp;&amp;&amp;0 &amp;&amp;&amp;&amp;&amp;&amp;1\\
&amp;\text{on} &amp;&amp;\,\text{on} &amp;&amp;&amp;\text{off} &amp;&amp;&amp;&amp;\,\text{on} &amp;&amp;&amp;&amp;&amp;\text{off}  &amp;&amp;&amp;&amp;&amp;&amp;\text{on}
\end{align*}</div>

<p>So the value of <span class="math">$110101$</span> in base-10 is:</p>
<div class="math">$$2^5+2^4+2^2+2^0=53$$</div>

<p>where we only sum the powers which were <span class="math">$\text{on}$</span>.</p>

<p>Now we are ready to give a formal definition to any binary number <span class="math">$k$</span>:</p>

<div class="math-def" id="def-binary">$k$ is a string of digits $\{b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0\}$ of length $i+1$ where $b \in \\{ 0,1 \\}$ whose value in base-10 is:

$$b_i 2^i + b_{i-1} 2^{i-1} + b_{i-2} 2^{i-2} + \ldots + b_2 2^2 + b_1 2^1 +b_0$$
</div>
<h1 id="but-are-we-sure-this-is-unique">But are we sure this is unique?</h1>
<p>That is, how can we be sure that every <span class="math">$k$</span> has exactly one and only one binary representation which no other <span class="math">$k$</span> has? We seek to prove this in the following section.</p>

<h2 id="proof-of-uniqueness">Proof of Uniqueness</h2>

<div class="math-def"> Lemma: Every natural number has a unique binary representation:
$$\{b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0\}$$
</div>

<p>We proceed by induction.</p>

<p>Our base case is <span class="math">$1$</span>, which can be expressed as <span class="math">$2^0$</span> in base-10 and also <span class="math">$1$</span> in binary.</p>

<p>This is a unique representation as <span class="math">$1$</span> is the smallest natural, positive number. Hence all other numbers are greater than 1, and hence have more bits ‘to the left’.</p>

<p>Now assume that the conjecture holds for all naturals <span class="math">$1,2,3,\ldots,b$</span>.
The number <span class="math">$b+1$</span> is our focus. One idea to show that the conjecture holds for <span class="math">$b+1$</span> is to argue that since it is either even or odd, it can be expressed as <span class="math">$2m$</span> or <span class="math">$2m+1$</span>, respectively, where <span class="math">$0&lt;m&lt;b&lt;b+1$</span>, and we would be done, as <span class="math">$m$</span> has a unique binary representation <span class="math">${b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0}$</span> and hence both:</p>

<div class="math">
\begin{align*}
m&amp;=b_i 2^i + b_{i-1} 2^{i-1} + b_{i-2} 2^{i-2} + \ldots + b_2 2^2 + b_1 2^1 +b_0\\
\implies 2m&amp;=2\left(b_i 2^i + b_{i-1} 2^{i-1} + b_{i-2} 2^{i-2} + \ldots + b_2 2^2 + b_1 2^1 +b_0\right)\\
&amp;=b_i 2^{i+1} + b_{i-1} 2^{i} + b_{i-2} 2^{i-1} + \ldots + b_2 2^3 + b_1 2^2 +b_0 2 +0\\
&amp;=\{b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0 \,\mathbf{0}\}\\
\implies 2m+1 &amp;= b_i 2^{i+1} + b_{i-1} 2^{i} + b_{i-2} 2^{i-1} + \ldots + b_2 2^3 + b_1 2^2 +b_0 2 +2^0\\
&amp;=\{b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0 \,\mathbf{1}\}
\end{align*}
</div>

<p>as needed.</p>

<p>However, this argument does not exactly address the uniqueness clause. The following argument resolves this.</p>

<p>Once again focusing on <span class="math">$b+1$</span>, consider the number <span class="math">$2^k$</span>, which is the largest power of two such that <span class="math">$2^k\leq b+1$</span>.</p>

<p>If <span class="math">$2^k=b+1$</span>, our work is done, as <span class="math">$2^k$</span> trivially has a binary representation which is unique as all powers of two less than <span class="math">$2^k$</span> sum up to exactly <span class="math">$2^{k}-1=b$</span>. This fact is demonstrated in <a class="link" href="#proof2">Proof of Binary Powers Sum</a>, or by induction <sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup>.</p>

<p>Otherwise, <span class="math">$2^k&lt;b+1$</span>, and <span class="math">$b+1-2^k&lt;2^k$</span> must be true, as the converse implies <span class="math">$b+1&gt;2^{k+1}$</span>, and we simply pick <span class="math">$k=k+1$</span>.</p>

<p>Now, <span class="math">$b+1-2^k&lt;2^k&lt;b+1$</span> indicates that <span class="math">$b+1-2^k$</span> can be expressed using binary according to our inductive hypothesis that all numbers <span class="math">$&lt;b+1$</span> have a binary representation. And <span class="math">$b+1-2^k+2^k=b+1$</span> yields back <span class="math">$b+1$</span>!</p>

<p>This means that we can simply add a <span class="math">$1$</span> to the binary representation of <span class="math">$b+1-2^k$</span> in the <span class="math">$k^{\text{th}}$</span> index and obtain <span class="math">$b+1$</span>, as needed. And this representation is also unique due to the fact we showed that it is less than <span class="math">$2^k$</span> coupled with <span class="math">$\sum_{i=0}^{k}2^i =2^{k+1}-1$</span>.</p>

<h3 id="proof-of-binary-powers-sum"><span id="proof2" class="anchor">Proof of Binary Powers Sum</span></h3>
<div class="math-def">
$$\sum_{i=0}^{k}2^i=1+2+4+\ldots+2^k =2^{k+1}-1 \quad \quad \forall k \in \mathbb{N}_0$$
</div>
<p>In my opinion, this proof demonstrates why binary is such a powerful tool. Let us proceed.</p>

<p>Begin by calling the LHS of this lemma <span class="math">$P(k)$</span>. Notice that by the <a href="#def-binary" class="link">definition of a binary number</a>, <span class="math">$P(k)$</span> has a binary representation that is exactly:</p>

<div class="math">$$\underbrace{1111\ldots1111}_{k+1\text{ times}}$$</div>

<p>as all terms are summed or ‘on’, this is a string of 1s which is of length <span class="math">$k+1$</span>.</p>

<p>Then, it is clear that <span class="math">$P(k)+1$</span> is simply:</p>

<div class="math">$$\mathbf{1}\,\underbrace{0000\ldots 0000}_{k+1\text{ times}}$$</div>

<p>due to the rules of <a href="https://en.wikipedia.org/wiki/Binary_number#Addition" target="_blank" class="link">binary addition</a>.</p>

<p>But notice how this can also be written as a binary number with a single 1 in the <span class="math">$k+1$</span> index. Which is exactly the definition of <span class="math">$2^{k+1}$</span>!</p>

<p>Hence, taking 1 away from <span class="math">$P(k)+1=2^{k+1}$</span> resets the <span class="math">$k+1$</span> index and leaves us with <span class="math">$P(k)$</span>, as needed.</p>
<h1 id="significance-of-binary">Significance of Binary</h1>
<p>Now that we’ve established why binary is such a powerful number system, we begin to understand its natural fit in digital circuitry: a complete numerical system built on two simple states—on or off. But how these states came to be mathematically expressed owes much to George Boole’s groundbreaking work on <a href="https://en.wikipedia.org/wiki/Boolean_algebra" target="_blank" class="link">Boolean Algebra</a>.</p>

<p><span class="alert">George Boole</span> described a new subject in algebra, using 2 main values— either true (1) or false (0)— to describe <em>logical</em>, and not numerical operations. Instead of the familiar addition, subtraction, multiplication, and division operations, Boolean Algebra is concerned with <span class="alert">conjunction</span>, <span class="alert">disjunction</span>, and <span class="alert">negation</span> of variables which can be true or false. A closer look of this algebra follows.</p>

<h2 id="on-boolean-algebra">On Boolean Algebra</h2>
<p>We begin by defining the two values in this algebra: <span class="math">$1$</span> represents true, <span class="math">$0$</span> represents false. Now, we can define the 3 operations using <span class="math">$\wedge, \vee,\neg$</span> for <span class="alert">conjunction</span>, <span class="alert">disjunction</span>, and <span class="alert">negation</span>, respectively:</p>

<div class="math-def">
\begin{align*}
x\wedge 0 &amp;= 0 \tag{Definitions of conjunction}\\ 
x\wedge 1 &amp;= x\\
x\vee 0 &amp;= x \tag{Definitions of disjunction}\\
x\vee 1 &amp;= 1\\
x \wedge \neg x &amp;=0 \tag{Definitions of negation}\\
x \vee \neg x &amp;=1\\
\neg (\neg x) &amp;=x \tag{Double negation}\\
x \wedge\hspace{-0.5em}\vee\, x &amp;= x\tag{Idempotence}\\
x \wedge\hspace{-0.5em}\vee\, y &amp;= y \wedge\hspace{-0.5em}\vee\, x \tag{Commutativity}\\
(x \wedge\hspace{-0.5em}\vee\, y) \wedge\hspace{-0.5em}\vee\, z &amp;= x \wedge\hspace{-0.5em}\vee\,  (y \wedge\hspace{-0.5em}\vee\, z)\tag{Associativity}\\
x \wedge\hspace{-0.5em}\vee\, (y\vee\hspace{-0.5em}\wedge\,z) &amp;= (x \wedge\hspace{-0.5em}\vee\, y) \vee\hspace{-0.5em}\wedge\, (x \wedge\hspace{-0.5em}\vee\, z) \tag{Distributivity}

\end{align*}
</div>

<p>Thus a new subject is axiomatized<sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">3</a></sup> and born, symbolizing logic (literally and metaphorically!)</p>

<p>However, as you may guess, this algebra was quite abstract and separate from the practical engineering world— beyond its use in philosophy and propositional calculus. This is, until <span class="alert">Claude Shannon</span> published his thesis <span style="font-style: italic;" class="alert">“A Symbolic Analysis of Relay and Switching Circuits,”</span> which recognized that Boolean Algebra could be used in electrical relays to perform both logical and numerical operations!</p>

<h2 id="claude-shannons-eureka-moment">Claude Shannon’s <em>eureka</em> moment</h2>
<p>Relays were electrical components which acted as switches— either preventing or allowing current flow. In his thesis, he mathematically proved that a physical system using such relays inherited all the power of a binary numerical and logical system— and could hence perform all of the same operations. Where they were previously used only for telegraphic communications, they could now be used to design precise circuitry.</p>

<p>Shannon noticed that the current flowing through relays could be modeled and standardized with Boolean algebra.</p>

<p>For example, he proposed wiring relays in a <span class="alert">series</span> arrangement in order to describe logical <span class="alert">conjunction</span>— if both relays were on or “high”, then current would be allowed to flow, and the output would also be “high”. However, if one was off, then current outside of the construction ceases to flow, perfectly matching the behavior of the boolean <span class="alert">AND</span>!</p>

<p>Similarly, <span class="alert">disjunction</span> would be formed by wiring the relays in parallel, yielding the exact same outcome as <span class="math">$\vee$</span> would!</p>

<div class="math">
<div class="tikz">
<img src="//i.upmath.me/svg/%5Cdefinecolor%7Bx%7D%7BHTML%7D%7Bf34040%7D%0A%5Ccolor%7Bx%7D%0A%5Cbegin%7Bcircuitikz%7D%0A%5Ctikzstyle%7Bevery%20node%7D%3D%5Bfont%3D%5Cnormalsize%5D%0A%0A%5Cdraw%20(13.25%2C-15.75)%20to%5Bshort%5D%20(13.5%2C-15.75)%3B%0A%5Cdraw%20(13.25%2C-16.25)%20to%5Bshort%5D%20(13.5%2C-16.25)%3B%0A%5Cdraw%20(13.5%2C-15.75)%20node%5Bieeestd%20and%20port%2C%20anchor%3Din%201%2C%20scale%3D0.89%5D(port)%7B%7D%20(port.out)%20to%5Bshort%5D%20(15.25%2C-16)%3B%0A%5Cdraw%20(13.25%2C-15.75)%20to%5Bshort%5D%20(12.5%2C-15.75)%3B%0A%5Cdraw%20(13.25%2C-16.25)%20to%5Bshort%5D%20(12.5%2C-16.25)%3B%0A%5Cdraw%20(15.25%2C-16)%20to%5Bshort%5D%20(16%2C-16)%3B%0A%5Cnode%20%5Bfont%3D%5Cnormalsize%5D%20at%20(12.75%2C-15.5)%20%7BA%7D%3B%0A%5Cnode%20%5Bfont%3D%5Cnormalsize%5D%20at%20(12.75%2C-16.5)%20%7BB%7D%3B%0A%5Cnode%20%5Bfont%3D%5Cnormalsize%5D%20at%20(15.5%2C-15.75)%20%7BA.B%7D%3B%0A%5Cdraw%20(13.25%2C-17.25)%20to%5Bshort%5D%20(13.5%2C-17.25)%3B%0A%5Cdraw%20(13.25%2C-17.75)%20to%5Bshort%5D%20(13.5%2C-17.75)%3B%0A%5Cdraw%20(13.5%2C-17.25)%20node%5Bieeestd%20or%20port%2C%20anchor%3Din%201%2C%20scale%3D0.89%5D(port)%7B%7D%20(port.out)%20to%5Bshort%5D%20(15.25%2C-17.5)%3B%0A%5Cdraw%20(13.25%2C-17.25)%20to%5Bshort%5D%20(12.5%2C-17.25)%3B%0A%5Cdraw%20(13.25%2C-17.75)%20to%5Bshort%5D%20(12.5%2C-17.75)%3B%0A%5Cdraw%20(15.25%2C-17.5)%20to%5Bshort%5D%20(16%2C-17.5)%3B%0A%5Cnode%20%5Bfont%3D%5Cnormalsize%5D%20at%20(12.75%2C-17)%20%7BA%7D%3B%0A%5Cnode%20%5Bfont%3D%5Cnormalsize%5D%20at%20(12.75%2C-18)%20%7BB%7D%3B%0A%5Cnode%20%5Bfont%3D%5Cnormalsize%5D%20at%20(15.5%2C-17.25)%20%7BA%2BB%7D%3B%0A%5Cdraw%20(13.5%2C-19)%20node%5Bieeestd%20not%20port%2C%20anchor%3Din%5D(port)%7B%7D%20(port.out)%20to%5Bshort%5D%20(15.25%2C-19)%3B%0A%5Cdraw%20(port.in)%20to%5Bshort%5D%20(13.25%2C-19)%3B%0A%5Cdraw%20(13.25%2C-19)%20to%5Bshort%5D%20(12.5%2C-19)%3B%0A%5Cdraw%20(15.25%2C-19)%20to%5Bshort%5D%20(16%2C-19)%3B%0A%5Cnode%20%5Bfont%3D%5Cnormalsize%5D%20at%20(12.75%2C-18.75)%20%7BA%7D%3B%0A%5Cnode%20%5Bfont%3D%5Cnormalsize%5D%20at%20(15.5%2C-18.75)%20%7B-A%7D%3B%0A%5Cend%7Bcircuitikz%7D" />
</div>
</div>
<p>Where <span class="math">$A.\hspace{-0.2em} B=A\wedge B$</span> and <span class="math">$A+B=A\vee B$</span>.</p>

<p>This gave birth to <span class="alert">logic gates</span>, fundamentally transforming the digital circuit industry. No longer was circuit design a matter of trial and error; it became a precise mathematical endeavor. Engineers could now create intricate electronics with predictable, reliable outcomes.</p>

<p>As the 20th century marched on, 8 <em>bits</em> became a <em>byte</em>, and relays gave way to vacuum tubes, then transistors, then integrated circuits. Yet, the logic underlying all this hardware remains the same: at the heart of modern computation are the simplest of ideas—$0$s and $1$s, off and on, false and true. From this division, we’ve built machines that not only calculate but connect us— even this text you read is a bunch of $0$s and $1$s. And that, in itself, is a remarkable testament to the power of binary.</p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>Turns out even counting in base 10 on our fingers is extremely inefficient. Binary allows us to count up to 1023 using our fingers! See  <a class="link" target="_blank" href="https://youtu.be/1SMmc9gQmHQ?si=344Xy21amWoTMDRO" style="color: rgb(126,16,16);">this video</a> <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>Left as an exercise to the reader. Or ask me about it! <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3">
      <p>See <span class="math" style="color:rgb(126, 16, 16);filter: brightness(50%);">$((a\mid b)\mid c)\mid (a\mid ((a\mid c)\mid a))=c$</span>, where <span class="math" style="color:rgb(126, 16, 16);filter: brightness(50%);">$x\mid y$</span> denotes<span class="math" style="color:rgb(126, 16, 16);filter: brightness(50%);">$\neg(x\wedge y)$</span> <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="math" /><summary type="html"><![CDATA[As someone who enjoys math and (more recently) CS, it is only appropriate that I open my blog with a concept related to the two. In this post, I intend to demonstrate how the binary system is the smallest such system which can be used to represent every single integer uniquely in one way, providing motivation for why binary is often called the “language of computers” (other than beep boop). The word binary comes from the latin word bini, which means “two together”. It hence makes sense that the binary number system has only two numerals, represented by $0$ and $1$. For comparison, the number system we are all used to—the base-10 system— has 10 different numerals which we can count on our fingers 1. This means numbers in binary only contain these two numerals, for example $110101$ is a binary number. But how does one count with this system? Counting in Binary Counting using the binary number system is quite simple. Like our base-10 system, the leftmost symbol has the highest value in binary, and as you proceed rightward, the values become smaller. In base-10, however, you only ‘increment the right’ after the left symbol has surpassed 9, resetting that symbol. This is contrasted to binary, where you only have 0s and 1s and ‘increment the right’ immediately if the left symbol is a 1, resetting it back to a zero. For example, in base-10, when counting, we proceed as: $$000, 001, 002, 003, 004, 005, 006, 007, 008, 009, \mathbf{010},\ldots, 019,\mathbf{020}, \ldots, 099, \mathbf{100}, \ldots $$ However, in base-2: $$000, 001, 010, 011, 100, 101, 110, 111, \ldots $$ But what does each symbol, called a bit, represent? You may correctly guess that it is something related to the digit 2— after all our entire counting system is based on 2 symbols. Its helpful to think of a binary number as a board of switches— either on ($1$) or off ($0$). So, the example we gave in the introduction is: $$110101= \text{on, on, off, on, off, on}$$ and in this system, what is on or off is a power of 2! That is; \begin{align*} &amp;2^5 &amp;&amp;2^4 &amp;&amp;&amp;\,2^3 &amp;&amp;&amp;&amp;\,2^2 &amp;&amp;&amp;&amp;&amp;2^1 &amp;&amp;&amp;&amp;&amp;&amp;2^0\\ &amp;1 &amp;&amp;1 &amp;&amp;&amp;0 &amp;&amp;&amp;&amp;1 &amp;&amp;&amp;&amp;&amp;0 &amp;&amp;&amp;&amp;&amp;&amp;1\\ &amp;\text{on} &amp;&amp;\,\text{on} &amp;&amp;&amp;\text{off} &amp;&amp;&amp;&amp;\,\text{on} &amp;&amp;&amp;&amp;&amp;\text{off} &amp;&amp;&amp;&amp;&amp;&amp;\text{on} \end{align*} So the value of $110101$ in base-10 is: $$2^5+2^4+2^2+2^0=53$$ where we only sum the powers which were $\text{on}$. Now we are ready to give a formal definition to any binary number $k$: $k$ is a string of digits $\{b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0\}$ of length $i+1$ where $b \in \\{ 0,1 \\}$ whose value in base-10 is: $$b_i 2^i + b_{i-1} 2^{i-1} + b_{i-2} 2^{i-2} + \ldots + b_2 2^2 + b_1 2^1 +b_0$$ But are we sure this is unique? That is, how can we be sure that every $k$ has exactly one and only one binary representation which no other $k$ has? We seek to prove this in the following section. Proof of Uniqueness Lemma: Every natural number has a unique binary representation: $$\{b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0\}$$ We proceed by induction. Our base case is $1$, which can be expressed as $2^0$ in base-10 and also $1$ in binary. This is a unique representation as $1$ is the smallest natural, positive number. Hence all other numbers are greater than 1, and hence have more bits ‘to the left’. Now assume that the conjecture holds for all naturals $1,2,3,\ldots,b$. The number $b+1$ is our focus. One idea to show that the conjecture holds for $b+1$ is to argue that since it is either even or odd, it can be expressed as $2m$ or $2m+1$, respectively, where $0&lt;m&lt;b&lt;b+1$, and we would be done, as $m$ has a unique binary representation ${b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0}$ and hence both: \begin{align*} m&amp;=b_i 2^i + b_{i-1} 2^{i-1} + b_{i-2} 2^{i-2} + \ldots + b_2 2^2 + b_1 2^1 +b_0\\ \implies 2m&amp;=2\left(b_i 2^i + b_{i-1} 2^{i-1} + b_{i-2} 2^{i-2} + \ldots + b_2 2^2 + b_1 2^1 +b_0\right)\\ &amp;=b_i 2^{i+1} + b_{i-1} 2^{i} + b_{i-2} 2^{i-1} + \ldots + b_2 2^3 + b_1 2^2 +b_0 2 +0\\ &amp;=\{b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0 \,\mathbf{0}\}\\ \implies 2m+1 &amp;= b_i 2^{i+1} + b_{i-1} 2^{i} + b_{i-2} 2^{i-1} + \ldots + b_2 2^3 + b_1 2^2 +b_0 2 +2^0\\ &amp;=\{b_i b_{i-1} b_{i-2}\ldots b_2 b_1 b_0 \,\mathbf{1}\} \end{align*} as needed. However, this argument does not exactly address the uniqueness clause. The following argument resolves this. Once again focusing on $b+1$, consider the number $2^k$, which is the largest power of two such that $2^k\leq b+1$. If $2^k=b+1$, our work is done, as $2^k$ trivially has a binary representation which is unique as all powers of two less than $2^k$ sum up to exactly $2^{k}-1=b$. This fact is demonstrated in Proof of Binary Powers Sum, or by induction 2. Otherwise, $2^k&lt;b+1$, and $b+1-2^k&lt;2^k$ must be true, as the converse implies $b+1&gt;2^{k+1}$, and we simply pick $k=k+1$. Now, $b+1-2^k&lt;2^k&lt;b+1$ indicates that $b+1-2^k$ can be expressed using binary according to our inductive hypothesis that all numbers $&lt;b+1$ have a binary representation. And $b+1-2^k+2^k=b+1$ yields back $b+1$! This means that we can simply add a $1$ to the binary representation of $b+1-2^k$ in the $k^{\text{th}}$ index and obtain $b+1$, as needed. And this representation is also unique due to the fact we showed that it is less than $2^k$ coupled with $\sum_{i=0}^{k}2^i =2^{k+1}-1$. Proof of Binary Powers Sum $$\sum_{i=0}^{k}2^i=1+2+4+\ldots+2^k =2^{k+1}-1 \quad \quad \forall k \in \mathbb{N}_0$$ In my opinion, this proof demonstrates why binary is such a powerful tool. Let us proceed. Begin by calling the LHS of this lemma $P(k)$. Notice that by the definition of a binary number, $P(k)$ has a binary representation that is exactly: $$\underbrace{1111\ldots1111}_{k+1\text{ times}}$$ as all terms are summed or ‘on’, this is a string of 1s which is of length $k+1$. Then, it is clear that $P(k)+1$ is simply: $$\mathbf{1}\,\underbrace{0000\ldots 0000}_{k+1\text{ times}}$$ due to the rules of binary addition. But notice how this can also be written as a binary number with a single 1 in the $k+1$ index. Which is exactly the definition of $2^{k+1}$! Hence, taking 1 away from $P(k)+1=2^{k+1}$ resets the $k+1$ index and leaves us with $P(k)$, as needed. Significance of Binary Now that we’ve established why binary is such a powerful number system, we begin to understand its natural fit in digital circuitry: a complete numerical system built on two simple states—on or off. But how these states came to be mathematically expressed owes much to George Boole’s groundbreaking work on Boolean Algebra. George Boole described a new subject in algebra, using 2 main values— either true (1) or false (0)— to describe logical, and not numerical operations. Instead of the familiar addition, subtraction, multiplication, and division operations, Boolean Algebra is concerned with conjunction, disjunction, and negation of variables which can be true or false. A closer look of this algebra follows. On Boolean Algebra We begin by defining the two values in this algebra: $1$ represents true, $0$ represents false. Now, we can define the 3 operations using $\wedge, \vee,\neg$ for conjunction, disjunction, and negation, respectively: \begin{align*} x\wedge 0 &amp;= 0 \tag{Definitions of conjunction}\\ x\wedge 1 &amp;= x\\ x\vee 0 &amp;= x \tag{Definitions of disjunction}\\ x\vee 1 &amp;= 1\\ x \wedge \neg x &amp;=0 \tag{Definitions of negation}\\ x \vee \neg x &amp;=1\\ \neg (\neg x) &amp;=x \tag{Double negation}\\ x \wedge\hspace{-0.5em}\vee\, x &amp;= x\tag{Idempotence}\\ x \wedge\hspace{-0.5em}\vee\, y &amp;= y \wedge\hspace{-0.5em}\vee\, x \tag{Commutativity}\\ (x \wedge\hspace{-0.5em}\vee\, y) \wedge\hspace{-0.5em}\vee\, z &amp;= x \wedge\hspace{-0.5em}\vee\, (y \wedge\hspace{-0.5em}\vee\, z)\tag{Associativity}\\ x \wedge\hspace{-0.5em}\vee\, (y\vee\hspace{-0.5em}\wedge\,z) &amp;= (x \wedge\hspace{-0.5em}\vee\, y) \vee\hspace{-0.5em}\wedge\, (x \wedge\hspace{-0.5em}\vee\, z) \tag{Distributivity} \end{align*} Thus a new subject is axiomatized3 and born, symbolizing logic (literally and metaphorically!) However, as you may guess, this algebra was quite abstract and separate from the practical engineering world— beyond its use in philosophy and propositional calculus. This is, until Claude Shannon published his thesis “A Symbolic Analysis of Relay and Switching Circuits,” which recognized that Boolean Algebra could be used in electrical relays to perform both logical and numerical operations! Claude Shannon’s eureka moment Relays were electrical components which acted as switches— either preventing or allowing current flow. In his thesis, he mathematically proved that a physical system using such relays inherited all the power of a binary numerical and logical system— and could hence perform all of the same operations. Where they were previously used only for telegraphic communications, they could now be used to design precise circuitry. Shannon noticed that the current flowing through relays could be modeled and standardized with Boolean algebra. For example, he proposed wiring relays in a series arrangement in order to describe logical conjunction— if both relays were on or “high”, then current would be allowed to flow, and the output would also be “high”. However, if one was off, then current outside of the construction ceases to flow, perfectly matching the behavior of the boolean AND! Similarly, disjunction would be formed by wiring the relays in parallel, yielding the exact same outcome as $\vee$ would! Where $A.\hspace{-0.2em} B=A\wedge B$ and $A+B=A\vee B$. This gave birth to logic gates, fundamentally transforming the digital circuit industry. No longer was circuit design a matter of trial and error; it became a precise mathematical endeavor. Engineers could now create intricate electronics with predictable, reliable outcomes. As the 20th century marched on, 8 bits became a byte, and relays gave way to vacuum tubes, then transistors, then integrated circuits. Yet, the logic underlying all this hardware remains the same: at the heart of modern computation are the simplest of ideas—$0$s and $1$s, off and on, false and true. From this division, we’ve built machines that not only calculate but connect us— even this text you read is a bunch of $0$s and $1$s. And that, in itself, is a remarkable testament to the power of binary. Turns out even counting in base 10 on our fingers is extremely inefficient. Binary allows us to count up to 1023 using our fingers! See this video &#8617; Left as an exercise to the reader. Or ask me about it! &#8617; See $((a\mid b)\mid c)\mid (a\mid ((a\mid c)\mid a))=c$, where $x\mid y$ denotes$\neg(x\wedge y)$ &#8617;]]></summary></entry><entry><title type="html">Logarithmic spirals and their self-symmetric nature</title><link href="/2024/12/01/log-spirals.html" rel="alternate" type="text/html" title="Logarithmic spirals and their self-symmetric nature" /><published>2024-12-01T00:00:00+03:00</published><updated>2026-06-27T00:46:50+03:00</updated><id>/2024/12/01/log-spirals</id><content type="html" xml:base="/2024/12/01/log-spirals.html"><![CDATA[<div class="disclaimer">
<img src="/assets/images/book.png" />
I came up with this content back in 2024, and made a school math project regarding this topic. However, I enjoyed making the project so I believe it would also serve as a nice, short blog post. Pre-requisites are understanding polar coordinates, basic calculus, trigonometry, and a bunch of algebra. Despite my best attempts at explaining how some of the more elementary ideas in this post contribute to the proofs, it is best if you are familiar with them. 
Enjoy the math ramblings of a high-schooler!
</div>

<p><em id="fl">L</em>ogarithmic spirals are a class of mathematical shapes described by a simple mathematical equation. Despite the elegance &amp; simplicity of how they are generated, they have some extremely interesting properties and characteristics which warrants a small case study on them. This blog post will look at some of those characteristics which most piqued my interest and present an attempt to prove their.</p>

<p>Namely, we will look at how logarithmic spirals are <span class="alert">congruent</span> under <span class="alert">rotation and scaling</span>, and hence <span class="alert">self-similar</span>, and the fact that their <span class="alert">pitch angles</span> are constant.</p>

<p>We begin by defining how a logarithmic<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup> spiral is constructed:</p>

<div class="math-def">
  <div class="math-def-title">
    <div id="math-title">Logarithmic Spiral definition</div>
  </div>
  <div class="math-content">A logarithmic spiral is a set of points in the polar plane where:
  <div class="math">$$r=e^{k\theta}$$</div>
  
    Where <span class="math">$r$</span> is the <span class="alert">radial distance</span>, or the distance from the origin, <span class="math">$e$</span> is Euler's number, <span class="math">$k$</span> is a transformation constant, and <span class="math">$\theta$</span> being the angle bounded by the pole.
</div>
</div>

<p>Analyzing this equation qualitatively, we see that this means that as <span class="math">$\theta\to\infty$</span>, the radius or distance from the origin, <span class="math">$r\to\infty$</span> too. But it does get hard to imagine exactly what this curve looks like, so let’s try plotting this on Desmos. <a href="https://www.desmos.com/calculator/u5ckq647qv" target="_blank" class="link">Click on me!</a></p>

<p><img src="/assets/images/desmos-graph.png" style="width: 100%; border-radius:10px;" /></p>

<p>Now that we can visualize what this curve looks like, we notice a few different things. First off, if you tried manipulating <span class="math">$k$</span>, you would’ve noticed that increasing its magnitude increases the amount by which the spiral “opens” up. When <span class="math">$k$</span> is near 0, the curve collapses near the origin and looks more and more like a circle.</p>

<p>This should motivate you to notice that <span class="math">$k$</span> doesn’t just determine how fast the spiral grows, but also how much it opens up with each turn.</p>

<p>And as it turns out, there is indeed a beautiful link between the constant <span class="math">$k$</span> and the “openness” of the curve— a concept mathematicians call the <span class="alert">pitch angle</span> of the spiral.</p>

<div class="math-def">
  <div class="math-def-title">
    <div id="math-title">Pitch Angles (not B...)</div>
  </div>
  <div class="math-content">A <span class="alert">pitch angle, </span><span class="math">$\alpha$</span>, of a spiral is the angle bounded between the intersection of some circle of radius <span class="math">$r$</span>, centered at the spiral's circle, and the the spiral at some point <span class="math">$P(x_p, y_p)$</span></div>

  <img src="/assets/images/pitch.png" class="img-math" />
</div>

<p>More rigorously, we can state that the pitch angle is the angle between the tangent to the circle at point <span class="math">$P$</span> and the tangent to the spiral at that same point.</p>

<p>Back at our <a href="https://www.desmos.com/calculator/u5ckq647qv" target="_blank" class="link">Desmos</a> graph, open up the first folder and follow the instructons. Now, manipulate <span class="math">$\theta_0$</span> and observe the two tangents drawn to the spiral and circle. Does the angle, <span class="math">$\alpha$</span>, change as you move along the spiral? Does it change for changing <span class="math">$k$</span>?<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup></p>

<p>As it turns out, the relationship between <span class="math">$k$</span> and <span class="math">$\alpha$</span> is quite elegant:</p>

<div class="math-def">
  <div class="math-def-title">
    <div id="math-title">Pitch Angles and k</div>
  </div>
  <div class="math-content">For any logarithmic spiral <span class="math">$r=e^{k\theta}$</span>, it follows that the pitch angle <span class="math">$\alpha$</span> is:
  <div class="math">$$\alpha=\arctan(k)$$</div>
  </div>
</div>

<p>This result is quite significant because it intuitively tells us that the “openness” of the curve depends only on the choice of <span class="math">$k$</span>, and nothing else. And this <span class="math">$\alpha$</span> does not change for any spiral— it’s constant!</p>

<h1 id="property-one-constant-pitch-angles">Property One: Constant Pitch Angles</h1>

<p><span style="font-style:italic; margin-right:15px;">Proof.</span> We begin by observing that the pitch angle may also be redefined in terms of tangent lines to each of the spiral and circle — that is, the angle between their tangents at some point in the polar plane <span class="math">$(r, \theta)$</span>. Denote each of these lines <span class="math">$L_s$</span> and <span class="math">$L_c$</span> for the spiral and circle respectively. Notice these lines can be written as (in cartesian coordinates): <sup id="fnref:8"><a href="#fn:8" class="footnote" rel="footnote" role="doc-noteref">3</a></sup></p>

<div class="math">
\begin{align*}
L_s &amp;= m_s (x - x_s) + y_s \\
L_c &amp;= m_c (c - x_c) + y_c
\end{align*}
</div>

<p>For slopes <span class="math">$m$</span> on points <span class="math">$(x_s , y_s), (x_c, y_c)$</span> on the spiral and circle. All that is essential is finding the slopes. We know, however, that:</p>

<div class="math">
\begin{align*}
x_s = x_c &amp;= r \cos(\theta) \Rightarrow \dv{x_s}{\theta} = r'\cos(\theta) - r\sin(\theta) \\
y_s = y_c &amp;= r \sin(\theta) \Rightarrow \dv{y_s}{\theta} = r'\sin(\theta) + r\cos(\theta)
\end{align*}
</div>
<p>Since they are tangent to the same point, the spiral and circle’s intersection. And also by the product rule of differentiation. <sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">4</a></sup></p>

<p>Where the derivatives are representations of how fast the <span class="math">$x$</span> and <span class="math">$y$</span> coordinates change with respect to changes in <span class="math">$\theta$</span>, respectively.</p>

<p>And from the chain rule <sup id="fnref:4"><a href="#fn:4" class="footnote" rel="footnote" role="doc-noteref">5</a></sup> , it follows that:</p>

<div class="math">
\begin{align*}
\dv{y}{x} = \frac{\dv{y_s}{\theta}}{\dv{x_s}{\theta}} = \frac{r'\sin(\theta) + r\cos(\theta)}{r'\cos(\theta) - r\sin(\theta)}
\end{align*}
</div>
<p>For any and all polar equations and curves.</p>

<p>For the spiral, we have <span class="math">$r = e^{k\theta}$</span>, so <span class="math">$r’ = ke^{k\theta}$</span>: <sup id="fnref:5"><a href="#fn:5" class="footnote" rel="footnote" role="doc-noteref">6</a></sup></p>

<div class="math">
\begin{align*}
m_s = \dv{y}{x} &amp;= \frac{ke^{k\theta}\sin(\theta) + e^{k\theta}\cos(\theta)}{ke^{k\theta}\cos(\theta) - e^{k\theta}\sin(\theta)} \\
&amp;= \frac{\cancel{\qty(e^{k\theta})}\qty(k\sin(\theta) + \cos(\theta))}{\cancel{\qty(e^{k\theta})}\qty(k\cos(\theta) - \sin(\theta))} \\ 
&amp;= \frac{k\sin(\theta) + \cos(\theta)}{k\cos(\theta) - \sin(\theta)} \tag{1} 
\end{align*}
</div>

<p>For the circle, <span class="math">$r = r_c$</span>, where <span class="math">$r_c$</span> is a constant radius of our liking. Hence, the derivative <span class="math">$r’ = 0$</span>:</p>

<div class="math">
\begin{align*}
m_c &amp;= \frac{\cancel{r'\sin(\theta)}+r\cos(\theta)}{\cancel{r'\cos(\theta)}-r\sin(\theta)}\\ 
&amp;=\frac{r\cos(\theta)}{-r\sin(\theta)}\\ 
&amp;= -\cot(\theta) \tag{2}
\end{align*}
</div>

<p>Now, recall we defined the pitch angle <span class="math">$\alpha$</span> as the angle between the tangents to the spiral and circle. Luckily, this angle depends only on the slopes of those tangents, which we have found in <span class="math">$(1)$</span> and <span class="math">$(2)$</span>. The <a href="https://byjus.com/maths/angle-between-two-lines/" target="_blank" class="link">formula</a> is as given:</p>

<div class="math">
\begin{align*}
\tan(\alpha) &amp;= \left| \frac{m_s - m_c}{1 + m_s m_c} \right| \\
&amp;= \left| \frac{\frac{k\sin(\theta) + \cos(\theta)}{k\cos(\theta) - \sin(\theta)} + \cot(\theta)}{1 - \cot(\theta) \cdot \frac{k\sin(\theta) + \cos(\theta)}{k\cos(\theta) - \sin(\theta)}} \right|
\end{align*}
</div>

<p>At this point, we take an important step which I think younger me described well:</p>

<div class="disclaimer">
Now, if you think this looks horrible to compute, it is. I spent over an hour trying to mess with this to get <span class="math">$k$</span>. It didn't work. I eventually thought of something that I hope will also teach <span class="alert">you</span> a lesson: When you have complicated expressions like these in math; split them up into components and reassign them into dummy variables. Divide and Conquer! In this case, I shall define <span class="math">$a = k\sin(\theta) + \cos(\theta)$</span> and <span class="math">$b = k\cos(\theta) - \sin(\theta)$</span> and plug them in:
</div>
<div class="math">
\begin{align*}
\tan(\alpha) &amp;= \left| \frac{\frac{a}{b}+\cot(\theta)}{1-\frac{a\cot(\theta)}{b}} \right|\\ 
&amp;=\left| \frac{\frac{a\cot(\theta)+b\cot^2(\theta)}{\cancel{b}\cot(\theta)}}{\frac{b-a\cot(\theta)}{\cancel{b}}} \right|\\
&amp;=\left| \frac{\cancel{\qty(\cot(\theta))}\qty(a+b\cot(\theta))}{\cancel{\qty(\cot(\theta))}} \right| \\
&amp;=\left| \frac{a+b\cot(\theta)}{b-a\cot(\theta)} \right|
\end{align*}

</div>

<p>Now substitute back <span class="math">\(a\)</span> and <span class="math">\(b\)</span>:</p>

<div class="math">
\begin{align*}
\tan(\alpha) &amp;= \left| \frac{k\sin(\theta) + \cos(\theta) + \cot(\theta)(k\cos(\theta) - \sin(\theta))}{k\cos(\theta) - \sin(\theta) - \cot(\theta)(k\sin(\theta) + \cos(\theta))} \right|
\end{align*}
</div>

<p>Using <span class="math">\(\cot(x)\sin(x) = \cos(x)\)</span>:</p>

<div class="math">
\begin{align*}
\tan(\alpha) &amp;= \left| \frac{k\sin(\theta) + \cancel{\cos(\theta)} + k\cot(\theta)\cos(\theta) - \cancel{\cos(\theta)}}{-\left(\sin(\theta) + \cot(\theta)\cos(\theta)\right)} \right| \\
&amp;= \left| \frac{k(\sin(\theta) + \cot(\theta)\cos(\theta))}{-(\sin(\theta) + \cot(\theta)\cos(\theta))} \right| \\
&amp;= \left|\frac{k\sin(\theta)+k\cot(\theta)\cos(\theta)}{-(\sin(\theta)+\cot(\theta)\cos(\theta))}\right|\\
&amp;=\left|\frac{k\cancel{(\sin(\theta)+\cot(\theta)\cos(\theta))}}{-\cancel{(\sin(\theta)+\cot(\theta)\cos(\theta))}}\right|\\
&amp;= |-k| = k
\end{align*}
</div>

<p>So finally, <span class="math">$\alpha = \arctan(k)$</span>, which was to be demonstrated!</p>

<p>And yet again, our result makes sense, remember our <a href="https://www.desmos.com/calculator/u5ckq647qv" target="_blank" class="link">Desmos</a> graph showed that the angle between the spiral and circle tangents remained constant everywhere.</p>

<h1 id="property-two-rotations-are-the-same-as-scaling">Property Two: Rotations are the same as Scaling</h1>

<p>Open up the second folder (pt. 2), and follow the instructions listed. Slide <span class="math">$d$</span>; what happens to the curve? Notice that it is being rotated, but what is intriguing is that this also looks exactly the same as zooming in or out on the curve. Try it out!</p>

<p>Another important property of these spirals is that rotating a spiral has the same effect as scaling (zooming in or out) it. Namely:</p>

<div class="math-def">
  <div class="math-def-title">
    <div id="math-title">Rotating <span class="math">$\iff$</span> Scaling</div>
  </div>
  <div class="math-content">
  <div class="math-def">
    <div class="math-def-title">
      <div id="math-title">Rotation</div>
    </div>
    <div class="math-content">A rotation of a polar curve <span class="math">$r(\theta)$</span> by  <span class="math">$d$</span> radians counter-clockwise is defined as <span class="math">$r(\theta-d)$</span>, clockwise for <span class="math">$d&lt;0$</span>
    </div>
  </div>
  <div class="math-def">
      <div class="math-def-title">
        <div id="math-title">Scaling</div>
      </div>
      <div class="math-content">A scaling of a polar curve <span class="math">$r(\theta)$</span> by <span class="math">$a$</span> units is defined as <span class="math">$ar(\theta)$</span> and can be thought of as zooming in or out by <span class="math">$a$</span> units.</div>
    </div>
  </div>
  <div style="margin-top:20px">
      A rotation of the logarithmic spiral <span class="math">$r(\theta)=e^{k\theta}$</span> by <span class="math">$d$</span> units <span class="math">$r(\theta-d)=e^{k(\theta-d)}$</span> is the same as scaling the spiral by some <span class="math">$a$</span> units. That is:
      <div class="math">\begin{align*}
      r(\theta)&amp;=e^{k\theta}\\
      r(\theta-d)&amp;\iff ar(\theta)
      \end{align*}
    </div>
  </div>
</div>

<p><span style="font-style:italic; margin-right:15px;">Proof.</span> Consider <span class="math">$r(\theta-d)$</span>.</p>

<div class="math">\begin{align*}
r(\theta-d)&amp;=e^{k(\theta-d)}\\
&amp;=e^{k\theta-kd}=e^{k\theta+(-kd)}\\
&amp;=e^{-kd}e^{k\theta}\\
&amp;=e^{-kd}r(\theta)
\end{align*}</div>

<p>Which was to be demonstrated, in our case <span class="math">$a=e^{-kd}$</span></p>

<p>Which also proves something called <span class="alert">self-similarity</span>.</p>

<h1 id="property-three-self-similarity">Property Three: <a href="https://en.wikipedia.org/wiki/Self-similarity#" target="_blank" class="link">Self-similarity</a></h1>

<p>Self-similarity occurs when a scaled shape is congruent to its original shape by rotation. That is, zooming in or out on it is the same as rotating the curve by some angle.</p>

<p>Luckily, we have just proven exactly that, so all logarithmic sprials are, by extension, self-similar!</p>

<p>For example, consider a logarithmic spiral <span class="math">$r(\theta)=e^{\theta/2}$</span> rotated <span class="math">$90^\circ=\frac \pi 2$</span>. We can show, because of the previous property:</p>

<div class="math">\begin{align*}
r\qty(\theta-\frac{\pi}{2})&amp;=e^{\qty(\theta-\frac{\pi}{2})/2}\\
&amp;=e^{-\pi/4}r(\theta)\\
&amp;\approx 0.456r(\theta)
\end{align*}</div>

<p>Hence, rotating it 90 degrees had the same effect as <span class="alert">zooming out</span> by 0.456 units.</p>

<p>And you can do this in the opposite direction— any scaling can be converted into a rotation.</p>

<h1 id="golden-spirals-and-varphi-special-logarithmic-spirals">Golden Spirals and <span class="math">$\varphi$</span>: Special Logarithmic Spirals!</h1>

<p><img src="/assets/images/golden-spiral.gif" style="width: 40%; border-radius:10px; float:left; margin-right:20px; margin-bottom:10px;" /></p>

<p>You’ve probably seen those viral posts on social media—gushing over the “divine” beauty of nature and the supposed presence of the golden ratio everywhere. Cue a zoomed-in image of a sunflower or a nautilus shell, complete with an overlaid golden spiral and a caption like “See? Math is the language of the universe!” I find these posts pretty pretentious: they do nothing to attempt explaining the math, and attribute any spiral looking shape to the golden spiral, which is just wrong.</p>

<p>The golden spiral, depicted on the left, is indeed a type of logarithmic spiral with a unique <span class="math">$k$</span>, however often times in nature, spirals are not golden! That is, their <span class="math">$k$</span> is not the same as the “golden” <span class="math">$k$</span>.</p>

<p>These posts have glamorized the golden ratio without giving any credit to the way these shapes are even generated— through logarithmic spirals. The rest of this blog will be dedicated to finding a polar form of the golden spiral— in the logarithmic spiral form we defined previously.</p>

<div class="math-def" style="clear: both;">
  <div class="math-def-title">
    <div id="math-title">The Golden Spiral</div>
  </div>
  <div class="math-content">The Golden Spiral is the logarithmic curve defined as having growth factor of the golden ratio, <span class="math">$\varphi=\frac{1+\sqrt{5}}{2}$</span>. That is, the golden spiral grows (by multiplication!) <span class="math">$\varphi$</span> units with every <span class="math">$90^\circ$</span> turn of the spiral.</div>
</div>

<p>Mathematically, we can denote this as The Golden Spiral being <span class="math">$r(\theta)=e^{k\theta}$</span> such that:</p>

<div class="math">\begin{align*}
r(\theta)&amp;=e^{k\theta}\\
r\qty(\theta+\frac \pi 2 )&amp;=\varphi r(\theta)
\end{align*}</div>

<p>And we need to find <span class="math">$k$</span>:</p>

<div class="math">\begin{align*}
r(\theta)&amp;=e^{k\theta}\\
r\qty(\theta+\frac \pi 2 )&amp;=\varphi e^{k\theta}\\ 
\frac{r\qty(\theta+\frac \pi 2 )}{\varphi}&amp;=e^{k\theta}\\
\ln(\frac{r\qty(\theta+\frac \pi 2 )}{\varphi})/\theta&amp;=k\\
\ln(\frac{e^{k\qty(\theta+\frac \pi 2)}}{\varphi})/\theta&amp;=k\\
k\qty(\theta+\frac \pi 2)-\ln(\varphi)&amp;=k\theta\\
k\qty(\cancel{\theta}+\frac \pi 2 -\cancel{\theta})&amp;=\ln(\varphi)\\
k&amp;=\frac{2\ln(\varphi)}{\pi}
\end{align*}</div>

<p>This is great! Now we know <span class="math">$k\approx 0.306$</span>, which means that the golden spiral has: <sup id="fnref:6"><a href="#fn:6" class="footnote" rel="footnote" role="doc-noteref">7</a></sup></p>

<div class="math">$$\alpha=\arctan(k)\approx 0.297\text{ rad}\approx 17^\circ$$ </div>

<p>And plugging this back into <span class="math">$r(\theta)$</span>:</p>

<div class="math">\begin{align*}
r(\theta)&amp;=e^{2\theta\ln(\varphi)/\pi}\\
&amp;=\varphi^{2\theta/\pi}
\end{align*}</div>

<p>And that brings it to an end! In the very last folder (pt. 3) on <a href="https://www.desmos.com/calculator/u5ckq647qv" target="_blank" class="link">Desmos</a>, you should see the Golden Spiral’s equation. Go ahead and plot it!</p>

<p>Hopefully this blog post has inspired a newfound love in you for logarithmic spirals— the true actors behind all of those “Nature is Magnificent!” posts you see on social media. And more importantly, I hope you learnt something new.</p>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>This definition may not provide much insight into why these spirals are named as such, but with a bit or rearranging, we see that logarithms are indeed involved in these spirals; namely when we solve for <span class="math">$\theta$</span>:</p>

      <div class="math">$$r=e^{k\theta}\implies \ln(r)=k\theta\implies \theta=\frac{\ln(r)}{k}$$</div>

      <p>Regardless, I believe calling these spirals <span class="alert">exponential or growth</span> spirals is more suiting than the unintuitive logarithmic spiral, but I digress. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>The answers to those questions are no, and yes, respectively. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8">
      <p>I suspect another way to do this would be to convert the lines into polar form, this way the use of chain rule is eliminated and we could do some analysis on the direct derivatives instead. Left as an exercise to you! <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3">
      <div class="math">$$\dv{x}\qty[f(x)g(x)]=f'(x)g(x)+f(x)g'(x)$$</div>
      <p><a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4">
      <div class="math">$$\dv{x}\qty[f(g(x))=f'(g(x))g'(x)]$$</div>
      <p><a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5">
      <div class="math">$$\dv{x}\qty[e^x]=e^x$$</div>
      <p><a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6">
      <p>which, if you pull out your protractor and ruler and measure on most of those viral nature posts, should be approximately true. <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="math" /><summary type="html"><![CDATA[I came up with this content back in 2024, and made a school math project regarding this topic. However, I enjoyed making the project so I believe it would also serve as a nice, short blog post. Pre-requisites are understanding polar coordinates, basic calculus, trigonometry, and a bunch of algebra. Despite my best attempts at explaining how some of the more elementary ideas in this post contribute to the proofs, it is best if you are familiar with them. Enjoy the math ramblings of a high-schooler! Logarithmic spirals are a class of mathematical shapes described by a simple mathematical equation. Despite the elegance &amp; simplicity of how they are generated, they have some extremely interesting properties and characteristics which warrants a small case study on them. This blog post will look at some of those characteristics which most piqued my interest and present an attempt to prove their. Namely, we will look at how logarithmic spirals are congruent under rotation and scaling, and hence self-similar, and the fact that their pitch angles are constant. We begin by defining how a logarithmic1 spiral is constructed: Logarithmic Spiral definition A logarithmic spiral is a set of points in the polar plane where: $$r=e^{k\theta}$$ Where $r$ is the radial distance, or the distance from the origin, $e$ is Euler's number, $k$ is a transformation constant, and $\theta$ being the angle bounded by the pole. Analyzing this equation qualitatively, we see that this means that as $\theta\to\infty$, the radius or distance from the origin, $r\to\infty$ too. But it does get hard to imagine exactly what this curve looks like, so let’s try plotting this on Desmos. Click on me! Now that we can visualize what this curve looks like, we notice a few different things. First off, if you tried manipulating $k$, you would’ve noticed that increasing its magnitude increases the amount by which the spiral “opens” up. When $k$ is near 0, the curve collapses near the origin and looks more and more like a circle. This should motivate you to notice that $k$ doesn’t just determine how fast the spiral grows, but also how much it opens up with each turn. And as it turns out, there is indeed a beautiful link between the constant $k$ and the “openness” of the curve— a concept mathematicians call the pitch angle of the spiral. Pitch Angles (not B...) A pitch angle, $\alpha$, of a spiral is the angle bounded between the intersection of some circle of radius $r$, centered at the spiral's circle, and the the spiral at some point $P(x_p, y_p)$ More rigorously, we can state that the pitch angle is the angle between the tangent to the circle at point $P$ and the tangent to the spiral at that same point. Back at our Desmos graph, open up the first folder and follow the instructons. Now, manipulate $\theta_0$ and observe the two tangents drawn to the spiral and circle. Does the angle, $\alpha$, change as you move along the spiral? Does it change for changing $k$?2 As it turns out, the relationship between $k$ and $\alpha$ is quite elegant: Pitch Angles and k For any logarithmic spiral $r=e^{k\theta}$, it follows that the pitch angle $\alpha$ is: $$\alpha=\arctan(k)$$ This result is quite significant because it intuitively tells us that the “openness” of the curve depends only on the choice of $k$, and nothing else. And this $\alpha$ does not change for any spiral— it’s constant! Property One: Constant Pitch Angles Proof. We begin by observing that the pitch angle may also be redefined in terms of tangent lines to each of the spiral and circle — that is, the angle between their tangents at some point in the polar plane $(r, \theta)$. Denote each of these lines $L_s$ and $L_c$ for the spiral and circle respectively. Notice these lines can be written as (in cartesian coordinates): 3 \begin{align*} L_s &amp;= m_s (x - x_s) + y_s \\ L_c &amp;= m_c (c - x_c) + y_c \end{align*} For slopes $m$ on points $(x_s , y_s), (x_c, y_c)$ on the spiral and circle. All that is essential is finding the slopes. We know, however, that: \begin{align*} x_s = x_c &amp;= r \cos(\theta) \Rightarrow \dv{x_s}{\theta} = r'\cos(\theta) - r\sin(\theta) \\ y_s = y_c &amp;= r \sin(\theta) \Rightarrow \dv{y_s}{\theta} = r'\sin(\theta) + r\cos(\theta) \end{align*} Since they are tangent to the same point, the spiral and circle’s intersection. And also by the product rule of differentiation. 4 Where the derivatives are representations of how fast the $x$ and $y$ coordinates change with respect to changes in $\theta$, respectively. And from the chain rule 5 , it follows that: \begin{align*} \dv{y}{x} = \frac{\dv{y_s}{\theta}}{\dv{x_s}{\theta}} = \frac{r'\sin(\theta) + r\cos(\theta)}{r'\cos(\theta) - r\sin(\theta)} \end{align*} For any and all polar equations and curves. For the spiral, we have $r = e^{k\theta}$, so $r’ = ke^{k\theta}$: 6 \begin{align*} m_s = \dv{y}{x} &amp;= \frac{ke^{k\theta}\sin(\theta) + e^{k\theta}\cos(\theta)}{ke^{k\theta}\cos(\theta) - e^{k\theta}\sin(\theta)} \\ &amp;= \frac{\cancel{\qty(e^{k\theta})}\qty(k\sin(\theta) + \cos(\theta))}{\cancel{\qty(e^{k\theta})}\qty(k\cos(\theta) - \sin(\theta))} \\ &amp;= \frac{k\sin(\theta) + \cos(\theta)}{k\cos(\theta) - \sin(\theta)} \tag{1} \end{align*} For the circle, $r = r_c$, where $r_c$ is a constant radius of our liking. Hence, the derivative $r’ = 0$: \begin{align*} m_c &amp;= \frac{\cancel{r'\sin(\theta)}+r\cos(\theta)}{\cancel{r'\cos(\theta)}-r\sin(\theta)}\\ &amp;=\frac{r\cos(\theta)}{-r\sin(\theta)}\\ &amp;= -\cot(\theta) \tag{2} \end{align*} Now, recall we defined the pitch angle $\alpha$ as the angle between the tangents to the spiral and circle. Luckily, this angle depends only on the slopes of those tangents, which we have found in $(1)$ and $(2)$. The formula is as given: \begin{align*} \tan(\alpha) &amp;= \left| \frac{m_s - m_c}{1 + m_s m_c} \right| \\ &amp;= \left| \frac{\frac{k\sin(\theta) + \cos(\theta)}{k\cos(\theta) - \sin(\theta)} + \cot(\theta)}{1 - \cot(\theta) \cdot \frac{k\sin(\theta) + \cos(\theta)}{k\cos(\theta) - \sin(\theta)}} \right| \end{align*} At this point, we take an important step which I think younger me described well: Now, if you think this looks horrible to compute, it is. I spent over an hour trying to mess with this to get $k$. It didn't work. I eventually thought of something that I hope will also teach you a lesson: When you have complicated expressions like these in math; split them up into components and reassign them into dummy variables. Divide and Conquer! In this case, I shall define $a = k\sin(\theta) + \cos(\theta)$ and $b = k\cos(\theta) - \sin(\theta)$ and plug them in: \begin{align*} \tan(\alpha) &amp;= \left| \frac{\frac{a}{b}+\cot(\theta)}{1-\frac{a\cot(\theta)}{b}} \right|\\ &amp;=\left| \frac{\frac{a\cot(\theta)+b\cot^2(\theta)}{\cancel{b}\cot(\theta)}}{\frac{b-a\cot(\theta)}{\cancel{b}}} \right|\\ &amp;=\left| \frac{\cancel{\qty(\cot(\theta))}\qty(a+b\cot(\theta))}{\cancel{\qty(\cot(\theta))}} \right| \\ &amp;=\left| \frac{a+b\cot(\theta)}{b-a\cot(\theta)} \right| \end{align*} Now substitute back \(a\) and \(b\): \begin{align*} \tan(\alpha) &amp;= \left| \frac{k\sin(\theta) + \cos(\theta) + \cot(\theta)(k\cos(\theta) - \sin(\theta))}{k\cos(\theta) - \sin(\theta) - \cot(\theta)(k\sin(\theta) + \cos(\theta))} \right| \end{align*} Using \(\cot(x)\sin(x) = \cos(x)\): \begin{align*} \tan(\alpha) &amp;= \left| \frac{k\sin(\theta) + \cancel{\cos(\theta)} + k\cot(\theta)\cos(\theta) - \cancel{\cos(\theta)}}{-\left(\sin(\theta) + \cot(\theta)\cos(\theta)\right)} \right| \\ &amp;= \left| \frac{k(\sin(\theta) + \cot(\theta)\cos(\theta))}{-(\sin(\theta) + \cot(\theta)\cos(\theta))} \right| \\ &amp;= \left|\frac{k\sin(\theta)+k\cot(\theta)\cos(\theta)}{-(\sin(\theta)+\cot(\theta)\cos(\theta))}\right|\\ &amp;=\left|\frac{k\cancel{(\sin(\theta)+\cot(\theta)\cos(\theta))}}{-\cancel{(\sin(\theta)+\cot(\theta)\cos(\theta))}}\right|\\ &amp;= |-k| = k \end{align*} So finally, $\alpha = \arctan(k)$, which was to be demonstrated! And yet again, our result makes sense, remember our Desmos graph showed that the angle between the spiral and circle tangents remained constant everywhere. Property Two: Rotations are the same as Scaling Open up the second folder (pt. 2), and follow the instructions listed. Slide $d$; what happens to the curve? Notice that it is being rotated, but what is intriguing is that this also looks exactly the same as zooming in or out on the curve. Try it out! Another important property of these spirals is that rotating a spiral has the same effect as scaling (zooming in or out) it. Namely: Rotating $\iff$ Scaling Rotation A rotation of a polar curve $r(\theta)$ by $d$ radians counter-clockwise is defined as $r(\theta-d)$, clockwise for $d&lt;0$ Scaling A scaling of a polar curve $r(\theta)$ by $a$ units is defined as $ar(\theta)$ and can be thought of as zooming in or out by $a$ units. A rotation of the logarithmic spiral $r(\theta)=e^{k\theta}$ by $d$ units $r(\theta-d)=e^{k(\theta-d)}$ is the same as scaling the spiral by some $a$ units. That is: \begin{align*} r(\theta)&amp;=e^{k\theta}\\ r(\theta-d)&amp;\iff ar(\theta) \end{align*} Proof. Consider $r(\theta-d)$. \begin{align*} r(\theta-d)&amp;=e^{k(\theta-d)}\\ &amp;=e^{k\theta-kd}=e^{k\theta+(-kd)}\\ &amp;=e^{-kd}e^{k\theta}\\ &amp;=e^{-kd}r(\theta) \end{align*} Which was to be demonstrated, in our case $a=e^{-kd}$ Which also proves something called self-similarity. Property Three: Self-similarity Self-similarity occurs when a scaled shape is congruent to its original shape by rotation. That is, zooming in or out on it is the same as rotating the curve by some angle. Luckily, we have just proven exactly that, so all logarithmic sprials are, by extension, self-similar! For example, consider a logarithmic spiral $r(\theta)=e^{\theta/2}$ rotated $90^\circ=\frac \pi 2$. We can show, because of the previous property: \begin{align*} r\qty(\theta-\frac{\pi}{2})&amp;=e^{\qty(\theta-\frac{\pi}{2})/2}\\ &amp;=e^{-\pi/4}r(\theta)\\ &amp;\approx 0.456r(\theta) \end{align*} Hence, rotating it 90 degrees had the same effect as zooming out by 0.456 units. And you can do this in the opposite direction— any scaling can be converted into a rotation. Golden Spirals and $\varphi$: Special Logarithmic Spirals! You’ve probably seen those viral posts on social media—gushing over the “divine” beauty of nature and the supposed presence of the golden ratio everywhere. Cue a zoomed-in image of a sunflower or a nautilus shell, complete with an overlaid golden spiral and a caption like “See? Math is the language of the universe!” I find these posts pretty pretentious: they do nothing to attempt explaining the math, and attribute any spiral looking shape to the golden spiral, which is just wrong. The golden spiral, depicted on the left, is indeed a type of logarithmic spiral with a unique $k$, however often times in nature, spirals are not golden! That is, their $k$ is not the same as the “golden” $k$. These posts have glamorized the golden ratio without giving any credit to the way these shapes are even generated— through logarithmic spirals. The rest of this blog will be dedicated to finding a polar form of the golden spiral— in the logarithmic spiral form we defined previously. The Golden Spiral The Golden Spiral is the logarithmic curve defined as having growth factor of the golden ratio, $\varphi=\frac{1+\sqrt{5}}{2}$. That is, the golden spiral grows (by multiplication!) $\varphi$ units with every $90^\circ$ turn of the spiral. Mathematically, we can denote this as The Golden Spiral being $r(\theta)=e^{k\theta}$ such that: \begin{align*} r(\theta)&amp;=e^{k\theta}\\ r\qty(\theta+\frac \pi 2 )&amp;=\varphi r(\theta) \end{align*} And we need to find $k$: \begin{align*} r(\theta)&amp;=e^{k\theta}\\ r\qty(\theta+\frac \pi 2 )&amp;=\varphi e^{k\theta}\\ \frac{r\qty(\theta+\frac \pi 2 )}{\varphi}&amp;=e^{k\theta}\\ \ln(\frac{r\qty(\theta+\frac \pi 2 )}{\varphi})/\theta&amp;=k\\ \ln(\frac{e^{k\qty(\theta+\frac \pi 2)}}{\varphi})/\theta&amp;=k\\ k\qty(\theta+\frac \pi 2)-\ln(\varphi)&amp;=k\theta\\ k\qty(\cancel{\theta}+\frac \pi 2 -\cancel{\theta})&amp;=\ln(\varphi)\\ k&amp;=\frac{2\ln(\varphi)}{\pi} \end{align*} This is great! Now we know $k\approx 0.306$, which means that the golden spiral has: 7 $$\alpha=\arctan(k)\approx 0.297\text{ rad}\approx 17^\circ$$ And plugging this back into $r(\theta)$: \begin{align*} r(\theta)&amp;=e^{2\theta\ln(\varphi)/\pi}\\ &amp;=\varphi^{2\theta/\pi} \end{align*} And that brings it to an end! In the very last folder (pt. 3) on Desmos, you should see the Golden Spiral’s equation. Go ahead and plot it! Hopefully this blog post has inspired a newfound love in you for logarithmic spirals— the true actors behind all of those “Nature is Magnificent!” posts you see on social media. And more importantly, I hope you learnt something new. This definition may not provide much insight into why these spirals are named as such, but with a bit or rearranging, we see that logarithms are indeed involved in these spirals; namely when we solve for $\theta$: $$r=e^{k\theta}\implies \ln(r)=k\theta\implies \theta=\frac{\ln(r)}{k}$$ Regardless, I believe calling these spirals exponential or growth spirals is more suiting than the unintuitive logarithmic spiral, but I digress. &#8617; The answers to those questions are no, and yes, respectively. &#8617; I suspect another way to do this would be to convert the lines into polar form, this way the use of chain rule is eliminated and we could do some analysis on the direct derivatives instead. Left as an exercise to you! &#8617; $$\dv{x}\qty[f(x)g(x)]=f'(x)g(x)+f(x)g'(x)$$ &#8617; $$\dv{x}\qty[f(g(x))=f'(g(x))g'(x)]$$ &#8617; $$\dv{x}\qty[e^x]=e^x$$ &#8617; which, if you pull out your protractor and ruler and measure on most of those viral nature posts, should be approximately true. &#8617;]]></summary></entry></feed>