<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Greg Herlihy on Medium]]></title>
        <description><![CDATA[Stories by Greg Herlihy on Medium]]></description>
        <link>https://medium.com/@greg.herlihy?source=rss-4e4012a7720a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*od0pq1IrqZGF1axqhnR7uQ@2x.jpeg</url>
            <title>Stories by Greg Herlihy on Medium</title>
            <link>https://medium.com/@greg.herlihy?source=rss-4e4012a7720a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:05:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@greg.herlihy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Picnicking with Dinosaurs: an Exploration of Deep Time]]></title>
            <link>https://medium.com/@greg.herlihy/picnicking-with-dinosaurs-an-exploration-of-deep-time-fbeb28720626?source=rss-4e4012a7720a------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbeb28720626</guid>
            <category><![CDATA[deep-time]]></category>
            <category><![CDATA[natural-history]]></category>
            <category><![CDATA[geology]]></category>
            <category><![CDATA[evolution]]></category>
            <category><![CDATA[popular-science]]></category>
            <dc:creator><![CDATA[Greg Herlihy]]></dc:creator>
            <pubDate>Fri, 06 Jun 2025 17:02:09 GMT</pubDate>
            <atom:updated>2025-06-07T02:57:19.160Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*3CTDy-S39z8EBpByVEN-Pg.jpeg" /><figcaption>Author and Friends (artist’s conception)</figcaption></figure><p>Imagine someone gifted you (on your most recent birthday) a Time Machine — which you have promised to use responsibly, ethically and in an environmentally-friendly manner). This Time Machine is the latest and fastest model on the market, it can zip you forwards or backwards in time at the impressive clip of one-year-per-second (1 YPS). So, for every second you spend in the machine, an entire year elapses (or “unelapses”) meaning you can travel 60 years in a minute, a century in about a minute and a half, or a millennium in about 16 minutes.</p><p>You decide to use this machine to fulfill your lifelong dream of picnicking (and otherwise bonding with) a few of your favorite dinosaur species. You can already envision yourself dining <em>al fresco</em> in an unspoiled, Eden-like Earth, while you casually toss some of your food to a clutch of friendly velociraptors and juvenile t-rexes crowded about you. The dinosaurs even let you pet them — so grateful they are for your kind treats.</p><p>You are motivated even further once you realize how videos of this picnic will turbo-charge your TikTok channel, bringing it to the “next level.” So, full of excitement, you pack a picnic basket, a toothbrush, a pillow and blanket (in case this excursion turns into an overnight trip), hop in your Time Machine, point it toward the past, and floor it. The machine immediately starts whirring, and the years start rolling back in rapid succession… 2024… 2020… 2010… one year per second.</p><p>Just <strong>one minute</strong> into your voyage you find yourself in the turbulent 1960s, during the height of the Vietnam War, the space race, the civil rights movement, the great society, and the cold war. Most people alive today have yet to be born, and most people alive then are no longer alive today.</p><p>At the <strong>two minute </strong>mark<strong> </strong>you are back at the start of the 20th century, the dawn of aviation age and the automobile age. No one one alive then, is still alive today.</p><p>After <strong>four minute</strong>s you arrive in the 1770s, just in time for the American and French Revolutions.</p><p>At almost <strong>nine minutes</strong> into your trip, you are back at the age of Discovery, of Christopher Columbus and the European encounter with the Americas.</p><p>At <strong>25 minutes</strong> you have passed through the entire Middle Ages and have reached the late Roman Empire.</p><p>At about <strong>one hour 15 minutes</strong> you are witnessing the construction of the Great pyramids at Giza, meaning the pyramids were older to the Roman Empire than the Roman Empire is old to us.</p><p>After <strong>three hours and 30 minutes</strong> in your time machine you arrive at the dawn of human civilization in Mesopotamia.</p><p>You realize that you can turn a visit to any point in time throughout all of recorded human history — into a day trip. The blanket and pillow you brought now look a little unnecessary. But you press on, into prehistoric times.</p><p>Around <strong>five hours and 30 minutes</strong> into your trip you find yourself at the time of the Lascaux cave paintings in France. At this point, your trip to see the dinosaurs seems to be taking a little longer than you expected. After <strong>a full day</strong>, 86,400 years have been unwound. You have witnessed several ice ages, seen humans become better toolmakers, and invent language and art. You have also seen several other species of humanity, including Neanderthals and Denisovans roam the earth. But still, no sign of the dinosaurs you want to make friends with.</p><p>After <strong>four and half days</strong> of travel you reach the time our earliest ancestors of our species, <em>Homo sapiens </em>lived. At this point, things outside your Time Machine window seem to be changing relatively slowly, even a little boring to watch, and quite unlike the thrill of seeing all the rapid changes you witnessed in the first few hours of your trip. Nevertheless, you remain committed to your mission. You continue to zip along in your Time Machine, one year-per-second. You start to wonder: just how long will it take to reach the Cretaceous, 66 million years ago?</p><p>It turns out that you will need to spend about <strong>two years and one month</strong>, traveling nonstop, to traverse all the intervening years between today and the Chicxulub asteroid impact that ended the Cretaceous age. In other words, even though you passed though all of human civilization in matter of <em>hours</em>, reaching the age of the dinosaurs, will be a matter of <em>years</em>.</p><p>Shocked by this realization (along with the fact that your benefactor didn’t spring for a Time Machine with either sleeping quarters or a toilet, and not to mention the fact that you have at this point, already consumed the entire picnic you brought with you) — in short, faced with the reality of a plan that is looking ever more shambolic — or less charitably, increasingly “half-assed” — by the moment, you have only one course of action left to you: abandon your quest. So, barely able to hold back tears, you bring the Time Machine to a halt, turn it around, and start the return trip back to the present day. Picnicking with the dinosaurs has become a <em>dream deferred</em>.</p><p>The time needed to reach other milestones in earth history are even more daunting. Once you reached the dinosaurs, it would take you an additional five years, or a total of <strong>seven years</strong> of time travel from the present day to see the very first dinosaurs. And if you want to see the origins of life on Earth? Unfortunately, you would need <strong>125 years</strong> of travel, which is likely beyond your lifespan.</p><p>Although disappointed, you at least have acquired, from this experience, a better appreciation of the difference between measurements of time on a human scale and <em>deep</em> <em>time</em>, that is, measurements of time on a geological or an evolutionary scale. As humans, our experience and perception of time is bounded by our lifespan: tomorrow, next week, next year, the most anyone has ever remembered is not much over a hundred years. But this scale of time is positively dwarfed by the lifespan of Earth, much less the lifespan of the Universe.</p><p>At this point, it is customary to note how humbling we, as humans, should feel. We should feel small, because our lifespan seems so insignificantly short in comparison to the Age of the Earth. But that lesson seems a little too trite. And as Niels Bohr observed: <em>the opposite of great truth is often, another great truth</em>. So we should actually feel proud — proud that our knowledge of cosmic history extends far beyond the insignificant amount of time that human civilization has existed on Earth. In other words, our knowledge and understanding greatly exceeds our direct experience. And that is a remarkable fact.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbeb28720626" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is this the World’s Most Divisive Brain Teaser? (hint: no, it is not the one you think)]]></title>
            <link>https://medium.com/@greg.herlihy/is-this-the-worlds-most-divisive-brain-teaser-2dfaeaaa6871?source=rss-4e4012a7720a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2dfaeaaa6871</guid>
            <category><![CDATA[puzzle]]></category>
            <category><![CDATA[logic-puzzles]]></category>
            <category><![CDATA[probability]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[brain-teaser]]></category>
            <dc:creator><![CDATA[Greg Herlihy]]></dc:creator>
            <pubDate>Thu, 22 May 2025 02:11:50 GMT</pubDate>
            <atom:updated>2025-05-24T23:08:35.590Z</atom:updated>
            <content:encoded><![CDATA[<p>Is this the World’s Most Divisive Brain Teaser? (hint: no, it is not the one you think)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O0yVXOi28Jv58FpyMFMBfA.png" /></figure><p>Is your answer <strong>50%</strong> or <strong>66.6% </strong>that the boy’s sibling is a girl? Whose team will you be joining?</p><p>When it comes to divisive brain teasers, the Monty Hall <a href="https://en.wikipedia.org/wiki/Monty_Hall_problem">Problem</a> is likely the most famous — famous for dividing people into two factions: those who believe that changing their choice will make no difference, and those who understand that it will. With Monty Hall, the division is not symmetrical, because only one side has the math to support them — the other side has only their intuition to rely on. So, inevitably, many who started on Team Intuition, will “see the light” and defect to Team Math. Nobody moves in the other direction.</p><p>This gender probability question divides people into two camps as well. with 50% and 66% being the two solutions that divide the two factions. With this problem, the gap betwen the two factions is a chasm. Few who believe in one of solutions, ever change their minds. The fact that each side is so entrenched — is what makes this brain teaser a good candidate for the most divisive brain teaser ever. But how can a brain teaser continue to be so divisive? Can’t the two sides decide on who has the correct answer — it is a logical problem that can admit just one correct solution, so why can’t the two sides be reconciled?</p><p>There is a very good reason why neither side can be convinced that their favored solution is wrong: because it is not. Both sides has a correct solution, so the futility of the debating over the correct solution is evident: neither side is ever going to be persuaded that their correct solution is somehow wrong.</p><p>But how can one question about probability have two correct answers? The answer is: of course, it cannot. Each side <em>can</em>, however, have a correct solution — to a different problem. And that is the situation here: two factions with two correct answers to two very similar, but nonetheless, different problems. So the argument should never have been which side had the solution correct, but which side had the problem correct.</p><p>This brainteaser is particularly tricky, since it presents itself as different problem than the one actually presented. The problem clearly involves <strong>sampling</strong>, that is, picking some item at random from a population of such items. But what trips people up and divides them into two camps. is this question:<strong><em> what is being sampled in this problem?</em></strong></p><p>Is the problem sampling <strong>families</strong> (with two children) or is it sampling <strong>children</strong> (from families with two children). Now, the way the problem is phrased, particularly the question about a sibling’s gender, suggests that this is a problem about sampling children. If you believe this is the problem presented:</p><ol><li>Sample a child from a family with two children</li><li>Observe that the child sampled is s a boy</li><li>What are the odds the that the sibling of the boy sampled is a girl?</li></ol><p>If this is the problem, then here is the solution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ppGe0D5y7SO7GoM_Saavdg.png" /></figure><p>Becuase half the boys are in families with two boys (and the same is true with girls), whenever we sample a child from a family with two children, then there a 50% chance that the other child in that family (that is, their sibling) has a different (or the same) gender.</p><p>The question posed is not actually about sampling children (since there is no explicit statement it is doing so). Instead, the problem is sampling <strong>families</strong> with two children, and then making some <strong>observation</strong> about the family sampled. Specifically we are (effectively) told the sampled family does not have two girls.</p><p>Here is the correct description of the problem actually presented by this brain teaser:</p><ol><li>Sample a family with two children</li><li>Observe that the family sampled has a boy</li><li>What are the odds that the family sampled also has a girl?</li></ol><p>And here is the correct solution for the correct problem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GvCvux5mB-8uWYvurarjKg.png" /></figure><p>Our family was drawn from a population in which families with a boy and a girl, outnumber the families with two boys, 2–1. So it is twice as likely that we chose a family with a boy and a girl, than that we picked a family with two boys. And the 66.66% answer to this problem simply reflects this ratio.</p><p>Of course, one might still argue that the problem really does sample children and not families. And of course one is free to have that debate. But at least that debate would the right one to have.</p><p>This brain teaser does tell us something interesting about probability. Once we have picked a family at random, if we then pick a child at random from that family, we have effectively sampled a child, and we are back to the first problem. So 2–1 odds against our having picked a family with two boys, now becomes an even 1–1 proposition — even though it might seem strange that odds could change like that. The reason is that it was twice as likely that we sampled the boy from the boy-boy pair, then from a family with a boy-girls pair — even though it was twice as likely that we selected a boy-girl family in the first place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2dfaeaaa6871" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turing’s Proof: a Famous Proof that (Practically) No One Understands]]></title>
            <link>https://medium.com/@greg.herlihy/turings-proof-a-famous-proof-that-practically-no-one-understands-bac1cefbbeb5?source=rss-4e4012a7720a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bac1cefbbeb5</guid>
            <category><![CDATA[halting-problem]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-programming]]></category>
            <category><![CDATA[theory-of-computation]]></category>
            <dc:creator><![CDATA[Greg Herlihy]]></dc:creator>
            <pubDate>Tue, 20 May 2025 01:30:49 GMT</pubDate>
            <atom:updated>2025-05-20T01:44:43.188Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OVqjGhmkL5JjSgnYeORIzA.png" /></figure><p><strong>True</strong> or <strong>False</strong> : Turing proved that we cannot know whether every Turing (i.e. single-threaded, deterministic) program ever halts.</p><p><strong>False. </strong>Turing’s proof imposes no limits on which halting problems can be solved (A<strong> halting problem</strong> asks whether a given Turing program, will ever halt once it has started running).</p><p>So, as long as we assume that every halting problem can be solved (and no one has proven otherwise), then we could have a scenario in which you are sending me halting problems all day long, and I would be sending the correct solution for each one, <strong>without ever returning a wrong solution</strong>.</p><p>Of course, being able to solve <strong><em>every</em></strong> halting problem would be a monumental achievement, so let us limit ourselves to the set of <strong>solvable</strong> halting problems, problems that we know that I can solve (in theory, not necessarily efficiently). For example, a halting problem for a Turing program with a bounded number of states would qualify as solvable. The salient point about this set of halting problems is not <em>how</em> they are solvable, only that they <em>are</em>.</p><p>The task of solving solvable halting problems is not going to be much of challenge for me. Once again, you could be sending me solvable halting problems all day long, and I would solve each one correctly, without exception.</p><p><strong>Hold on a minute!</strong> Some readers may be thinking to themselves. Isn’t there something wrong with this picture? Didn’t Turing prove that there is <strong><em>at least one</em></strong> solvable halting problem that I will not be able to solve correctly? Doesn’t Turing’s Proof prove that there are some halting problems that are not solvable, so it should not be possible for me to solve <strong><em>every</em></strong> halting problem correctly?</p><p>And the answer to all those questions is “No”. There is nothing wrong with this picture. The solutions to the halting problems I solve consititue <strong>knowledge</strong>, that is, information I can <strong>learn</strong>. Turing’s proof does not limit what I can learn, only what I can <strong>compute.</strong></p><p>So what exactly did Turing prove? Simply this: although I can solve every solvable halting problem passed to me, <strong><em>I cannot write a program to do the same</em></strong>. I cannot replace my role as a halting-problem solver, with a program, call it DoesHalt(), and have DoesHalt() solve halting problems as well as I can.</p><p>A natural question to ask here is: well, why can’t it? Why can’t DoesHalt() simply do <strong>exactly</strong> what I do to solve a halting problem? Surely, as long as DoesHalt() imitates my halting problem solving steps <strong><em>to the letter,</em></strong> it will obtain (and return) the same correct solution that I always returned. What is it about a program (instead of a person) that prevents DoesHalt() from serving as a perfect, halting-problem-solving replacement for me?</p><p>The difference is this, a program can call another program to solve a problem, a program cannot call upon a person to solve a problem. So, as soon as I wrote DoesHalt(), other programs suddently had the ability to call DoesHalt() themselves. Let’s keep that point in mind, while we return to describing Turing’s proof.</p><p>Turing proved that there are certain (let’s call them, <strong><em>evil</em></strong>) programs whose halting problems will trip up DoesHalt() every time, and induce it to return the wrong solution. Moreover, Turing proved that these evil halting problems will always exist for any DoesHalt() program that I could possibly implement. Lastly he showed how to construct one of these evil programs. And the construction looks like this.</p><p>Even if DoesHalt() is able to solve every halting problem you can throw at it at — what happens when DoesHalt() is asked to solve the halting problem for <strong>the currently executing program, </strong>that is, a program that has not finished running. For example, like this:</p><pre>program EvilProgram:<br>    if DoestHalt(EvilProgram):<br>        {execute_infinite_loop())}</pre><p>EvilProgram, being evil, has been written in such a way to ensure that no matter the solution DoesHalt() returns when asked whether EvilProgram will or will not halt, EvilProgram will not cooperate. If DoesHalt() predicted that EvilProgram will halt, EvilProgram never halts. If DoesHalt() predicted that EvilProgram never halts, EvilProgram halts immediately. So EvilProgram determines its own halting behavior to contradict with whatever behavior DoesHalt() predicted. So, no matter how DoesHalt() is implemented, it can never return the correct solution for any halting problem, 100% of the time.</p><p>So there are two things to remember about Turing’s proof. The first is that it is not a proof about solving halting problems, or whether or not they can be solved. The second, more subtle and more important point is that Turing’s proof set limits on the <strong>computable</strong>, not the <strong>knowable</strong>. We can know more than we are able to compute.</p><p>The reason so many people misunderstand Turing’s proof is they equate the computable with the knowable. And leads to this kind of common <a href="https://andrewzuo.com/the-halting-problem-doesnt-prove-what-you-think-it-does-7a5ad7d5ced1">misunderstanding</a>:</p><p><strong>Wrong</strong>: Turing proved that a program cannot solve every halting problem, so there must be some halting problems that cannot be solved.</p><p><strong>Correct</strong>: Even if every halting problem is solvable, it is not possible to write a program that can solve them all</p><p>Arriving at the correct understanding of Turing’s proof requires flipping the widespread misunderstanding of the proof — on its head.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bac1cefbbeb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>