<?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 Rob Rennie on Medium]]></title>
        <description><![CDATA[Stories by Rob Rennie on Medium]]></description>
        <link>https://medium.com/@robert.rennie?source=rss-c605544f44d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ir6S8p3WnAPTjZ4GjEpRFQ.jpeg</url>
            <title>Stories by Rob Rennie on Medium</title>
            <link>https://medium.com/@robert.rennie?source=rss-c605544f44d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:19:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@robert.rennie/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[Full Circle: The TI-99/4A, My Dad, and Back]]></title>
            <link>https://medium.com/@robert.rennie/full-circle-the-ti-99-4a-my-dad-and-back-473ea8fb5124?source=rss-c605544f44d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/473ea8fb5124</guid>
            <category><![CDATA[texas-instruments]]></category>
            <category><![CDATA[basic-programs]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[retro-gaming]]></category>
            <category><![CDATA[programming-history]]></category>
            <dc:creator><![CDATA[Rob Rennie]]></dc:creator>
            <pubDate>Mon, 27 Jul 2026 07:01:43 GMT</pubDate>
            <atom:updated>2026-07-27T07:01:43.831Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*kcOEH3esaz6SX3TyZ24lpA.png" /></figure><p>This article is a personal anecdote about how I learned to code — and the lifetime of wonder it created in me. If you’re an old coder like me, or a young coder who hasn’t had enough whippersnapper admonishments of how it used to be, you might find this interesting. At the least, it’s a fun and functioning walk down a memory lane in Computing USA.</p><p>This started, recently, with a clock.</p><p>I had been looking for an interesting time piece — a wall clock or something for the desk — for my home office. I have a watch, and the computer has a clock, but I wanted something a little more in-your-face. As I was fooling around with a GPS chip/board in some embedded programming research, I realized I could just build a clock with an old 16x16 LED <a href="https://shop.pimoroni.com/products/space-unicorns?variant=40842632953939">Pimoroni “Stellar Unicorn”</a> display (that ran MicroPython) I had lying around, unused.</p><p>The GPS signals transmit current time which I could then visualize using the Unicorn albeit I didn’t have a ton of screen real estate to work with. The <a href="https://www.adafruit.com/product/4415">GPS board (from Adafruit)</a> connected right into the back of the Unicorn, and I initially tried to display just minutes and seconds as digits, figuring I’d at least implicitly know what hour it was. Alas, after a beta test with the wife, it “made little sense”. So, I decided to try an analog (traditional) display as a circular clock face with moving hands.</p><p>The first step was to draw a circle on the 16x16 Unicorn. As we all know from trigonometry, we can use sine and cosine functions and a rotating angle along with a radius to outline a circle. I used a spreadsheet to pre-calculate the points of the clock face’s circle so I could define them as a static array in the code, I didn’t need to calculate these dynamically all the time!</p><p>And just at that point of thought, I was taken back in time to ca. 1982.</p><h3>My Dad And Circles</h3><p>I was on summer vacation in middle school so I guess I was somewhere between 12 and 14, inclusively. My dad had purchased a TI-99/4A “Home” computer (the “TI” being “Texas Instruments”) and I had taken to it — more like I was drawn to it — for reasons I can’t quite explain. It was an incredibly fun, rewarding and unending puzzle to solve. I enjoyed trying to build games I saw in the arcades and had visions of selling them — I wanted some of those quarters being dropped into arcade games! Summer vacations, devoid of schoolwork and sports, were my best opportunities for advancing my programming skills.</p><p>On one particular summer evening, I was working on a new program I wanted to sell called “Crab Graphics”. Why “crab”? Well, our family vacationed in Ocean City, NJ each summer, and to say the beach life had a profound impact on me would be an understatement. Crab Graphics was a drawing program (app) that was designed to let the user move a pixel cursor around, draw points, lines, rectangles, and circles.</p><p>I was a stubborn and proud kid (aren’t we all) and thought I could figure everything out myself — I had gotten rectangles and lines working on my own after all — but I was brought to my knees on the circle implementation. And so it was, on one warm August evening in Westtown Pennsylvania, I asked my dad, who was a mechanical and electrical engineer at that time, for help.</p><p>I don’t know why certain non-traumatic childhood memories decide to remain vividly emblazoned on one’s brain, but this one did. My dad was reading a finance book on a chaise lounge on our back deck, which was raised to the second floor. Since we had woods behind our house, being on the deck made you feel like you were in a tree house. It was a nice evening, when the humidity was manageable and it was still pretty light with the orange sun filtering through the trees.</p><p>“Dad, I need some help with drawing a circle on the computer”, I said.</p><p>“Hmm, that sounds like an interesting problem, go grab me some graph paper and a pencil”, he replied.</p><p>I then sat next to him, shoulder to shoulder, and watched as he drew a circle on a graph, and a bunch of lines with “sin” and “cos” written around them. I had no idea what he was doing but at least understood it was math I had not yet learnt. But, more importantly, me and Dad were really connected at that moment, our goals were mutual.</p><p>“What you need to do is write a FOR loop that goes through 360 degrees, and call these sine and cosine functions to figure out where to draw the pixel”, he said. Then he sketched out exactly what he was talking about, and gave me the code, in graph paper format. I said one of those skeptical smart-ass “ooookay’s” and went back to the TI.</p><p>I can’t really put into words — but remember to this day — the feeling of running that mystery code for the first time and seeing a circle appear on the screen. I know it sounds stupid in today’s graphical computer world, but it was magical to me. There was something about the math on the graph paper coming from my dad’s head and leaping onto the computer screen that hooked me for life. It still gives me chills to be honest.</p><p>In that moment, I experienced many “awes”: The awe of my dad’s intelligence, the awe of mathematics to describe real world things, the awe of a computer that could “run” that mathematics over time, the awe that I could actually access this realm with a computer in my bedroom, and the awe of the possibilities that lay before me with all of that combined. It was truly (and this is not a pun but a proper use of the word) awesome.</p><p>Thus, from needing a walk clock in my present day home office, to recalling a crucial spark my dad gave me when teaching myself to code, a full circle story is starting to appear. However, diving a little deeper technically now, why was drawing lines and circles on the TI-99/4A a big deal at all? Didn’t they already have that?</p><p>Answer: No.</p><h3>Overcoming BASIC Limitations</h3><p>If you’re not interested in geeking out on retro programming a little bit, then you can skip to the “Crab Graphics 2.0: Demo” section. However, I promise it’s not that hard as it is 1980’s BASIC stuff. Specifically, I was programming in TI’s “Extended Basic” (XB) language — which required the “Extended Basic” cartridge, sold-separately.</p><p>One challenging part of building Crab Graphics was the TI-99/4A’s (TI for short) graphical capabilities, or lack thereof. While there were certainly pixels on the screen, one could not access these pixels directly. The TI was a character-based screen sporting 24 rows and 32 columns of characters. The characters were represented by ASCII character codes ranging from 32 to 143 — the same codes used by today’s computers. Obviously, this presents an immediate issue in doing pixel based drawing.</p><p>The good news was the TI did give you the ability to redefine what a particular character looked like. All characters were defined by an 8x8 grid of pixels and were by default the characters of the alphabet, numbers, punctuation, etc. But the TI provided a function (CHAR) that allowed you to specify whatever you wanted in that 8x8 grid of pixels. Specifically, you’d create a string with 16 hexadecimal characters that defines groups of four pixels. The following image is taken from the original TI “User’s Reference Guide” and since at the time I wasn’t entirely clear on binary and hexadecimal arithmetic, I remember I actually had this diagram memorized (and still do):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*dfmaK1WP3kYFlEea4eLLaQ.png" /></figure><p>So, when designing graphical programs for the TI, you always used graph paper (starting to become a recurring theme) to first sketch out an 8x8 character, then use the grid above to translate that into a string of 16 characters (the Hexadecimal Code column above). Here is the example the “User’s Reference Guide” gives showing the “CHAR” function defining two characters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*Gr5FfQBdUiE5idp2C3RulQ.png" /></figure><p>The “VCHAR” function places character 96 at row 12 and column 16 however the “CHAR” function is called <em>after</em> that. Somewhat jarring from how we may code such a thing today, but this is due to the fact that character 96 will be redefined, even if it’s already on the screen! Note that in the code comments in the figure above it says the “character moves”. It’s not actually moving its position, but by successively redefining character 96, the little guy animates to <em>look </em>like he’s running.</p><p>Getting back to the pixel drawing, my plan now was: given a pixel screen coordinate, map it to character screen position, then to a unique character, then to a specific pixel within the character, and finally to the hexadecimal code. I would then need to alter the hexadecimal code to add (or remove) the pixel, and define (or redefine) the character at that character position.</p><p>Of course, this led to a number of limitations. Primarily, there were fewer characters available (around 80 or so depending on what default characters you can live without) than there were character screen positions (24 x 32 = 768). So, optimizing and tracking the use of these characters was key — blank areas obviously stayed as character 32 (a space) so only areas with pixels needed characters. These would be line diagrams without a flood fill feature!</p><p>Sounds easy, right programmers? Just some modulo division along with bitwise arithmetic and string manipulation and you’re good to go! However, the TI had no modulo division or bitwise arithmetic. It did have decent string manipulation, thank goodness.</p><p>I did figure out a way to do it, however I also remember it taking me a while to get right, and pulling out a lot of hair, which was ok because I was young and still growing fresh hair. But, to push even further along the circumference of the “full circle” of the title of this article, maybe I could rebuild it today for old time’s sake?</p><h3>Crab Graphics 2.0</h3><p>First, I went on eBay and looked for an old TI-99/4A and there were a few for under a couple hundred bucks. I was tempted but as my wife often reminds me, I already have quite a few one-time-use electronic gadgets so I try to keep them pretty small now and the TI is pretty big. Then I recalled an emulator I saw a few years ago and thanks to Google, I found it again. In fact, it’s still being maintained and is in fine working order and is called <a href="https://harmlesslion.com/software/classic99/">classic99</a>.</p><p>I encourage you to check out all it has to offer if you’re into the TI or retro programming, it’s a fantastic resource and really well done stuff. Most of the original cartridges are available to plug into the emulator virtually, including the beloved Extended BASIC (XB).</p><p>So, now that I had my environment setup, it was time to write Crab Graphics 2.0 complete with a “© Copyright 1982–2026” line in the code and splash screen! In short, I did complete the rewrite over the course of about three days. The full code for the solution is available at <a href="https://github.com/robrennie/ti99_article">this GitHub repo</a>, but I will highlight a couple of the “neat” parts herein.</p><p>Also, I must admit to cheating a bit. When I started, I forgot just how much of a pain line numbers were, and XB still required line numbers. XB did introduce “SUB”’s which defined what we would today call functions, but they still needed line numbers for GOTO control, “in-place” editing of code, etc. XB only had “FOR TO [STEP]” loops. I recall as a kid that I would plan out line numbers — so groupings of subroutines start at multiples of 1000. For example, string functions may start at 2000, graphics at 3000, etc. I remember working on programs for so long I’d have line numbers memorized.</p><p>Thus, you had to grab some graph paper (there it is again, graph paper) and sketch out a complete plan for your program so you could logically number your code lines. You also had to have a decent idea how many lines each section was going to be so you could increment line numbers leaving “room” to insert lines later. “Re-factoring” wasn’t really a thing back then!</p><p>So to keep myself sane, I wrote a little C#.NET preprocessor that will take “easy” XB code and add line numbers to create output XB code to then run on the TI. It allowed me to entirely dispense with line numbers, and I could indent, have blank lines for organization, etc. It also lets me use placeholders instead of line numbers where I may need a GOTO.</p><p>Given all the code is available for review, I’ll just point out a few things here. Namely, the pixel and circle functions, and modulo and bitwise functions missing from the TI I had to roll from scratch. Everything else is pretty self explanatory.</p><p>Here is the circle function in the “easy” code version:</p><pre>SUB CIRCLE(X,Y,R)<br>    ANGLESTEP=1/R<br>    ANGLE=0<br>    FOR ANGLE=0 TO 2 * PI + ANGLESTEP STEP ANGLESTEP<br>        CALL PIXEL(X + SIN(ANGLE) * R, Y - COS(ANGLE) * R, &quot;1&quot;)<br>    NEXT ANGLE<br>SUBEND</pre><p>And, here is the same code output from the preprocessor, just to show an example raw XB output that the TI actually runs. Only the “easy” code will be shown in subsequent snippets:</p><pre>1530 SUB CIRCLE(X,Y,R)<br>1540 ANGLESTEP=1/R<br>1550 ANGLE=0<br>1560 FOR ANGLE=0 TO 2 * PI + ANGLESTEP STEP ANGLESTEP<br>1570 CALL PIXEL(X + SIN(ANGLE) * R, Y - COS(ANGLE) * R, &quot;1&quot;)<br>1580 NEXT ANGLE<br>1590 SUBEND</pre><p>As can be seen, the CIRCLE function calls the PIXEL function which is shown next. This is the beating (crab) heart of Crab Graphics:</p><pre>SUB PIXEL(X,Y,B$)<br><br><br>    ! --- LOCALS INIT<br>    IF X &gt;= 0 THEN {DO_PIXEL}<br>    <br>    ! --- INIT PIXEL CHAR<br>    MINPCHAR=64<br>    PCHAR=MINPCHAR<br>    MAXCHARS=143-PCHAR<br>    MAXCHARSTR$=STR$(MAXCHARS)<br><br><br>    SUBEXIT<br><br><br>{line:DO_PIXEL}<br><br><br>    ! --- CALC CHAR POINT<br>    CX = INT(1 + X / 8)::CY = INT(1 + Y / 8)<br><br><br>    ! --- GET CURRENT CHAR<br>    CALL GCHAR(CY,CX,GC)<br><br><br>    ! --- MANAGE CHAR USAGE<br>    IF GC=32 THEN GC=PCHAR+1::PCHAR=GC::C$=&quot;0000000000000000&quot; ELSE C$=&quot;&quot;<br>    IF PCHAR &gt; 143 THEN PCHAR=MINPCHAR + 1::GC=PCHAR<br><br><br>    ! --- GET CHAR DEF<br>    IF LEN(C$) = 0 THEN CALL CHARPAT(GC,C$)<br><br><br>    ! --- CALC CHAR COORD<br>    CALL MOD(Y,8,CHARY)<br>    CALL MOD(X,8,CHARX)<br><br><br>    ! --- CALC CHAR IDX<br>    CHARIDX = 1 + CHARY * 2<br>    IF CHARX &gt; 3 THEN CHARIDX = CHARIDX + 1::CHARX = CHARX - 4<br><br><br>    ! -- HEX CHAR TO BITS<br>    CALL HEX2BITS(SEG$(C$,CHARIDX,1),CVTB$)<br>    !-- TURN ON PIXEL<br>    CVTB$ = SEG$(CVTB$,1,CHARX) &amp; B$ &amp; SEG$(CVTB$,CHARX+2,3-CHARX)<br>    !-- BITS TO HEX<br>    CALL BITS2HEX(CVTB$,CVTH$)<br><br><br>    ! -- UPDATE CHAR<br>    C$ = SEG$(C$,1,CHARIDX - 1) &amp; CVTH$ &amp; SEG$(C$,CHARIDX+1,16-CHARIDX)<br>    CALL CHAR(GC,C$)<br>    CALL HCHAR(CY,CX,GC)<br><br><br>    ! -- UPDATE STATS<br>    DISPLAY AT(1,1) SIZE(7): STR$(PCHAR - MINPCHAR) &amp; &quot;/&quot; &amp; MAXCHARSTR$<br><br><br>SUBEND</pre><p>Of note with the PIXEL function is the manual demarcation between initialization and function. In XB, a function was called a “subprogram” and really was just that. There were no “global” variables it could access unless they were passed in like any other parameter. In a sense, it had its own local globals, or more like class variables or statics in modern programming languages. The subprograms could be considered classes to some degree, however different methods (including initialization) would need to be “called” by defining a parameter rules with which the subprogram could branch.</p><p>The three functions PIXEL calls: HEX2BITS, BITS2HEX and MOD had to be rolled from scratch and are shown next:</p><pre>SUB HEX2BITS(CVTH$,CVTB$)<br><br><br>    ! --- LOCALS INIT<br>    IF LEN(CVTH$) &gt; 0 THEN {DO_HEX2BITS}<br><br><br>    ! --- PIXEL/HEX MAP<br>    DIM HEXMAP$(16)<br>    FOR I=0 TO 15::READ HEXMAP$(I)::NEXT I <br>    DATA &quot;0000&quot;,&quot;0001&quot;,&quot;0010&quot;,&quot;0011&quot;<br>    DATA &quot;0100&quot;,&quot;0101&quot;,&quot;0110&quot;,&quot;0111&quot;<br>    DATA &quot;1000&quot;,&quot;1001&quot;,&quot;1010&quot;,&quot;1011&quot;<br>    DATA &quot;1100&quot;,&quot;1101&quot;,&quot;1110&quot;,&quot;1111&quot;<br>    SUBEXIT<br><br><br>{line:DO_HEX2BITS}<br>    AH = ASC(CVTH$)<br>    IF AH &gt; 64 THEN HN = 10 + AH - 65 ELSE HN = AH - 48<br>    CVTB$ = HEXMAP$(HN)<br>SUBEND<br><br><br>SUB BITS2HEX(CVTB$,CVTH$)<br>    CVTN = 0<br>    IF SEG$(CVTB$,4,1)=&quot;1&quot; THEN CVTN = CVTN + 1<br>    IF SEG$(CVTB$,3,1)=&quot;1&quot; THEN CVTN = CVTN + 2<br>    IF SEG$(CVTB$,2,1)=&quot;1&quot; THEN CVTN = CVTN + 4<br>    IF SEG$(CVTB$,1,1)=&quot;1&quot; THEN CVTN = CVTN + 8<br>    IF CVTN &gt; 9 THEN CVTH$=CHR$(65 + CVTN - 10) ELSE CVTH$=CHR$(48 + CVTN)<br>SUBEND<br><br><br>SUB MOD(D,I,R)<br>    R = INT((D/I - INT(D/I)) * I)<br>SUBEND</pre><p>Nice code right? Not all that much different from what we (or AI) write today, 44 years or so later. But, does it run?</p><h3>Crab Graphics 2.0: Demo</h3><p>For drawing functionality, Crab Graphics 2.0 lets the user move a single pixel cursor around the screen using the E,X,S and D keys (up, down, left, right, respectively) and draw lines, dots, rectangles and circles. Images can be saved and loaded to what would have been a cassette tape back then, and character usage is tracked. Here is the splash screen that appears when Crab Graphics is RUN:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*v9Oo0Fated8rHG2SHZLT_A.png" /></figure><p>Next, here’s is the demo diagram that is drawn from a subprogram (i.e., when ‘1’ is pressed):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*r_rfhhrMH4ywMQgKCAKssg.png" /></figure><p>Notice, as the “documentation” states, the upper left shows how many characters have been defined in order to draw the diagram shown. Turns out, there’s a decent amount you can do with line drawings and the available number of characters. The upper right shows the starting position and the current cursor position. The starting position is set by moving the cursor and hitting the space bar. Then, you would move the cursor to where you want a line to end, for example, and hit the “L” key. Here is a quick ad hoc diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*bvtI6bQmaKjloaRw8pCSbA.png" /></figure><p>Pretty cool right? I understand it’s no great shakes considering today’s world of GPU-driven super graphics, but back then it was pretty darn neat.</p><p>I was always building programs with the idea of selling them, and Crab Graphics was no different. So, how did that work out?</p><h3>Crab Graphics 1.0: Marketing</h3><p>While building Crab Graphics in the early 80’s was an education in math and programming, trying to sell it was an education in marketing. I couldn’t afford to advertise in the 99’er magazine on my paper route (Philadelphia Bulletin) salary so I had to improvise. I had seen a bulletin board at the local supermarket where people would pin ads for services with little tear off pieces with a phone number at the bottom — like what you see on college campuses when students are looking for roommates or such.</p><p>So, that’s what I did — I forget how exactly but I created a bunch of these flyers and pinned them up at a couple local markets. Then, I sat back and waited for the millions of people with TI-99/4A computers, all with a hankering to draw pixel graphics, to begin ringing my phone off the hook! This would surely be the next VisiCalc!</p><p>Alas, crickets. Nothing.</p><p>Apparently, my target market wasn’t getting the message — or perhaps didn’t exist — there definitely weren’t millions. Now that I look back, I know that the TI-99/4A was at that point already almost discontinued because Texas Instruments was getting walloped by the Commodore 64. (I was always envious of the Commodore 64 guys because they were coding in assembly and it ran so much faster.) And the reason, of course, the TI was nearing discontinuation is due to lack of sales, despite being a relatively powerful computer.</p><p>Given the abysmal market penetration of the TI-99/4A, and the fact that some random person out grocery shopping would have to a) have one and b) want to draw graphics in order to tear off my number, I realize now the probability of a sale was roughly zero. But this did not discourage me at the time. Instead, for some reason, it intrigued me. I knew I had a great, innovative, unique product that would be useful to someone. I discovered that learning to build software products is much less a mystery than learning how to get them into the hands of someone who is willing to pay for them. In fact, even “experts” today are still trying to figure out the latter.</p><h3>Concluding Thoughts</h3><p>Crab Graphics 1.0 was the last program I wrote for the TI-99/4A back then as my dad moved on to a Zenith PC which was IBM PC compatible. We know how the story goes from there — I moved on from BASIC when one day, at a summer job in high school (when I was 15), my boss dropped a manual on my desk called “Lattice C”. What, no line numbers? Even the “PC Focus” database language we were using had line numbers, but this “C” has no line numbers?</p><p>Crab Graphics 2.0, today, is the last program I’ll ever write for the TI-99/4A, perhaps the last program anybody will ever write for the TI-99/4A, and that’s sort of sad. I wish all kids with the inclination could go through such a thrilling learning curve disguised as an adventurous discovery, that I did. Maybe those opportunities are still out there, maybe retro programming will become a thing, but it will never be a necessity like it was.</p><p>This exercise reminds me of many things. For example: graph paper. The theme has come up several times in this article. To this day, I have stacks of graph-ruled marble-cover notebooks that I have used as my engineering notebooks for as long as I can remember. No matter what I do in the programming (or business) world, it always starts with notes in a graph-ruled marble-cover notebook. Graph paper is way better than whiteboards as whiteboards have no structure. Graph paper requires you to think more like the computer thinks or requires us to think.</p><p>I remember vividly, being away from the computer, whether in school or on vacation or in the car or train, and writing down what I had planned to program when I got back to the computer. The limitations of programming back then required almost a complete mental image — from memory layout to line number segmentation, etc. — prior to writing a line of code. The refactoring happened on a sheet of graph paper before any code was written. I’m not sure how that can be taught now.</p><p>Another thing I’m reminded of is how little programming has changed. Once I added my preprocessor for the “easy” XB to get rid of line numbers, it wasn’t that far from modern programming languages at all. Given more than 40 years have passed, that’s quite extraordinary. What’s old is new, programming logic is what it is regardless of what language it’s packaged in. It’s no wonder it’s so easily learned by AI as at its root it’s just fundamental logic — we’ve just fooled ourselves into creating new ways of doing the same thing and called it progress.</p><p>Finally, I realized, as a dad myself now, we never know how something we say or do with our kid(s) may seem so insignificant to us but may have a life-altering, revelatory impact on them. I doubt if I had asked my dad if he’d even remember the circle conversation. But <em>I</em> always will. When he first got the TI, he wrote a slot machine game. He of course drew all the slot machine graphics on — you guessed it — graph paper, as well penciled out most of the code too. At one of our family gatherings, he showed it off to his friends and family. It was so cool.</p><p>I used his notes from that game to learn to code.</p><p>Way to go Dad, that was some bad ass code. It did way more than anything I’ve ever written.</p><h3>References:</h3><ul><li>Adafruit Mini GPS PA1010D: <a href="https://www.adafruit.com/product/4415">https://www.adafruit.com/product/4415</a></li><li>Article GitHub repo: <a href="https://github.com/robrennie/ti99_article">https://github.com/robrennie/ti99_article</a></li><li>classic99 TI-99/4A Emulator: <a href="https://harmlesslion.com/software/classic99/">https://harmlesslion.com/software/classic99/</a></li><li>Pimoroni Stellar Unicorn: <a href="https://shop.pimoroni.com/products/space-unicorns?variant=40842632953939">https://shop.pimoroni.com/products/space-unicorns?variant=40842632953939</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=473ea8fb5124" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unfathomably Small In Unfathomable Numbers]]></title>
            <link>https://medium.com/@robert.rennie/unfathomably-small-in-unfathomable-numbers-938aa2d8e387?source=rss-c605544f44d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/938aa2d8e387</guid>
            <category><![CDATA[hidden-variable]]></category>
            <category><![CDATA[quantum-physics]]></category>
            <category><![CDATA[quantum-mechanics]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[metaheuristics]]></category>
            <dc:creator><![CDATA[Rob Rennie]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 07:55:15 GMT</pubDate>
            <atom:updated>2026-07-04T07:55:15.702Z</atom:updated>
            <content:encoded><![CDATA[<h4>Musings on plants, uranium, quantum computing and exponential distributions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1YZmEUue6Qq-7isIfro8Sw.jpeg" /><figcaption>m-particles</figcaption></figure><h3>Introduction</h3><p>This article stems from the study of naturally occurring quantum phenomena, which stemmed from the study of quantum mechanics, which stemmed from the study of quantum computing. One finds a brick wall relatively quickly when studying quantum computing in that simulations that implement quantum mechanical matrix arithmetic only take you so far. Thus, one looks for something real world to experiment with as gaining access to super-cooled million-dollar quantum computers is out of reach for most.</p><p>Two phenomena are discussed herein: radioactive decay and photosynthesis. Radioactive decay is accepted as a quantum mechanical process, in particular the randomness of the occurrence of ion emissions, while quantum mechanics in photosynthesis is more of a proposal or theory. In photosynthesis, it is suggested the path of a photon’s energy through a leaf to the leaf’s energy center is optimally discovered quantum mechanically via superposition and coherence.</p><p>While using such rudimentary materials might seem silly at first, a very real-world quantum physics experiment can be done with two Geiger counters (connected to a controller computer) and a sample of uranium ore. For example, one can implement a probability density matrix test for entanglement as described in section 7.7.2 of Leonard Susskind’s “Quantum Mechanics”<em>⁷</em>. Alas, no entanglement was discovered (as one would expect!) but a deeper understanding of the theory and math was a benefit of implementing the experiment.</p><p>Furthermore, a Geiger counter and a chunk of uranium ore can be used to create authentic qubits, which are “bits that are a superposition of 0 and 1”. This is a little trickier than it sounds as the quantum mechanical definition of radioactive decay is the 50/50 probability of an occurrence of an emission over a “fixed time”. This then leads one directly to the study of Poisson processes (temporal and more importantly, spatial) as well as exponential distributions as this math is required to find the aforementioned “fixed time” experimentally.</p><h3>Poisson Processes and Exponential Distributions</h3><p>A Poisson process is one defined as having independently occurring events over time or space - a coin flip, for example, where one flip has no effect on the next. A confusing aspect of most definitions (e.g. Wikipedia) is that they tend to focus on time instead of space and thus one comes away thinking a Poisson process involves only events occurring at independent time intervals. In fact, radioactive decay is described with the word “time” in many places - e.g., decay time, half-life, clicks-per-minute, etc. - however from a measurement perspective, it’s actually a spatial Poisson process.</p><p>Let’s start with a simple experiment that shows an exponential distribution that occurs via a natural Poisson process: radioactive decay. For this experiment, all we will do is measure “click intervals”, or the time between each detection of an ionized particle emitted from a sample of uranium ore, detected by a Geiger-Müller tube connected to a controller computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*5WWhmXll-jHZumCgC9AcyA.png" /></figure><p>The first graph shows a sample of 300,000 click interval readings (sorted from smallest to largest). Notice that the curve is nonlinear as there are more readings at a smaller click interval. Next, we’ll generate a histogram of the same dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*fXg_uWRv8NNoGeBIfKKgJg.png" /></figure><p>With the histogram, it now becomes obvious that this is an exponential distribution - the Poisson process of radioactive decay, when measured in this manner, clearly shows its nature by virtue of the distribution of the click interval counts. In fact, returning to the idea of creating a qubit from radioactive decay, the exponential distribution becomes of critical importance in finding the “fixed time” to look for an ionization event to produce 50/50 results of a 0 or 1. Following is the formula for the median of an exponential distribution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/124/1*o-0Hxp7cfVAGWWki8hfZbg.png" /></figure><p>In this formula, lambda (λ) represents a “rate” parameter and in this experiment the rate is easily calculated by dividing the total number clicks (C) by the sum of the click intervals (I):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*7V1Ym1yLzQA5Imhed-ISFA.png" /></figure><p>Plugging this rate into the median formula gives the median click interval:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*CvRw9yif05LoS80RBQnAfw.png" /></figure><p>Therefore, in order to create a qubit from the radioactive decay of the uranium ore sample used in this experiment, a computer controller (program) would need to wait around 65 milliseconds and record whether the Geiger-Müller tube detects an ion emission within that interval. If an emission is detected, then a 1 is produced, otherwise a 0, and until the result (state) is observed, the state of the qubit is unknowable and in a quantum superposition of 0 and 1.</p><p>It is important to point out that while quantum physicists or quantum computing experts may argue vehemently that such a room-temperature and classically electronic setup couldn’t possibly lead to a superposed state due to decoherence everywhere, current theory would say they can’t prove it. One can refer to Schrödinger&#39;s cat Gedankenexperiment described (ad nauseam) elsewhere to understand more.</p><p>Regardless of quantum weirdness, the key is that while each individual event, in this case the ionization event detection, is random and unrelated to any prior events (or subsequent for that matter), when viewed over time the results form the probability density function (PDF) of the exponential distribution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/109/1*XKRaCPa5EQ4d7WqRAQPo_w.png" /></figure><p>For example, compare Wikipedia’s PDF graph<em>¹</em><strong><em> </em></strong>of an exponential distribution (see end notes for a link) to the histogram graph presented earlier.</p><p>Poisson processes seem to lose some of their independent randomness when viewed over time. Isn’t this remarkable? It is well-worn territory taken for granted mathematically but it’s worth thinking about a little deeper. Why, with the simple addition of time, does an independently random process seem to be tending towards a specific solution? Furthermore, where is this “time”, or in whose perspective does it exist? Were it not for us humans observing things, would nothing tend towards a specific solution? Does our concept of time create “goals” that independently random events seek to reach?</p><h3>Radioactive Decay: Poisson In Time or Space?</h3><p>Up to this point, we have discussed the Poisson nature of radioactive decay with the word “time” being mentioned quite a bit - the click interval, the rate over time, etc. so it is natural to conclude that radioactive decay is a temporal Poisson process. However, it turns out, this is not actually the case.</p><p>If one were to set up a second Geiger counter, measuring the same chunk of uranium ore as the first Geiger counter, at the same distance from the ore, but from a different position of course, the exact same distribution would result - both Geiger counters would report the same click interval, rates, and thus exponential distributions. If this were a temporal Poisson process, one would expect click rates to be elongated as half would go to one Geiger counter, half to the other. But, this is not what happens.</p><p>It’s easy to see what’s going on here with a simple simulation. Let’s create a bit of C++ code to simulate a radiation source and detector. The radiation source generates ionized particles randomly and the detector detects them. The number of emissions that occur undetected prior to a detection are recorded and logged:</p><pre>// initialize distribution around a circle<br>uniform_real_distribution&lt;double&gt; distrib_emission(0.0, 2 * PI);<br>// circular geiger counter<br>Circle geiger{{0.0, geiger_gap + geiger_radius}, geiger_radius};<br>// center of radioactive material<br>double  x = 0.0,    <br>        y = -1.0;<br>for(int r = 0; r &lt; run_count; r++) {<br>    for(int t = 0; t &lt; max_time; t++) {<br>        // get random emission angle<br>        auto emission_angle = distrib_emission(gen);<br>        // define ray from center of material out<br>        Ray ray{{x, y}, {cos(emission_angle), sin(emission_angle)}};<br>        // check for an intersection<br>        if(ray.intersects(geiger)) {<br>            // log how &quot;long&quot; it took for a ray to reach detector<br>            log_result(t + 1);<br>            break;<br>        }<br>    }<br>}</pre><p>Here is a diagram of the above code in action, showing “rays” representing ionization events occurring randomly with only some reaching the Geiger counter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*GnpC9-ey-YeWm0hUaxqwlA.png" /></figure><p>Next, we’ll take a look at the log file generated from the code where the number of tries (or misses) before a hit (or detection) is recorded. Following is a histogram of that data for a representative sample test run of the above code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*wDiC546K1R7XAicOOhBSmw.png" /></figure><p>The results of the simulation do in fact match the exponential distribution that was measured in the actual uranium ore experiment. This highlights the fact that the emission rate of ion “rays” (in the simulation or in the real world) is actually constant over time, it’s <em>where </em>the emission happens that is random. In other words, if one had a spherical Geiger counter and could place the uranium ore suspended in its center, the log file would not produce the same exponential distribution, it’d be flat.</p><p>Regardless of whether this Poisson process is temporal or spatial, a far more interesting line of thinking comes from the idea of the sort of random brute force search that is occurring in these processes, and how that search tends towards a “correct” solution faster. Granted, the words “search”, “correct” and “solution” are all ambiguous at best — but why do the independent random events seem to tend towards the detector once it enters the system?</p><h3>Memoryless Brute Force Search</h3><p>Let’s now follow this idea backwards, to an even simpler formulation. Thinking abstractly, let’s say the radiation detection experiment was the randomness of the ionization events “seeking” the detector. What if we simply search for a number (a solution) in a set of unique numbers (solution set), repeatedly? Our algorithm will be so brute, it won’t even remember which potential solutions in the set it visited before. Each time through a loop, it’ll just randomly pick a number (solution) within the set of possible solutions and check if it matches the target, or “goal” solution. Then, it’ll log how many random tries it took before getting a match. Here’s a little snippet of code that does this:</p><pre>// initialize random distribution of <br>// solutions (full solution space)<br>std::uniform_int_distribution&lt;int&gt; distrib(1, num_solutions);<br>for(auto r = 0; r &lt; run_count; r++) {<br>    // pick a random solution<br>    auto correct = distrib(gen);<br>    // try to find &#39;correct&#39; randomly up to a max number of tries<br>    for(auto tries = 1; tries &lt;= max_try_count; tries++) {<br>        auto this_try = distrib(gen);<br>        if(this_try == correct) {<br>            // found solution, log &#39;tries&#39; and break out<br>            log_result(tries);<br>            break;<br>        }<br>    }<br>}</pre><p>Next, as you may be sensing a theme here, we’ll view the result log from the code snippet in a histogram format:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*0sHwzUL-ktIeloOwUt68yQ.png" /></figure><p>Again, we see an exponential distribution which may be surprising to some as the algorithm is “O(n)” — meaning it scales in execution time linearly with the number of potential solutions. However, if you were to take the mean of try counts, and expect to get a match 50% of the time that that number of tries were attempted, you’d be wrong. In other words, given N possible solutions the mean and median number of tries needed until a match are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/193/1*H57ZOs2lJh52aZyVUK99Zg.png" /></figure><p>Therefore to find the correct solution 50% of the time, you would actually execute the <em>median </em>number of tries. Why is this when the mean seems more intuitive? To see where this algorithm acquires its exponential nature, we use basic probability theory. First, let’s start by considering the probability of <em>not </em>finding the correct solution on a single try:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/128/1*F925SfGO_safh_DYc-tDeQ.png" /></figure><p>For example, if there are 10 solutions then the probability of not finding the correct solution is 9 in 10, or 90%. Now, consider T tries, the probability then becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/162/1*_ioNDUrBUUDzAB6ju6SUvQ.png" /></figure><p>In other words, on each try, we multiply the “not” probability again by itself. Finally, to convert this to probability of a solution match (instead of “not”), we subtract the above from 1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/1*mQg1W-KtZ0tr3grE666_ug.png" /></figure><p>For example, in the case where there are 10 possible solutions, to get an average match rate of 50% we would need to try 7 times each round:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*9ilG8RYl2Rkys2R4x-xxZg.png" /></figure><p>Also note that 7 (the number of tries) follows from the median calculation shown earlier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/1*e2WU0IfTfYBPhY9rMtEnsg.png" /></figure><p>So, the exponential nature occurs due to the fact that probability is multiplied by itself on each try over time.</p><p>It is interesting that independent memoryless random events can, over time (or how we characterize time using probabilities), show a tendency towards a particular solution — there are more short try counts than long try counts. It seems almost as if these events, combined with some sort of context, can leverage time (or something else within the context) to come to a “correct” solution. In fact, this is an entire branch of study in computer science called “metaheuristics” where genetic algorithms, simulated annealing, ant colonies, etc. attempt to improve upon basic stochastic random search algorithms. But, even without those metaheuristic algorithms, nature at least appears to know how to take “pure” randomness and leverage time to home in on a solution to a given problem.</p><p>It is submitted that the anthropic principle may be at play here as well — there are no “goals” or target solutions — it just “is what it is” measured over time tending towards a limit. Simple probability theory at work, which is all true. However, quantum physics, mechanics and computing, are all based on “simple probability theory” (much to the consternation of Einstein) so perhaps yet another deeper conceptual look wouldn’t hurt. We are still looking for hidden variables after all — or what “randomness” is “made of”.</p><p>In any event, it is interesting indeed that the output of the memoryless brute force search algorithm is the same exponential distribution as measuring radioactive decay!</p><h3>Photosynthesis</h3><p>The process of plants turning sunlight into energy, or photosynthesis, is said to use quantum physics to efficiently shuttle a photon’s energy (coming from the sun) to the reaction center of a leaf where the energy can be harvested. Specifically, a photon “excites” a chlorophyll molecule antenna, which then creates an exciton. The exciton then must find the best path to the reaction center before it loses its energy.</p><p>It has been proposed that quantum physics allows the exciton to “see” all possible paths, jumping from molecule to molecule, from where it is to where it needs to be — the reaction center. Measurements have been done that appear to show near perfect efficiency in path selection of the exciton reaching the reaction center.</p><p>Finding the optimal path through a set of points (molecules in this case) is a common sample problem in metaheuristics called the “travelling salesman problem” (TSP). The TSP can be formulated identically to the brute force search algorithm presented earlier — namely finding a number within a set of unique numbers. In the case of the TSP, each possible path is a number or an “index” of the unique path if you will. The goal of solving the TSP is finding the index of the path, amongst all possible paths in the solution space, that is the shortest.</p><p>We know that nature, and thus a leaf in this case, could leverage a brute force search approach to find the best path for the exciton to the energy center. Granted, this would not be as performative as what has been measured in nature, unless perhaps the brute force search could be run in parallel.</p><p>However, let’s instead dispel the idea that it is quantum physics at work at all in photosynthesis. This line of thinking may then lead to more systems that may <em>not </em>be quantum physics at work either (i.e., which could be interpreted classically). Perhaps plants have evolved their own metaheuristic in the form of something as simple as a funnel. We know that the shape of leaves form a funnel for collecting water, optimally collecting morning dew for example. It certainly seems reasonable they could have developed an exciton funnel.</p><p>Let’s write a simple simulation in C++ again that implements a simple cellular automata rule. Cellular automata is another branch of research in computer science where simple rules are defined for “small” things individually that result in complex behavior collectively. Each small part of a system, a cell for example, is given simple rules that it individually follows and when a mass of cells all following those rules are viewed as one, complex, and even random features can appear.</p><p>The rules we’ll create for the exciton simulation are exceedingly simple:</p><ol><li>Excitons have a maximum “life radius” they can jump across to get to another molecule</li><li>Excitons always jump to the molecule in its vicinity closest to the energy center</li></ol><p>There are many ways plants could have evolved solutions to determining part 2 of the above rule. A chemical gradient (e.g., salinity level within water) could exist from the energy center out, or something electrochemical — but given the plant created water funnels, it likely could create a funnel for this too.</p><p>Here’s a code snippet for the funnel model of energy collection in photosynthesis:</p><pre>bool found_center = false;<br>while(1) {<br>    if(molecules[current_molecule].is_center) {<br>        found_center = true;<br>        break;<br>    }<br>    int next_molecule = -1;<br>    double min_distance = molecules[current_molecule].distance;<br>    for(auto m = 0; m &lt; num_molecules; m++) {<br>        // apply Rule 1<br>        if(molecules[current_molecule]<br>           .distance_from(molecules[m]) &lt;= life_radius &amp;&amp;<br>        // apply Rule 2<br>           molecules[m].distance &lt; min_distance) {<br>                next_molecule = m;<br>                min_magnitude = molecules[m].m;<br>            }<br>        }<br>    }<br>    current_molecule = next_molecule;<br>    path.add(current_molecule);<br>}</pre><p>Here is a graphical representation of the above algorithm:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*EsHlzQw1xTp6fQJNsqyqaQ.png" /></figure><p>Several dozen iterations through the exciton funnel cellular automata rule are shown. From an outside observer, unaware of the CA rules or medium that implement them, it appears that the exciton “sees all paths at once and chooses the best” however this is not what is going on at all.</p><p>So what does this have to do with the randomness and exponential distributions occurring in Poisson processes mentioned earlier? Ultimately, it’s further funneling. Where time takes independent random events and funnels them into exponential distributions, evolution allows a plant to improve this by further funneling the stochasticity towards a goal. In some sense, it becomes relatively clear how evolution itself may have evolved — time essentially warps stochastic “stuff” in the form of funnels governed by localized, independent rules.</p><p>Yet again, the question of what exactly is being funneled is left unanswered. Is there some “thing” in randomness, or is there no thing and just probabilities over something that cannot be named. The former is hidden variables theory, the latter is quantum physics.</p><h3>Unfathomably Large Numbers</h3><p>In “Fantastic Numbers and Where To Find Them”<em>⁶</em>, Antonio Padilla describes some really, really big numbers. Actually, there are no adjectives to describe them properly. They generally occur from game theory — numbers of possible combinations or permutations of a given construct. They can be described using Donald Knuth’s up arrow notation, for example, which describe “towers of powers”. Graham’s Number and TREE(3) are examples of numbers so large they could cause “black hole head death” simply trying to cogitate them due to the entropy contained within them.</p><p>We’re going to be dealing with numbers like that next.</p><p>One of the problems with much of the literature on quantum computing (less so quantum physics and field theory) is the focus on individual particles — photons, electrons, qubits, etc.. Quantum computers operate on individual qubits, and even the best quantum computers today only provide a dozen or so logical qubits. When entanglement is discussed, it is presented as two particles being entangled — when the basic Bell circuit is shown in quantum computing, it’s between two qubits. Teleportation, no cloning, spooky action at a distance — all from the perspective of individual particles.</p><p>Quantum physics is described as the domain of the really tiny (and relativity the domain of the “large”) but rarely mentioned is the <em>quantities</em> of the really tiny. Photons don’t generally appear alone! If you were to ask AI how many molecules there are in a square millimeter of an average plant’s leaf, it would respond with something like 9 x 10¹⁶. Of course, drilling down deeper into the subatomic (and quantum influenced) particle count yields a number even more astronomical. This is why, when we are faced with numbers this large, we revert to characterizing them en masse as “waves” or “fields” or “solids” and develop related classical physics and then mathematics (or is it mathematics then physics?) In short, dealing with really large numbers is hard, even for supercomputers.</p><p>But, let’s do our best and continue our study of the mighty leaf and the idea that an exciton needs to follow “all paths” instantaneously to find the shortest path to the energy center. Following is the formula to calculate the number of paths in a typically formulated travelling salesman problem (TSP) which is <em>close enough </em>conceptually to the problem our travelling exciton faces, where <em>n</em> is either the number of cities, or molecules in this case:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/90/1*whAZhsAiWLB5LM3y9J5uHA.png" /></figure><p>Now, if we were to plug in the answer AI gave for the number of molecules in a square millimeter (mm²) of your average plant the formula becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/111/1*lUfOYq9gZihRv7iX2vz8iA.png" /></figure><p>This is one of those “black hole head death” numbers! It cannot be computed further to any rational description so we’ll just leave it as is. Quantum physics says that in scenarios like this, all of these paths are explored and the best is found, instantaneously, but <em>what</em> exactly is doing the exploring is undefined — it could be “multiple universes”. Once you put actual numbers on some of these quantum physics ideas, they start to sound absurd indeed, at least to us humans.</p><p>Next, let’s consider things smaller than molecules and in fact, let’s not even try to pick a particle physics particle by name, massless or otherwise, let’s just go straight to the smallest unit of length physics has come up with, the “Planck length” which is 1.62 x 10-³²mm or 3.83 x 10⁶³ in one mm². What could we do with something that small and numerous packed into the same space as the molecules?</p><p>First, let’s scale things down a bit so we can actually calculate something. Since the estimate of leaf molecules is of the order 10¹⁶, let’s divide that out. This would equate to us now operating at a size of 1/10¹⁶ of a millimeter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*ZqBfbwL8OAXPDaFlgjEraQ.png" /></figure><p>Talk about overkill! This would give the plant 3.83 x 10⁴⁷ “explorer” particles to use to try 181,440 paths in parallel (at the same time). Working backwards now, the question becomes how many explorer particles <em>would </em>we need at minimum and subsequently, how big could they be. For this, we return to our study of the brute force search and its exponential distribution of search times.</p><p>First, and most importantly, we would need to know the accuracy required of the plant. How reliably must the best possible path always be found? We know things in nature are not generally 100% efficient, photosynthesis included, so let’s just use 50% to demonstrate where the reliability factors into the formula. Earlier, we found that the brute force search achieved 50% at ln(2) multiplied by the number of solutions. Therefore, in our 1/10¹⁶ of a millimeter we would need the following number of explorer particles (EP in the formula below) to achieve 50%:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*np_n0sCcZmWtOItcSExh6Q.png" /></figure><p>And this would translate to a particle that is 1.26 x 10-¹¹ mm². That’s gargantuan relative to the Planck length, and bigger than electrons even. It must be pointed out that speaking of “sizes” like this is not how quantum physics works as quantum particles such as electrons and photons are massless and sizes are wavelengths of points in vibrating fields. But the point here is that for any problem with <em>n</em> components forming <em>N</em> possible solutions in some space, there is a formula based on <em>N </em>for the number <em>m</em> of “smaller” components within the same space that could explore all <em>N</em> solutions to a required level of reliability.</p><p>The gap between the number of components (<em>n</em>), and the number of explorers (<em>m</em>), is very large, as is the space between many particles in nature — maybe that’s why. Atoms are mostly nothing after all. And, this example used relatively large molecules (from the leaf) as the “<em>n</em>” components, but imagine if we instead started with fundamental particles like quarks as the <em>n</em> components — the <em>m</em> explorers would be unfathomably small.</p><p>Is it more likely that quantum physics creates a new universe for every possible path an exciton could take through a leaf, or that there are smaller particles that we cannot detect, now or ever in the future, that explore a solution set in parallel? There are already many particles that are theorized that we cannot detect — gravitons, dark matter, etc. — why not some sort of random explorer particle whose job it is to simply exist in unfathomably large numbers to solve problems by parallelizing a brute force search? Further, why would nature have ever evolved us to be aware of these?</p><p>At risk of being blamed for naming or renaming something that would invite (even more) scathing physicist ridicule, these unfathomably small particles occurring in unfathomably large numbers shall hereby be referred to as “<em>m</em>” particles, as in you need <em>m </em>particles to find a solution in <em>n</em> possible solutions in the solution space with a given probability <em>p</em>.</p><h3>Interface Theory of Perception</h3><p>When discussing unfathomably large numbers and particle quantities alongside unfathomably small things, the Interface Theory of Perception (ITP)⁴<strong><em> </em></strong>can be of great relief. In “The Case Against Reality”, Donald Hoffman describes the ITP as analogous to a Windows (or Mac) desktop with folders, icons, etc.. When we look at a folder on a desktop, we know it’s not actually a paper folder behind a plate glass window in a box that a gopher goes and grabs for us, but most people don’t know <em>what </em>it actually is. Software engineers know it’s actually bits and bytes stored in a persistent store like a hard drive, perhaps cached in memory for fast display, with code to decode icon images and react to mouse clicks, but even they’re not thinking that when they use them.</p><p>Beyond just reality as an interface, Hoffman writes, evolution would have no reason to evolve us to see anything any deeper than what we need to survive — this is his “Fitness Before Truth” (FBT) theory. Why would anyone need to know the details of the actual implementation of a desktop icon? That would negate the whole point of a user interface. Hoffman’s point is deeper than just “what we see is an interface on top of reality”, it’s that we can never look behind the interface because it’s not in our DNA to — there’s no evolutionary reason we should be able to see much less understand it.</p><p>If a physicist argues that a Planck constant is the absolute smallest there could be, this is only according to the interface they (we) can see — that the physicist’s math can operate upon. If we want to see a folder, the desktop gives us a folder icon. If we want to see light as a wave we can be shown a wave icon, a particle, a particle icon. The double-slit experiment (discussed more in the next section) becomes simply a menu item and an icon at different places on the desktop that both point to the same app and serve users biased to one method of opening the app or the other. We see the fundamental particles as the best representation our brain can come up with, which is currently vibrating little strings or points in fields. In fact, the interface even shows our <em>own </em>brain to our <em>own </em>eyes (e.g., a neurosurgeon’s eyes) as a cluster of cells. But who knows what it really is, that’s just the interface we needed to survive, and thankfully it has enough fidelity for successful neurosurgery!</p><p>The goal of this section was not to wax philosophical as that was done in Hoffman’s book and is just paraphrased here. It’s simply to state that an unfathomably large number of unfathomably small particles (<em>m</em>-particles) all operating in parallel to instantaneously solve unfathomably large problems that appear as “reality”, would likely never be found because they would be hidden by the ITP. It’s just not in our DNA.</p><h3>Ye Olde Double Slit Experiment</h3><p>Touched on briefly in the last section, the “double slit experiment” is perhaps the most well known and over-discussed testable experiments in quantum physics — “Schrödinger’s cat” may be second but it’s not really testable. There are probably thousands of descriptions of the double slit experiment, and they are all the same, so a simple AI search will get you more than is worth providing here.</p><p>Richard Feynman said the experiment was the “only mystery” of quantum mechanics and that it was “impossible, absolutely impossible, to explain in any classical way”. You’d think somebody so smart would know better than to speak in such absolutes without at least some caveats about the limitations of human perception or cognition! Feynman came up with the “all paths” integral that states that a particle (in the double slit experiment for example) follows all possible paths from point A to point B, even a path that takes it to the end of the universe and back. When these paths are averaged together, instantaneously via observation (or, “measurement”), voila, reality appears.</p><p>“Many Worlds Theory” adherents would say the particle does take all possible paths, and each path splits and then gets its own universe with the particle on that path. When we observe the particle, we choose a universe, or it chooses our universe, or a universe chooses us, or something like that. Fundamental to all of these quantum reality ideas is the process of measurement “collapsing”, or “decohering” the quantum wonderland into reality.</p><p>Putting aside that any quantum physicist will confidently tell you that any theory other than quantum mechanics with probabilities (i.e., no hidden variables) has already been proven impossible so just go home and don’t even bring it up, could it really just be a particle we could never measure (even calling it a particle is a misnomer) that embodies the probabilities? Could it just be an unfathomably large number of unfathomably small <em>m-</em>particles executing brute force searches that match a goal currently being requested by the interface of ITP?</p><p>For example, the double slit experiment says a photon passing through the double slits acts as both a particle and a wave. When we see an interference pattern after the photons pass through the double slits, the photons are actually a wave. When we instead measure which slit the photon went through, we see no interference pattern, and thus the photon is a particle.</p><p>Perhaps the photon just rides along on an <em>m</em>-particle? The innumerable <em>m</em>-particles are exploring all possibilities using a brute force search or even something more sophisticated like cellular automata rules defined with imaginary (i.e., complex) numbers. The <em>m</em>-particles are governed by the ITP so they will reorient themselves around whatever is being measured by the “end user”.</p><p>Why does the double slit experiment look like a wave and a particle? Well, that’s quite compatible with us humans isn’t it? We have eyes, they see light, light’s a wave — and we can play baseball too so we know a thing about high speed particles. Waves and particles are pretty good desktop icons.</p><p>Is the <em>m</em>-particle interpretation of the double slit experiment really that much crazier sounding than the quantum philosophical alternatives? It’s an argument of crazy vs. crazy.</p><h3>What Is The Goal</h3><p>“Evolution everywhere” is a two word summary of Hazen &amp; Wong’s “Time’s Second Arrow”³. “Fitness Beats Truth” (FBT) is a key part of Hoffman’s treatise as well. Essentially, both argue that evolution — specifically survival of the fittest, specialization, and inheritance from an abstract perspective — govern far more than just organisms. Hazen and Wong describe a second arrow of time that is evolution obeying “a law of increasing functional information” even within non-living systems such as atoms and minerals. Hoffman’s FBT, as its name implies, says that we did not evolve to know the secrets of the universe (aka, “truth”) because that would serve no purpose in the goal of “fitness” and the ITP is the bridge between the truth and what we need to know to be human.</p><p>Both aforementioned ideas are quite compelling and offer a “goal” or “purpose” for a general forward direction in time without touching on metaphysical philosophy or religion. Ideas on those fronts are not presented here but it is acknowledged, considering the ITP, the sky is the limit on what is behind the interface so speculation and further research is left to the reader or sci-fi writer!</p><p>How would these evolutionary theories apply to our numerous <em>m</em>-particles? Evolution would be a metaheuristic that improves the funneling (i.e., optimizes the use) of <em>m</em>-particles towards a solution desired by the ITP to support FBT. The <em>m</em>-particles would grease the skids from the FBT to the ITP, so to speak, and would be the <em>implementation</em> of evolution in its smallest of contexts — atoms, particles, etc. Starting with brute force algorithms and evolving into algorithms that better optimize, but unfortunately also calcify, the use of <em>m</em>-particles.</p><p>Analogously, when we simulate evolution on a computer (e.g., genetic algorithms), we use a pseudo random number generator (PRNG) to simulate mutations or crossover points. As an aside, the random numbers that are produced by a PRNG are not random, they are reasonably random looking numbers produced by an algorithm. In fact, a sequence of them can easily be repeated by using the same “seed”. Regardless, the concept is identical to <em>m</em>-particles being used by nature itself and as quantum physics attests, the randomness the universe provides is truly random — or at least we haven’t figured out the algorithm behind it yet.</p><p>The exponential distributions that appear from independent brute force searches over time bend towards the solution potentially due to the law of increasing functional information — the median is a slight edge over the mean of the solutions. From this slight edge, evolution takes over and creates all sorts of improvements in the algorithms themselves. We’ve followed the exact same path in metaheuristics; there’s no reason to think nature wouldn’t too.</p><h3>Summary</h3><p>What good is any of this other than just food for thought or target for trolling? For this author it’s an exercise in convincing myself that a shift in focus is warranted in my own “quantum computing” research — and perhaps everyone’s. There’s always been a nagging “this ain’t right” feeling that only grew the deeper I dove into, particularly, quantum computing — and it’s not due to increased confusion, quite the opposite, increased clarity. And, I’m speaking not necessarily of quantum <em>physics </em>or <em>mechanics</em> generally, but quantum computing’s goal of controlling quantum weirdness at the lowest level — like we have any idea what that really is. The truth is, the more I study quantum <em>physics</em>, the less quantum <em>computing</em> makes sense.</p><p>In my studies I’ve also sought out hidden variables theories and research as I’m not a quantum physicist by trade and am thus completely open and entirely unafraid of these ideas. I’m in good company with Einstein in that respect as he didn’t think God played dice with the universe either. I tend to lean towards ideas from the following sampling of utterly brilliant minds:</p><ul><li>Stephen Wolfram’s “A New Kind of Science”⁹<strong><em> </em></strong>is essentially the bible on cellular automata. In it he takes on many aspects of science, including quantum mechanics, and shows how cellular automata may offer an insightful interpretation. Wolfram offers examples of simple cellular automata rules that create random looking behavior. This would amount to essentially a hidden variables argument to the underpinnings of randomness. Based upon his ideas, I was able to take a 2D CA rule, find a bias (subsection of output bits), and recreate something roughly similar to an exponential distribution. While it did reproduce median, mean, variance, and quartile calculations of an exponential distribution, it was not granular enough to really see clearly so has been left out of this article.</li><li>Gerard t’Hooft’s “The Cellular Automaton Interpretation (CAI) of Quantum Mechanics”<strong><em>⁸ </em></strong>is a much deeper mathematical dive than Wolfram’s into cellular automata rules that govern the underlying “stuff” that we end up seeing as quantum mechanics. In t’Hooft’s words, the CAI “tells us to return to classical logic and build models” that “describe the evolution of large sets of data, which eventually may bring about classical phenomena that we can observe.” Unfathomably large numbers of <em>m</em>-particles would definitely qualify as a “large set of data”!</li><li>Adam Forrest Kay’s “Escape From Shadow Physics”⁵<strong><em> </em></strong>was an inspirational book for me, and one of Kay’s inspirations was oil droplets bouncing on vibrating plates that demonstrate quantum mechanical properties. In addition to being an excellent history of quantum physics, it provides a heavy dose of realism to counter the quantum Kool-Aid. It is strange that we are in a place where realism is derided as “pseudoscience” however the “Many Worlds Theory” or entanglement, or any other quantum weirdness is accepted. I guess there’s a lot of momentum being fueled by money and reputations. There is no government grant program for “hidden variables” research — but there is for quantum bullsh*t².</li></ul><p>If you’ve gotten this far, hopefully at the very least some of the references provided in the end notes will give you an enjoyable reading list, and at best, you will have a healthy skepticism of the extraordinary amount of quantum hype out there. I think, at this moment at least, the future of quantum computing lies in hidden variables in just <em>this </em>universe. So, that’s where I’m headed.</p><h3>End Notes:</h3><ol><li>Exponential distribution (2026, June 20). <em>In Wikipedia</em>. <a href="https://en.wikipedia.org/wiki/Exponential_distribution">https://en.wikipedia.org/wiki/Exponential_distribution</a></li><li>Ferrie, C. (2023). <em>Quantum bullsh*t: How to ruin your life with advice from quantum physics</em>. Sourcebooks.</li><li>Hazen, R., Wong, M. (2026). <em>Time’s second arrow: Evolution, order, and a new law of nature.</em> W.W. Norton and Company.</li><li>Hoffman, D. (2019). <em>The case against reality: Why evolution hid the truth from our eyes.</em> W.W. Norton and Company.</li><li>Kay, A. F. (2024). <em>Escape from shadow physics: The quest to end the dark ages of quantum theory.</em> Basic Books, Hachette Book Group.</li><li>Padilla, A. (2022). <em>Fantastic numbers and where to find them: A journey to the edge of physics.</em> Farrar. Straus, and Giroux.</li><li>Susskind, L., Friedman, A. (2015). <em>Quantum mechanics: The theoretical minimum</em>. Basic Books, Hachette Book Group.</li><li>‘t Hooft, G. (2016). <em>The cellular automaton interpretation of quantum mechanics.</em> Springer.</li><li>Wolfram, S. (2002). <em>A new kind of science</em>. Wolfram Media, Inc.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=938aa2d8e387" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Room Temperature Quantum Computer with E Gates]]></title>
            <link>https://medium.com/@robert.rennie/a-room-temperature-quantum-computer-with-e-gates-545a78c5bc18?source=rss-c605544f44d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/545a78c5bc18</guid>
            <category><![CDATA[quantum-physics]]></category>
            <category><![CDATA[quantum-mechanics]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[quantum]]></category>
            <category><![CDATA[quantum-computer]]></category>
            <dc:creator><![CDATA[Rob Rennie]]></dc:creator>
            <pubDate>Sat, 22 Jul 2023 03:40:53 GMT</pubDate>
            <atom:updated>2023-07-23T18:15:30.788Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xsiZrSMQzS2pGKuE.jpg" /></figure><h4>Leveraging External Unobserved Quantum States within a Quantum Computing Circuit</h4><h4>Introduction</h4><p>This article demonstrates integrating externally generated unobserved quantum states within a quantum computer (QC) simulation running on a classical computer, arguably creating a “real” (for whatever that means) room-temperature quantum computer. This should be viewed as the implementation, or realization of a <em>thought experiment</em>, and the goal is to suggest an alternative understanding of quantum computing that focuses less on quantum bits (qubits) and more on quantum states as the fundamental unit in a quantum computer.</p><p>It is assumed the reader is familiar with quantum computing concepts as well as quantum circuit specifics. For example, superposition, qubits, state vectors and fundamental QC gates are all prerequisites to understanding the concepts discussed herein. In addition, the circuit samples presented can be run on a <a href="https://renniedatascience.com/QIDE">real-world quantum simulator</a>, right in your browser, so understanding JSON syntax (which defines the QC circuits) is also helpful.</p><h4>External Unobserved Quantum States</h4><p>First, we start with something that can create a true quantum state such as radioactive decay or splitting a beam of photons with a beam splitter. In both cases, unless someone (specifically, a consciousness) observes the process of a radioactive emission (e.g., watching with a Gieger counter) or detecting the photon’s destination, the system is in a state of superposition. The photon is in two places at once, and a radioactive ion was both emitted and not emitted within an expected median time period.</p><p>Next, we must create a method to transfer that state securely (without conscious observation) to something else that can use it to create <a href="https://en.wikipedia.org/wiki/Cat_state">a quantum superposition of two macroscopically distinct states</a>. This concept is described famously in <a href="https://en.wikipedia.org/wiki/Schr%C3%B6dinger%27s_cat">“Schrödinger’s Cat” thought experiment</a> where the quantum state of radioactive decay is transferred (or perhaps entangled) to the life or death of an actual cat.</p><p>An immediate question is, how do we know whether a given transferred state is observed or unobserved? For example, if we are using the quantum state source to generate random numbers (as we will in this case), then how do we know that some consciousness has not observed these numbers? The answer is to verify the source through experimentation, validating against a test such as the <a href="https://jcer.com/index.php/jcj/article/view/1057">Consciousness Causing Collapse (CCC) Test</a>.</p><p>For this implementation we will being using <a href="https://renniedatascience.com/RandomSeed">Rennie Data Science’s (RDS) Random Seed</a> service which provides not only guaranteed quantum-generated random numbers (i.e., no seed or algorithm) but also guarantees these numbers have not been observed by RDS personnel, or any other consciousnesses within their control. In addition, these numbers have been verified extensively using the aforementioned CCC test, as demonstrated <a href="https://renniedatascience.com/CCC">here</a>.</p><p>Once we have a source for such numbers (and quantum states) established, the next step is to figure out a way to integrate these states into a QC circuit simulator to create, for example, a simple Bell state. Two methods are proposed and discussed in this article:</p><ul><li>Using unobserved quantum random numbers in measurement gates to transfer the external state to the last step of the mathematical QC circuit creating a superposition of possible measurements.</li><li>Creating a new type of gate (or gates) that creates a superposition of qubit states within the QC circuit itself, initially, transferred from the external state.</li></ul><h4>External Quantum States in Measurement Gates</h4><p>When implementing measurement gates in a QC simulator, a random number is chosen to select a state from the state vector’s probabilities (i.e., the system’s wave equation). Generally speaking, this random number is algorithmically generated with no quantum mechanical properties. If instead, we were to use an unobserved quantum generated random number, then until a consciousness observes the measurement results, the entire system is in a state of superposition.</p><p>Shown next is an example of a circuit that does exactly what is proposed***.</p><pre>{<br>  &quot;qubit_count&quot; : 2,<br>  &quot;gates&quot;: [<br>    {<br>      &quot;gate_type&quot;: &quot;H&quot;,<br>      &quot;target_qubits&quot;: [0]<br>    },<br>    {<br>      &quot;gate_type&quot;: &quot;CNOT&quot;,<br>      &quot;control_qubits&quot;: [0],<br>      &quot;target_qubits&quot;: [1]<br>    },<br>    {<br>      &quot;gate_type&quot;: &quot;M&quot;,<br>      &quot;rand_source&quot;: &quot;RandomSeed&quot;,<br>      &quot;target_qubits&quot;: [0, 1]<br>    }    <br>  ]<br>}</pre><p><em>*** Note that all circuits presented in this article can be executed on </em><a href="https://renniedatascience.com/QIDE"><em>RDS’s QIDE (Quantum Integrated Development Environment)</em></a><em> where the simulator is connected to the RDS Random Seed service in real-time and thus actually running as a room-temperature quantum computer.</em></p><p>In the above example, notice the “rand_source” is set to “RandomSeed” — if this were omitted the default algorithmic random number generator would be used. The above circuit should be familiar to the reader as a simple Bell state circuit, and the results are what one would expect, either |00&gt; or |11&gt;:</p><pre>|00⟩     0.000000 +  0.000000 i  ==                          [ 0.000000 ]     --- [ 0.00000 rad ]<br>|01⟩     0.000000 +  0.000000 i  ==                          [ 0.000000 ]     --- [ 0.00000 rad ]<br>|10⟩     0.000000 +  0.000000 i  ==                          [ 0.000000 ]     --- [ 0.00000 rad ]<br>|11⟩     1.000000 +  0.000000 i  ==     ******************** [ 1.000000 ]     --- [ 0.00000 rad ]</pre><p>In summary, by using unobserved quantum generated random numbers within a QC simulator’s M gate implementation, all possible measurement results exist until a consciousness observes the system and views the final result.</p><h4>External Quantum States as qubit Gates (“E” Gates)</h4><p>A more interesting option to leverage unobserved quantum randomness and superposition is to create a new class of QC gate, hereby referred to as an “E” gate. Why “E”? Well, quite a few letters are already used by existing QC gates and E is a good reminder the state is <strong><em>e</em></strong>xternal and thus comes from <strong><em>e</em></strong>lsewhere.</p><p>So, what would an E gate do? If we started with a qubit and applied an E gate to it, we would like to see that qubit be in a superposition of 0 and 1 transferred by the external superposed state, much like when we use a mathematical Hadamard gate. Let’s define the most basic E gate as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/219/1*7wyKU8zpljhpUNPYtQU5lw.png" /><figcaption>E Gate</figcaption></figure><p>The E gate is not your typical quantum gate! A couple of things to notice:</p><ul><li>There are two matrices that can affect the targeted qubit and neither is unitary nor reversible. Despite quantum mechanics rules, this makes sense because we have not discovered a way to move backwards in time!</li><li>The “r” parameter is the unobserved quantum generated random number from 0.0 to 1.0. Therefore, this E gate as shown above creates an even superposition of 0 and 1 for the targeted qubit.</li></ul><p>What the E gate is saying is given an uninitialized qubit, or a qubit with a definite state of 1 or 0 (not already in some superposition via a mathematical gate), then either set it to 0 or 1 based upon the superposition of the external state. In this way, we are importing, or injecting (depending upon your perspective) the external state directly into the mathematics of the QC simulator. In fact, it is perfectly acceptable to follow E gates with standard QC gates such as R, or Y, or Z, or even H.</p><p>However, what is not acceptable is using standard mathematical QC gates <em>prior </em>to E gates! If the qubit is already in some mathematically superposed state, then the matrices used in E gates will result in an invalid state vector — specifically a state vector whose probabilities don’t all add up to 1. Therefore, following the execution of every E gate, the simulator must check to see if the state vector is still valid, and if not, error out.</p><p>Let’s create a Bell State with an E gate:</p><pre>{<br>  &quot;qubit_count&quot;: 2,<br>  &quot;gates&quot;: [<br>    {<br>      &quot;gate_type&quot;: &quot;E&quot;,<br>      &quot;rvalue&quot;: 3.14,<br>      &quot;target_qubits&quot;: [ 0 ]<br>    },<br>    {<br>      &quot;gate_type&quot;: &quot;CNOT&quot;,<br>      &quot;control_qubits&quot;: [ 0 ],<br>      &quot;target_qubits&quot;: [ 1 ]<br>    }<br>  ]<br>}</pre><p>Note that the H gate has been replaced by the E gate (we’ll define the “rvalue” shortly) and there is no measurement gate. However, when viewing the results, we see the familiar Bell State results:</p><pre>|00⟩     1.000000 +  0.000000 i  ==     ******************** [ 1.000000 ]     --- [ 0.00000 rad ]<br>|01⟩     0.000000 +  0.000000 i  ==                          [ 0.000000 ]     --- [ 0.00000 rad ]<br>|10⟩     0.000000 +  0.000000 i  ==                          [ 0.000000 ]     --- [ 0.00000 rad ]<br>|11⟩     0.000000 +  0.000000 i  ==                          [ 0.000000 ]     --- [ 0.00000 rad ]</pre><p>What is happening here, with a big “in theory” disclaimer, is the external state, which is in a state of superposition, is transferred to the first qubit and via the mathematical CNOT gate, is entangled with the second qubit. We have no measurement gate because the act of you (or some other consciousness) looking at the result collapses the wave equation of the external state.</p><p>Thus, you <em>are </em>the measurement gate.</p><h4>More E Gates</h4><p>As shown in the above E-gate Bell circuit, an “rvalue” parameter of 3.14 is specified. The rvalue parameter in an E gate allows one to specify what the “0.5” value is in the original E gate definition. Given a circle, Pi (~ 3.14) is halfway around the circle and thus represents 0.5 — yielding an even probability of the qubit being in a state of 0 or 1, just like a Hadamard gate. But for various applications, this probability setpoint may need to be adjusted. Thus, the rvalue parameter can be thought of in a similar manner to the angle parameter defined in mathematical R gates (which gives it the “rvalue” name).</p><p>Beyond adjusting the probability related to the superposition of 0 and 1 in a given qubit, what about the phase? To transfer the external superposition state to the phase of a qubit, we can create additional variations of E gates constructed in the same manner as the original E gate, but incorporating the mathematical definition of phase gates such as Y or Z. Following are additional E gates and their respective matrices (all of these gates are available to use in the <a href="https://renniedatascience.com/QIDE">RDS QIDE</a> simulator):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/170/1*sklhiXdOJlEjOF7jOTQeGA.png" /><figcaption>Ey Gate</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/165/1*KGxwx2cn8bMY5ybapgimCw.png" /><figcaption>Ez Gate</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/136/1*Hw9R3iqw8gEd2YCBW1AihA.png" /><figcaption>Es Gate</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/157/1*fUDh2FsCoK-MJKyz0ZHuyQ.png" /><figcaption>Eh Gate</figcaption></figure><h4>Conclusion</h4><p>The goal of this article was to describe and demonstrate a working implementation of a thought experiment — specifically the transfer (or extension) of a natural quantum state to a quantum computer circuit running in a quantum computer simulator on a classic computer. A devil&#39;s advocate would say “yes, you could do everything you just showed using any random number generator” and that is absolutely correct.</p><p>But, if the random number source is truly quantum, and the numbers are demonstrably unobserved, then it does lead one to wonder if perhaps Schrödinger&#39;s cat really is alive and dead, somehow, somewhere, and whether a mouse looking up at the sky created the universe (which was Einstein’s specific objection!). Now, what does one do with this? Can it be used to do anything productive or even do something better and faster than traditional computing?</p><p>Well, those are the same questions being asked of “real” quantum computers being built for billions of dollars. This one was much less expensive, and the answers are still the same.</p><p><em>Legal Notice: The author expressly prohibits the use of this article’s content in any form as training data for any large language model (LLM), generative AI, or other technology that subsumes and then represents this content as its own knowledge.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=545a78c5bc18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Interactive Introduction to Quantum Computing for Software Engineers]]></title>
            <link>https://medium.com/@robert.rennie/an-interactive-introduction-to-quantum-computing-for-software-engineers-18fb85d0eec?source=rss-c605544f44d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/18fb85d0eec</guid>
            <category><![CDATA[quantum-physics]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <dc:creator><![CDATA[Rob Rennie]]></dc:creator>
            <pubDate>Fri, 13 Jan 2023 00:34:22 GMT</pubDate>
            <atom:updated>2023-01-17T04:11:04.705Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This article is for software engineers (of which I count myself one) who have heard of quantum computing (QC) and perhaps even attempted to learn a bit more about it already. I originally wrote this for a fellow engineer in an attempt to provide a crash course in the basics of quantum computing from a pragmatic programmer perspective. In short, this is what I would have liked to have read first when starting my own QC learning several years ago. My hope is it might give you somewhat of an intuitive grasp of QC, and maybe even pique your interest to learn more.</p><p>There are a few terms from classical computing and mathematics that are helpful to have some knowledge of for this article. From the computing side, knowing what a bit is, having seen an electronic circuit drawing with gates, and understanding what JSON is (for the examples) are prerequisites. From mathematics, knowing what a matrix is and a complex number looks like (a number with real and imaginary components). Understanding computations with the aforementioned is not a requirement of this article but will be if you’d like to eventually dive deeper.</p><p>What is not required is an understanding of building quantum computers, electron spin, photons or double slit experiments, many-worlds theory, or any of the more exotic quantum physics mumbo jumbo that fuel much of today’s sci-fi films! QC stands on its own as an information theory discipline, and regardless of whether a significant sized quantum computer is ever built, the theory and even its present realization, is remarkable.</p><h3>The Venerable Qubit</h3><p>As engineers, we like to jump right in a start coding — so let’s do that and start with two “qubits”. What’s a qubit? For now, just think of a qubit as a classical bit — 0 or 1. In QC, we draw “circuit diagrams” to represent simple QC “programs” with each qubit on the left and horizontal lines going left to right representing the lifetime of the qubit, or the path the qubit follows, much like a classical circuit. In reality actual QC programs are coded in more traditional looking procedural code such as Q#, Qiskit in Python, or a JSON definition we’ll be using below. But all of this code still refers to (has functions) that come directly from these circuits.</p><p>Qubits always start out initialized to zero (what is called the “ground state” in QC parlance). This might sound like a trivial detail, but it is actually quite important. So, here is the simplest two-qubit circuit possible, with the qubits labeled q0 and q1:</p><figure><img alt="Two-qubit circuit initialized in ground state." src="https://cdn-images-1.medium.com/max/265/1*HOYkdcvRACgWd-hqLN9Exg.png" /></figure><p>Next let’s “run” this circuit in a QC simulator. For this article, we will be using a <a href="https://renniedatascience.com/QIDE">browser-based QC simulator</a> developed by <strong>Rennie Data Science</strong> (RDS) called <a href="https://renniedatascience.com/QIDE">QIDE</a>, or Quantum Integrated Development Environment. It is written in Rust and deployed as a WebAssembly, and is a full-fledged QC simulator with advanced memory and performance optimizations that compares it favorably to installed QC simulators.</p><p><a href="https://renniedatascience.com/QIDE">QIDE</a> accepts a simple JSON definition of a circuit as input. Following is the definition for our simple two-qubit circuit presented above:</p><pre>{<br>  &quot;qubit_count&quot; : 2,<br>  &quot;gates&quot;: [ ]<br>}</pre><p>Copy the above JSON and paste it into <a href="https://renniedatascience.com/QIDE">QIDE</a>. Also, be sure to click the “<strong>Bitstring</strong>” radio button (this makes the output easier to understand for now). Finally, click the “Run” button. This is what you should see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*lLWSrf9-MCxOQ9SZ8ntU9w.png" /></figure><p>Note that there are two outputs — a “Measurements” and “States” section. We haven’t made any measurements yet, so we are only concerned with the states. Here are the resulting states after running our first circuit:</p><pre>|00&gt; 1.000000 + 0.000000 i<br>|01&gt; 0.000000 + 0.000000 i<br>|10&gt; 0.000000 + 0.000000 i<br>|11&gt; 0.000000 + 0.000000 i</pre><p>So, what are these “states”? First, don’t worry about the funky notation with the | and &gt; symbols, this is called “bra-ket” notation — just focus on the 1’s and 0’s. How many different combinations can you make with two bits? Four. Thus, there are four rows in the states output showing all the combinations of two qubits. In QC, each one of these bit combinations is called a “state” — so there are four possible states here. Obviously, since we didn’t do anything to the qubits (i.e., change them in any way), they both remain in their ground state. If we were to ask, “what state is the system in”, there’s a 100% chance the system is in the |00&gt; state — thus the 1.0 next to that state. There’s no possibility the system could be in any of the other two-qubit states.</p><h4>Measuring Defined</h4><p>The four results shown in the output each show the probability that the system is currently in that state. This list of probabilities per state is called the “state vector” —thus the result state output you’re seeing is actually the state vector itself inside the theoretical quantum computer.</p><p>It is important to define “measuring” at this point. Above, I used the terms “chance” and “probability” when asking what the state of the overall system of qubits is. The act of actually finding out which of the states the system is in is formally called “measuring” in QC (and quantum physics for that matter) terminology. Until we measure a system, we don’t know which state it actually is in, we just know the probabilities of the states it <em>could be </em>in. Albeit in this simple example it’s pretty obvious what state the system would be in if we measured it!</p><p>In addition, measuring the system affects the system. In other words, once you measure which state the system is in, it’s in that state and no others. You can’t go back, nor can you periodically measure what state the system is in as it proceeds. This will become clearer later as we discover ways to put qubits into more than one state at the same time (superposition) and show how the act of measuring a qubit’s state makes its state “permanent” to a classical state.</p><h3><strong>Then There Were Gates</strong></h3><p>Next, qubit circuit lines have “gates” added to them — this is the heart of how QC programming is done. Gates can be thought of as analogs of classical circuit gates such as AND/OR/NAND, etc. However, QC gates are actually matrices (generally 2x2 matrices of complex numbers), and linear algebra is used to affect the states of qubits and thus the overall system. As promised, we are not going to dive into the actual mathematics in this article, but we will show the effects.</p><p>Let’s add a simple QC gate with the name “<strong>X</strong>” (the gate’s actual name is “<strong>X</strong>” — we’re not using a placeholder) which just flips a bit. Here’s our prior circuit diagram with the X gate added to qubit 0:</p><figure><img alt="Two-qubit system with X gate added to first qubit." src="https://cdn-images-1.medium.com/max/261/1*2kmhbIac-3sIU6MyWai7NQ.png" /></figure><p>Here’s the <a href="https://renniedatascience.com/QIDE">QIDE</a> JSON, paste this in and run it as we did with the first circuit:</p><pre>{<br>  &quot;qubit_count&quot; : 2,<br>  &quot;gates&quot;: [<br>    {<br>      &quot;gate_type&quot;: &quot;X&quot;,<br>      &quot;target_qubits&quot;: [0]<br>    }<br>  ]<br>}</pre><p>You should see the following state vector as a result:</p><pre>|00&gt; 0.000000 + 0.000000 i<br>|01&gt; 0.000000 + 0.000000 i<br>|10&gt; 1.000000 + 0.000000 i<br>|11&gt; 0.000000 + 0.000000 i</pre><p>Obviously, all we did was flip the first qubit so therefore we just made it 100% likely that the system is in state |10&gt;.</p><h4>Superposition</h4><p>Ok, easy so far, right? Now, let’s start getting into more quantum “stuff” and change the gate to an “<strong>H</strong>” gate, or the Hadamard gate. Arguably the most important gate. This gate puts a qubit into a “superposition” of 0 and 1 which can be thought to simply mean this bit will randomly (evenly) be 0 or 1 each time you run (and measure) the circuit. So, if you were implementing a QC simulator, for example, on each circuit execution you’d just randomly pick 0 or 1 for that bit. Here’s the circuit:</p><figure><img alt="Two-qubit circuit with an H gate added to the first qubit." src="https://cdn-images-1.medium.com/max/256/1*dw1-TNEugd9eWxPDaN3akg.png" /></figure><p>Here’s the <a href="https://renniedatascience.com/QIDE">QIDE</a> JSON for the above circuit, paste this in and run it as before:</p><pre>{<br>  &quot;qubit_count&quot; : 2,<br>  &quot;gates&quot;: [<br>    {<br>      &quot;gate_type&quot;: &quot;H&quot;,<br>      &quot;target_qubits&quot;: [0]<br>    }<br>  ]<br>}</pre><p>Following is the state vector you should now see:</p><pre>|00&gt; 0.707107 + 0.000000 i<br>|01&gt; 0.000000 + 0.000000 i<br>|10&gt; 0.707107 + 0.000000 i<br>|11&gt; 0.000000 + 0.000000 i</pre><p>Ok, this is getting a little more interesting! Now, we see states |00&gt; and |10&gt; as equally likely to be measured (we’ll get into why it’s 0.707107 in a moment). Since the first qubit could be a 0 or 1 depending upon randomness, and the second qubit is fixed at 0, then you will either see a |00&gt; or |10&gt; when you measure the system. If you run this circuit a thousand times, you should see a nearly even probability distribution: 500 or so times |00&gt; and (1000 minus that) times |10&gt;.</p><p>Now, what’s up with the 0.707107? If you add those two states together you get more than 100% (i.e., 1.4 or so) which seems like a bug. First, the probabilities next to each state are complex numbers (i.e., they have an imaginary component denoted with an “i”, and a real component. Second, in QC terminology, these are called “amplitudes” — not probabilities (yet). Since imaginary numbers don’t translate to probabilities you can use in real life, you have to square them to get rid of the imaginary part (actually a square of the absolute value but since we’re only looking at the real part, thinking of squaring is fine).</p><p>As it turns out, 0.707107 = 1/√2, and when squared becomes 1/2. Voilà, now you have your real-world probability — |00&gt; and |10&gt; each has a 0.707107² = 1/2 = 50% probability of being measured. You might be wondering where that 1/√2 came from in the first place — it came from the <strong>H </strong>gate. As mentioned earlier, QC gates are actually 2x2 matrices of complex numbers. This is the Hadamard gate, and there’s our 1/√2:</p><figure><img alt="Hadamard Gate" src="https://cdn-images-1.medium.com/max/193/1*p7p73TZBOTivRaucj2ibVw.png" /></figure><h3>Measurement</h3><p>Up to this point, we have been affecting the state of the overall system — in other words, affecting the probabilities of one state being measured vs. another. However, we haven’t actually measured anything yet. To measure the QC circuit, as you may have guessed, we use a measurement gate, or a “<strong>M</strong>” gate. Let’s add a measurement gate to our current circuit that measures both bits at once:</p><figure><img alt="A measurement gate added to our two-qubit system." src="https://cdn-images-1.medium.com/max/261/1*ZtUwIOQC6nBCEqhcF_0pXw.png" /></figure><p>Once again, here is the <a href="https://renniedatascience.com/QIDE">QIDE</a> JSON for this circuit with the newly added measurement gate which you can paste into <a href="https://renniedatascience.com/QIDE">QIDE</a> and run:</p><pre>{<br>  &quot;qubit_count&quot; : 2,<br>  &quot;gates&quot;: [<br>    {<br>      &quot;gate_type&quot;: &quot;H&quot;,<br>      &quot;target_qubits&quot;: [0]<br>    },<br>    {<br>      &quot;gate_type&quot;: &quot;M&quot;,<br>      &quot;target_qubits&quot;: [0, 1]<br>    }    <br>  ]<br>}</pre><p>You should see the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*9icLNOLA-HXw67mh99BYag.png" /></figure><p>Now, notice something appears in the “Measurements:” section and it is in fact a measurement of our two-qubit system. To prove the point, click “Run” again several more times and you should see it oscillate between the two states |00&gt; and |10&gt;. If you were to run this many times, you should see measurements yielding a nearly even distribution between these two states — and more importantly, never see any of the other states.</p><p>Also notice that the state vector changing by the act of measuring the system — in quantum mechanics you cannot measure a system without affecting it. What’s happening here is analogous to “observing and collapsing the wave equation” in quantum physics. Until we observe the system (squaring the absolute value of its amplitudes to get probabilities in the real world) it exists in this (subjectively) weird indeterminant state blob with pieces of it oozing into the imaginary world via imaginary numbers.</p><p>There are all sorts of interesting things you can do to these qubits with different gates by pushing around their amplitudes (and “entangling” them) in the exotic world of complex numbers and thus affecting the overall state vector which lives in n-dimensional Hilbert space (sorry for the name dropping). But ultimately, you have to pull them back into the real world and you end up with plain old probabilities of states which determines what state you actually measure in the end.</p><h3>Summary</h3><p>Nobody knows why this math (and these matrix “gates”) describes how real qubits actually behave, but based on experimentation, it just does. A common phrase you’ll see in QC is “shut up and do the math” because some of these concepts are impossible to intuit, and thus even harder to describe.</p><p>One thing that helps is what is called a <a href="https://renniedatascience.com/Bloch">Bloch Sphere</a>. While the Bloch Sphere is beyond the scope of this article (but along with entanglement, may be in another in the future), if you want to fool around more with this two-qubit model and better visualize what’s going on, and what all the different gates do, you can do so <a href="https://renniedatascience.com/Bloch">here</a>. Bloch created a method of visualizing complex numbers on a unit sphere. But again, always pay attention to the state vector more than thinking in qubits — this is the most important key.</p><p>So that’s it. I covered qubits, circuits, state vectors, amplitudes, gates, superposition and measurement — all terms that you can find in any formal text or paper if you’d like to drill down more. And, you now have a full-fledged QC emulator in <a href="https://renniedatascience.com/QIDE">QIDE</a> with no software to install!</p><p>If this article garners a positive response, perhaps another diving a bit deeper may be in order. Let me know what you think, and in the meantime, enjoy wandering in Hilbert space!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18fb85d0eec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cellular Automata and Driverless Cars]]></title>
            <link>https://medium.com/data-science/cellular-automata-and-driverless-cars-aa461ca14814?source=rss-c605544f44d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa461ca14814</guid>
            <category><![CDATA[driverless-cars]]></category>
            <category><![CDATA[cellular-automata]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Rob Rennie]]></dc:creator>
            <pubDate>Wed, 02 Jan 2019 22:49:00 GMT</pubDate>
            <atom:updated>2019-04-22T20:55:14.885Z</atom:updated>
            <content:encoded><![CDATA[<h4>Self organizing networks, IoT, Machine Learning, and Trains</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l-CatQb_4U624E7s8e99FA.png" /></figure><h4>Introduction</h4><p>This article started with a simple thought experiment: If all cars were driverless, will we need traffic lights?</p><p>And in this case I’m speaking of specifically driverless cars — as opposed to self-driving cars which still require a human at the wheel. Perhaps a semantic difference, but for the rest of this article they will be referred to as driverless cars.</p><p>It is clear from the man-years of effort and billions of dollars of R&amp;D being invested by every major technology and automobile manufacturer that the goal is ultimately to remove humans from the driving equation. So, when we do finally get there, a few perplexing questions come up:</p><ol><li>Won’t a system of 100% driverless cars essentially be a next-generation train (as in good ol’ locomotive type train) network? Albeit the tracks are now roads and trains are cars networked together in real-time.</li><li>What will happen to the sophisticated interim technologies such as machine learning and deep neural networks which were trained to drive at the level of humans (bad idea!) to interact with actual humans driving (i.e. during the “transition period” which still allows for human drivers)? Once all cars are driverless and networked, we won’t need all that — we’ll just need to make sure the cars stay on the track and don’t bump one another. So what are we doing?</li></ol><h4>Trains, the First Driverless Cars</h4><p>Let’s get in a time machine and jump back in time and imagine if instead of free wheeling cars, track-based transportation took off, and some sort of track technology formed what we now know as our local streets and subsequently, towns and cities. This easily could have happened — Disney envisioned the future of transportation as monorails. It may not have been an actual rail, it could have been a drive-by-wire technology as well. All of our streets could have been “laid” with simple wiring, or street paint could have had some electromagnetic quality. We’d have all the benefits that the self-driving car pundits are claiming — reduced accidents, better use of driver (now passenger) time, etc.</p><p>But, alas, that did not happen! And now we have out-of-control teenagers driving 100 mph while drinking a beer and texting their buddies. So, let’s get back in the time machine and move ahead in time, following the evolution of cars to 100% driverless (no humans driving at all) and imagine the technology that would be used or required (and perhaps more interestingly, what may not be used) to get there.</p><p>What if train hitches, the connectors that keep train cars from hitting one another and also keep them optimally spaced, were replaced with some sort of self organizing algorithm that ran within and among each and all driverless cars. Each car could communicate with all other cars in its vicinity and they could come to an organized consensus on how to proceed optimally. Each could act with a cellular automata inspired algorithm, for example, as will be described later. Today, we already have cars that “sense” when they’re too close to another car as well as even parallel park themselves. These can be viewed as an early version of these algorithms, providing a virtual replacement to train hitches.</p><p>Next, to augment these “computer senses” (which will be described in detail next) we see the ultimate fruition of the Internet of Things (IoT). The street is laid with technology that can be sensed, and everything involved in transport (people, obstacles, etc.) is also imbued with an IoT device that can be sensed.</p><h4>Computer Senses</h4><p>Computers don’t see like humans. It’s the biggest mistake in AI today. Isn’t it rather strange that we spend so much time getting computers to act like humans — to hear speech, to see faces — yet we don’t realize that these are not computer senses? Not to get too far out there into TRON or The Matrix territory, but computers don’t naturally sense like we do.</p><p>For example, when 5G is ubiquitous, a group of a dozen driverless cars approaching an intersection can instantaneously network with one another and determine how they can all navigate the intersection efficiently. A group of 12 humans cannot network each others’ thoughts in real time. Humans don’t have the WiFi “sense”, computers do.</p><p>So, in this one simple example, a natural computer “sense” — namely the ability to “see” other computers on a network and exchange algorithmic data instantly is vastly more useful in a driverless car scenario then a neural network that has been trained to recognize objects. We are so focused on replacing humans with machines with human senses, that we don’t realize machines have their own vastly superior yet different senses.</p><p>What this means in the world of driverless cars is that everything must have a digital representation if it is to be “seen” by a driverless car. Instead of teaching a neural net to recognize a person walking across the street, that person must have some device that allows the driverless car to see them using their computer senses.</p><p>Sound crazy? Well, dogs already have chips embedded in them and nearly every human on the planet has a smartphone in their pockets (or on our wrists). We’re almost already there. Wearables, implantables, they are all in our future. What we are doing is creating digital representations of ourselves so computers can see us.</p><h4>Let’s Start With Ants</h4><p>Have you ever looked at traffic from above in real-time? Maybe from a traffic helicopter shot on the local news or from an airplane when you’re about to land. Each little car looks a lot like an ant and the whole system looks a lot like something you’d see from a macroscopic level in nature. You don’t notice each individual car, or ant, but as a whole they move with fluid dynamics. The fact that a car is being driven by perhaps the most intelligent of beings in the universe is completely lost as from above, it just appears to be a molecule of water flowing in a stream. A completely dumb molecule. (Granted, some drivers appear this way close up too).</p><p>There are number of ironies here:</p><ol><li>First, the machine learning of today cannot accurately reproduce an ant brain — yet we’re starting with reproducing human brains to drive our cars? How about we get ant simulation right first?</li><li>Ants have different senses than humans. Maybe we can’t simulate ants because we aren’t simulating their senses.</li><li>Why are we spending so much time and effort to recreate an intelligent being driving in one car when we can easily reproduce the macroscopic characteristics of traffic flow from above, and have been able to do so with traditional algorithms for years?</li><li>By the way, why are we training neural networks to drive like humans when humans suck at driving?</li></ol><h4>Cellular Automata</h4><p>A full history of cellular automata, or cellular automation (CA), is beyond the scope of this article but some brief elements of its past will be discussed. In addition, the computer simulation that was built in support of this article does not use a traditional CA rule or grid, but does borrow the basic concepts of CA.</p><p>The basic idea of CA is to create a grid (traditionally 1 or 2 dimensions) of cells wherein each cell can either be “on” or “off”. There is a rule that each cell uses to determine whether it should be on or off — such as “I am off when I have more than 3 neighbor cells on otherwise I’m on”. The CA algorithm is run in iterations (i.e. generations) and cells turn on and off according to the rule.</p><p>When humans view the output of these algorithms, our mind’s eye sees organic behavior — it looks like nature, like the view of traffic from the helicopter. We know it’s not actually organic behavior, its a computer simulation, but our brains see it as organic. The most referred to example of CA is Conway’s “Game of Life” which is described and demonstrated sufficiently in this <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Wikipedia article</a>. A quick look at this example and you will see the organic nature of its output. <em>While the rule governing the life of a cell (whether it’s on or off) is exceedingly simple, the resulting behavior is utterly complex that would be nearly impossible to code any other way.</em></p><p>Stephen Wolfram wrote a tome on the subject in 2002 in a book boldly entitled “A New Kind of Science” (see References). In its 1,197 pages, Wolfram analyzes numerous rules and their resulting output over many iterations. He proposes and the implements a new science which focuses on the emergent behavior of a system of CA leveraging simple rules. A new kind of science that studies the complex that remarkably emerges from the simple.</p><h4>The Next (or Real) AI — Artificial Life</h4><p>Artificial Intelligence must progress beyond simply attempting to act human. With enough vector matching, which is really all neural networks are, we will be able to recognize every face on the planet. This is not intelligence — for a given human cannot recognize every face on the planet. This is simply massive regression algorithms at work.</p><p>In Erwin Schrodinger’s famous book “What is Life”, he discusses why things are “big” yet built of really tiny other things like atoms. More importantly, why randomness at the tiny level (e.g. Brownian motion) begets “big” things that appear to be relatively stable. (Spoiler alert, that’s why things are big, to create macroscopic stability from microscopic instability.)</p><p>Our brains are a collection of 100 billion neurons each acting more like a CA algorithm than an machine learning algorithm. Somehow, the brain manages to harness this mass of tiny elements into a coherent whole — a set of small things that begets a “big” intelligence.</p><p>One could also argue that machine learning algorithms are similar to CA in that they are defined at the simulated “neuron” level along with simulated layers such as in a backward error propagation algorithm (or other gradient descent algorithm). However, there’s an overarching controlling algorithm that is generally not parallel, and is actually focused on simple vector matching, not harnessing unexpected emergent behavior.</p><p>Artificial life would be accomplished by reproducing something that from above, looks organic. In this way, Conway’s “Game of Life” is vastly more life-like than a neural network. CA’s are also massively parallel algorithms and are vastly simpler from a computational perspective than machine learning. Artificial life would put Artificial Intelligence in its proper place — namely in translating human senses into computer senses more accurately during the transition period to 100% driverless cars.</p><h4>The Code Sample</h4><p>A simple software simulation accompanies this article (<a href="https://github.com/robrennie/auto-car">download here from GitHub</a>) to put a little concreteness around the concepts presented herein. <strong>A screenshot of the program’s output is shown at the beginning of this article.</strong></p><p>The goal of the simulation is simple:</p><ol><li>Simulate a system of cars moving in all directions through a grid of streets and intersections.</li><li>Give each car a simple rule that governs its movement in relationship to other cars.</li><li>Cars can talk to one another, but there’s no overarching algorithm controlling their movement.</li><li>Make sure no cars crash into one another.</li><li>Make sure nothing gets “stuck”.</li></ol><p>In short, this simulation is the result of the original question posed at the start of the article: “If all cars were driverless, would we need traffic lights”? <strong>The simulation demonstrates the answer is clearly, no.</strong></p><p>When the project is run, and the “Start” button is clicked, cars begin appearing at the edges of the grid. As time goes by, more cars appear and all must negotiate with one another not to crash, especially at intersections. After watching for a few seconds, one sees the organic nature of the behavior of the cars, similar to when one looks at the “Game of Life”.</p><p>Even more interesting, when various rules for these cars were attempted, things got stuck, a lot. It was very easy to create a situation where four cars would come to an intersection at the same time and just get stuck because their rules created a stalemate. In fact “Car1” in the source code is just such a simple car. Its rule was “if the next cell in my direction is clear, take it”. As simple as this rule is, it does work relatively well with few cars on the road.</p><p>“Car4” however works as desired (Car2 and Car3 were failed attempts not worth including). Cars do not get stuck and the model runs forever, showing its organic emergent behavior side. Its rule is slightly more complex, but the key was creating the concept of courteousness — where every so often (randomly), a car that could go through an intersection decides to wait and generously let others through.</p><p><strong>The “courteousness” factor is an algorithmic life lesson!</strong></p><h4>Summary</h4><p>When viewing the simulation provided in this article, it is interesting to consider that simple rules applied to independent cars that work together as a group creates artificial life that rivals what can be done today with the most sophisticated algorithms and billions of dollars of research into driverless cars — that still don’t work. <em>This bears repeating, a simple model that took no more than a few days to put together already rivals the most complex self-driving cars’ AI, when viewed from above.</em></p><p>It may be hard to imagine how we would “lay the tracks” of the future for all driverless cars and how all entities that must be “seen” by a driverless car must have some digital representation compatible with a computer’s senses. But with IoT, smartphones, watches, wearables, etc. we’re already on exactly such a path. At the very least, self-driving cars in the interim will need a redundancy mechanism (currently a human driver who takes control when the neural net goes sideways) for the foreseeable future. Maybe we should be laying some track now to provide just such redundancy for the future of 100% driverless cars, or trains as they used to be called.</p><h4>Code Details:</h4><p>The code is a React.js project, for no other reason than it makes it simple to do user interface (UI) updates in a Web browser so focus can be spent on the algorithms as opposed to writing UI code. To install and use, simply install Node.js, git pull the <a href="https://github.com/robrennie/auto-car">auto-car repository</a>, and then run ‘npm install’ and then ‘npm start’ from a command prompt in the auto-car project directory.</p><ul><li>/src: Contains boilerplate React.js scaffolding.</li><li>/src/components: Contains the user interface control (JSX) which renders the grid and cars.</li><li>/src/modules/AutoSimModel.js: Houses the actual grid. The next() method runs a generation.</li><li>/src/modules/cars: This directory contains the car objects (and their base class). Note that Car4 is the one that works best as it has some altruistic characteristics. Car1 creates cars that get stuck quite quickly when cars are added rapidly, but still works ok if cars are added slowly.</li></ul><h4>References/Bibliography:</h4><ul><li>Conway, J.H. (1970). <em>Game of Life.</em> Retrieved from <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life</a></li><li>Schrödinger, E., &amp; Penrose, R. (1992). <em>What is Life?: With Mind and Matter and Autobiographical Sketches</em> (Canto). Cambridge: Cambridge University Press. doi:10.1017/CBO9781139644129</li><li>Wolfram, Stephen. (2002). <em>A New Kind of Science</em>. Wolfram Research. Champaign, IL.</li><li>Xianjuan Kong. (2007). <em>Research on Modelling and Characteristics Analysis of Traffic Flow Based on Cellular Automaton</em>. Beijing Jiaotong University, 2007.</li></ul><h4>Updates:</h4><p>I’m adding this section to capture relevant news articles or other updates related to and/or supporting the topics discussed herein to keep this article more of a “living” document.</p><ul><li><strong>April 22, 2019</strong>: I was just sent an article describing something called “V2X”. (see <a href="https://en.wikipedia.org/wiki/Vehicle-to-everything">https://en.wikipedia.org/wiki/Vehicle-to-everything</a>). I really wished I had come across this when first writing the article. This technology matches up exactly with my thoughts on how computers see like computers, not like humans, and how all things must be wired (even pedestrians and cyclists). Always nice to know other minds are not so crazy too, or perhaps just as!</li><li><strong>January 5, 2019:</strong> A Wall Street Journal article titled <em>“The Grocery Robot Is Here”</em> appeared in today’s issue and discusses autonomous vehicles being tested to deliver groceries. Two key quotes are “unless cities create special lanes for self-driving wagons, they might become a hassle for pedestrians”. Special lanes? Sounds a lot like a “track” no? Also, “almost all of these robots need minders of one sort or another”. <a href="https://www.wsj.com/articles/why-your-ice-cream-will-ride-in-a-self-driving-car-before-you-do-11546664589">Here’s the article.</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa461ca14814" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/cellular-automata-and-driverless-cars-aa461ca14814">Cellular Automata and Driverless Cars</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Where is the American Firewall?]]></title>
            <link>https://medium.com/@robert.rennie/where-is-the-american-firewall-f75bfaf91908?source=rss-c605544f44d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f75bfaf91908</guid>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Rob Rennie]]></dc:creator>
            <pubDate>Thu, 15 Nov 2018 23:56:39 GMT</pubDate>
            <atom:updated>2019-01-04T23:01:02.141Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*awb3Q3ZO8xqoB59Ej1s1HQ.jpeg" /></figure><h4>Why does the U.S. Government Refuse to Protect its Citizens?</h4><p>I just sat through yet another Department of Homeland Security (DHS) presentation describing all the “resources” they have to offer businesses to protect themselves from cyber threats. Unfortunately, this DHS representative was more on the physical security side (as opposed to cyber) so I missed my chance to ask the man directly…</p><p><strong>Why does the U.S. government not have a U.S. firewall for its citizens and businesses?</strong> Why does the U.S. government do absolutely nothing to protect the digital assets of its country? Weird isn’t it? Almost inexplicable.</p><p>Thus, this article is about something that has perplexed me ever since I started building business applications accessed over the Internet nearly 20 years ago.</p><h3>The Current U.S. Government Approach: Militias</h3><p>Let’s start with a simple analogy to the military. The U.S. government does have a military that is responsible for protecting citizens from nefarious nation states who aim to cause harm to its citizens. If China starts bombing somewhere in the U.S., the military will quickly jump into action to stop the bombing and almost definitely retaliate.</p><p>So what happens if the “bombs” are malware to either gain potential control of our infrastructure, steal our trade secrets, or otherwise extract something they need from us? Well, then it’s the target’s responsibility. If a company is hacked by a state-sponsored actor in China, it is the company’s fault and the fact the U.S. government did nothing to protect them is somehow just accepted today.</p><p>Following the military analogy, this is the same as if the U.S. government said “we’re going to disband our centralized military and instead each individual municipality will need to create their own militia and we can advise them on the best way to do that”. So, if China were to bomb, say Philadelphia, then the militia in the subsection of Philly that was hit is responsible for responding?</p><p>This is absolutely insane, no? Why on earth would the U.S government delegate its singularly most important responsibility of protecting citizens to random organizations within the country? <em>Why doesn’t the U.S. government do anything</em>?</p><h3><strong>How about a U.S. Firewall?</strong></h3><p>So, given the fact that nearly every other country (whether we like them or not) is buying American-built technology to create their own country-wide firewalls, why don’t we build one for the U.S.? We build a firewall, and anyone from outside the U.S. who wants through it has to register with a Federal agency. Maybe we have partnerships with other countries such as the UK who would be required to adhere to certain vetting requirements and bridge the two firewalls.</p><p>Part of the DHS presentation I just watched showed a real-time video of number of cyber attacks per second with their source and destination shown as lines like from the old video game “Missile Command”. You only need to look at one of these to see the obvious — everyone is attacking the U.S. Why? Because we have no government protection, no government retaliation, and security is up to individuals — it’s like the Wild West.</p><p>Furthermore, if we are so good at displaying these cool real-time videos of the U.S. being attacked, why can’t we just stop those packets? I appreciate the cool video thank you very much, but it’s not “neat” to me — I’m just thinking, “where the hell is the government?”</p><p>The speaker said the one country that “keeps him up at night” is China (not particularly Russia by the way). Among many reasons, they are attacking us so they can:</p><ol><li>Make sure they can control our infrastructure in the event of a combined military and cyber attack.</li><li>Steal trade secrets from companies they wish to emulate in companies within China. (See “Made in China 2025”).</li><li>Support criminal activities as this adds to the knowledge base of the state when it comes to vulnerabilities and threat vectors.</li></ol><p>So, since the U.S. government knows this, and you (and they) can easily pull up a Web site to view this activity in graphical real-time, <em>why doesn’t the U.S. government do anything?</em></p><h3>What about the “openness”? Ha!</h3><p>The openness argument is a non-starter. If you want to argue about how the openness of the U.S. Internet has created world peace and harmony I suggest you look at the real-time cyber-attack graphic one more time. The only thing the openness of the U.S. Internet has done is created a worldwide criminality campaign, targeted at our hapless infrastructure. <em>This is what the “open” Internet has gotten us.</em></p><p>Part of today’s presentation predicted that cyber crime will overtake drug crime if it has not already. Why wouldn’t it? You won’t be put in prison for life for attacking someone’s computer system from another country. <em>This is what the “open” Internet has gotten us.</em></p><p>Furthermore, if you’ve ever tried to build a Web site or sell a Web service in China, or, for example, had to adhere to the GDPR guidelines of doing business in the EU, you’d quickly realize that there is no “openness” of the Internet anymore. Whether by regulation (GDPR) or by technology (Great firewall of China), the Internet is already becoming balkanized. It’s just the U.S. that’s too stupid to get in front of the trend and start protecting their citizens.</p><h3>What it’ll Take</h3><p>In speaking with colleagues about this, everyone pretty much comes to the same sad conclusion. “It’ll take a 9/11 type cyber event before this’ll happen”. In other words, it’ll take a cyber catastrophe to get the U.S. government to actually start protecting citizens like it should. I’m hopeful that it will not.</p><p>What I think it will take is for businesses to demand of government to protect them, exactly the same way as they would from bombs. Businesses are not to blame because a zero-day exploit was released and attacked them from China. The government is to blame because they didn’t stop it coming from a known bad IP address in China. The mindset has got to change to blaming the U.S. government, not its people.</p><p>In fact, how about a new law (that is one thing we know government is good at) that states that <em>if any U.S. company is hacked by any company outside the U.S., then that company is not held liable</em>. Can you imagine that? That is how much the mindset has to change. A business that is bombed by China in Philly is not liable, nor should a business that is hacked from China. It’s the U.S. government’s fault for not stopping it.</p><p>I hope this generates a lot of comments, I’d really like to hear what is so wrong with the idea of a U.S. firewall. Maybe there’s just too much money in the selling of firewalls to individual organizations, like selling guns to militias. What would happen to all the firewall vendors if there was the Great American Firewall? Maybe that’s why <em>the U.S. government doesn’t do anything.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f75bfaf91908" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RPA is not Screen Scraping]]></title>
            <link>https://medium.com/@robert.rennie/rpa-is-not-screen-scraping-7596b3c5a975?source=rss-c605544f44d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7596b3c5a975</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[process-automation]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Rob Rennie]]></dc:creator>
            <pubDate>Wed, 29 Aug 2018 18:15:35 GMT</pubDate>
            <atom:updated>2019-01-04T23:04:07.108Z</atom:updated>
            <content:encoded><![CDATA[<h4>A failed technology is shamelessly being regurgitated as something new.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ex7ufAmJyMUv4iKFT-lfhw.jpeg" /></figure><p>Three letter acronyms (TLAs) are part and parcel of the computer software industry and dozens come and go on a yearly basis. A recent one in particular is Robotic Process Automation, or RPA. If you do a quick search on robotic process automation, you will see ads from everyone from legacy BPM (business process management) and document capture vendors, to regurgitated QA testing tools called screen scrapers.</p><p>Worse yet, arguably reliable sources such as Wikipedia or for-pay “analysts” provide no clarification. Wikipedia’s definition is singularly focused on screen scrapers and misstates the place of APIs, while also describing the effects of RPA which are far beyond what screen scrapers could ever provide. For-pay “analysts” have magic quadrants containing anyone who paid them enough to be included — the actual software types are all over the map.</p><h4>So what is RPA?</h4><p>From the start, let’s agree that all software is a robot and all robots (their brains at least) are software. Therefore RPA could probably be left in the TLA dustbin of history, but instead let me at least explain what I believe it is, as my company adopted the term a couple years ago when it first appeared, and was defined much more accurately in my opinion. (I will not name my company or those of other RPA vendors as this is not a plug).</p><p>RPA, when it first was coined a couple years ago (and I admit I can’t find the original article where I found it) in my interpretation meant using new or advancing artificial intelligence (AI) techniques combined with new programming paradigms to automate labor intensive business processes. It was <strong>new-new</strong>. Examples of new or advancing AI techniques include machine learning, natural language processing, machine vision, and other statistical analysis techniques. Examples of new programming paradigms include, for example, the preponderance of REST APIs now available and easily accessible from the client.</p><p>So, RPA would seem to me to be new software brains working in concert with new application service layer technologies. Right?</p><h4>The “OMG, They’re Screen Scraping” Moment</h4><p>After going merrily on my company’s way for a couple years with the RPA term, I happened upon a public video of a “competitor” RPA demo on YouTube. Much to my (literal) horror, I saw a demo of a technology that had already been proven utterly ineffective in the 1990’s (or perhaps earlier).</p><p>Around the turn of the century, I was working as a programmer at a software company providing document management software in the form of a Windows desktop application. It was a typical Win32 application, with menus and lots (lots!) of dialog boxes, toolbars, etc. It did not have unit tests nor was there any API — not unusual in those days.</p><p>It was here where I first encountered a “UI test tool” — which is a software program written to act like a user and “click” buttons on another software program. A “robot” user if you will. Sound nice right? Cool!</p><p>The problem is it didn’t work. Didn’t work then, and still doesn’t work now, 20 years later, despite a crop of new engineers thinking this is some new idea, and (very!) old legacy vendors putting lipstick on their stable of pigs.</p><p>Why didn’t it work? Well, there was one guy in the QA department who managed the UI test tool process. While the tool could record a user clicking dialog box fields or toolbar buttons (sounds like the current RPA tools claiming to “watch and learn” from user interactions huh?) it would ultimately generate a script — a program — that was then “run” to perform the testing. Frighteningly, the current screen scraping RPA tools do this as well. <em>They automate users into creating programs.</em></p><p>Every time development did a new release of software, the giant UI test script would break. Note that there was nothing wrong with the new release, perhaps just a label on a dialog box was renamed. But, on some releases, more time was spent simply making the test script work again than any productive testing of the actual release! The release was actually held up in QA because the test script wouldn’t run.</p><h4>Screen Scraping is the Worst Possible Method of Integration</h4><p>If screen scraping were such a great idea, and if it were excellent at connecting systems together, then why is there today such a push for APIs? Why do all modern JavaScript UI frameworks have built-in unit testing?</p><p>From my experience (and perhaps everyone’s experience) with UI automation techniques, be they OCR’ing screen sections or control tree interrogation, screen scraping is the worst imaginable method of integrating anything — even worse than not integrating at all. Furthermore, security constraints and related technologies are advancing counter to screen scraping technologies. Screen scraping gets around authentication, let’s just be honest about that. That’s why users sometimes have to install browser plug-ins to be able to interrogate secure Web pages. Screen scrapers work like keyloggers or other malware basically.</p><p>Not to mention it is perhaps the most brittle integration technology in existence. Any change in the underlying technology stack — from OS to Web browser to the actual application — will break the integration. The UI test tool I mentioned earlier broke entirely when applied to Windows NT because of the enhanced process security.</p><p>Finally, a little thought experiment: Imagine doing a data import into your new accounting system where you want to bring over 100,000 customer records from the old accounting system. Does anyone really believe a user could build a screen automation script between two 3rd party applications to do that? Nonsense!</p><h4>Who’s the robot?</h4><p>Requiring users to create unreliable scripts to link application user interfaces together is not progress. Requiring users to create a template for every document, form or screen from which they wish to extract information is not progress. <em>Robotic Process Automation is not about turning users into robots to serve the application.</em></p><p>Let’s circle back to the original fair definition of RPA: Using new or advancing AI techniques that leverage new or advancing programming paradigms to automate labor intensive tasks. RPA is not, I would argue, a broken screen scraping technology from the 90s that automates users into writing programs. Nor is it user-created templates that define every variation of input for “automated extraction”.</p><p>After all, the robots on the automobile factory assembly line don’t need the same lights that humans do because they don’t have the same “eyes”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7596b3c5a975" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>