<?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 Venkatraman Srikanth on Medium]]></title>
        <description><![CDATA[Stories by Venkatraman Srikanth on Medium]]></description>
        <link>https://medium.com/@venkat24?source=rss-ebaea1e8d600------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*F5N_qkyKyYMX0dzqg9bS4w.jpeg</url>
            <title>Stories by Venkatraman Srikanth on Medium</title>
            <link>https://medium.com/@venkat24?source=rss-ebaea1e8d600------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 01:09:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@venkat24/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[Mapping to the Moon]]></title>
            <link>https://medium.com/nakshatra/mapping-to-the-moon-94bc55a19847?source=rss-ebaea1e8d600------2</link>
            <guid isPermaLink="false">https://medium.com/p/94bc55a19847</guid>
            <category><![CDATA[moon]]></category>
            <category><![CDATA[instrumentation]]></category>
            <category><![CDATA[apollo-11]]></category>
            <category><![CDATA[space]]></category>
            <dc:creator><![CDATA[Venkatraman Srikanth]]></dc:creator>
            <pubDate>Sat, 09 Jun 2018 14:13:19 GMT</pubDate>
            <atom:updated>2019-07-17T17:05:46.580Z</atom:updated>
            <content:encoded><![CDATA[<h4>How Apollo Found its Way</h4><p>The moon landings are undeniably an orgasmic piece of history to any space geek, and objectively one of the most remarkable achievements of mankind. The legacy of the likes of Armstrong and Buzz Aldrin will forever live on, but the groundbreaking engineering innovations behind the Apollo missions are often overseen. Some entire fields of science and engineering came into being to make this program a reality, and made way for generations of invention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*ocLBe3TbxxS1ZvShpda_hQ.jpeg" /><figcaption>The Apollo Spacecraft</figcaption></figure><p>One particular aspect of Apollo that I’ve always wondered about is the part where they actually <em>get</em> to the moon, and some critical components in this process are the navigation instruments. In space, there’s no magnetic field to use a compass. No gravity to tell which way is up, even. This was just about the time when a technique called <em>inertial guidance</em> was gaining traction.</p><h4>Inertial Guidance</h4><p>Inertial guidance is a wonderful tool which is found everywhere today as a navigational aid — in ships, planes, spacecraft and more — but the system wasn’t always designed with such intentions in mind. It was invented by American pioneer Robert Goddard as a way to guide missiles with never-before seen levels of accuracy. Eventually however, it was recognized as a powerful instrument for driving the future of space travel. The guidance system on Apollo (called the Inertial Measurement Unit) was developed completely in the MIT Instrumentation Lab, along with the flight computer.</p><p>Inertial guidance typically uses a system of <em>gyroscopes</em> and <em>accelerometers</em>. A gyroscope is just a wheel or a disk that spins, and is suspended freely. Hence, due to conservation of angular momentum, the orientation of the disk is not affected by a change in the surrounding environment! This makes it vary suitable as a means to maintain a static reference point as your own orientation changes.</p><p>The gyroscope is usually suspended inside concentric circular rings, each of which track a different axis of rotation of the spacecraft. The rings, which are called <em>gimbals</em>, can then be used to tell attitude, or direction the spacecraft is pointing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*Jy-QNB966e2AxmNCwE9Q7g.gif" /><figcaption>A Gyroscope with three Gimbals</figcaption></figure><p>Accelerometers, also called motion sensors, were also mounted to the inner gyroscope core, so that the acceleration or movement in any direction could also be detected.</p><p>With knowledge of where the mission started, and how the spacecraft moves at every instant, spacecraft’s flight computer could rather accurately determine where it was a given time. This is called <em>dead reckoning</em>.</p><h4>The Problem</h4><p>There’s one big problem when it comes to using inertial guidance and gimbals, something that may not initially be apparent. Since the gimbals are free to spin about the each axes, what happens when two axes come into alignment? If they do, they can no longer independently maintain rotational freedom. They’ll always rotate together, meaning you will now lose information about one entire axis! This unfortunate situation is called gimbal lock. Astronauts had to be very careful not to put themselves in the circumstance, and the flight computer would screech alarms when they were getting close to losing a gimbal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*QzNu6a1oVvftWTtTlMRNQw.gif" /><figcaption>A gimbal locked airplane — Rotational freedom along one axis is lost</figcaption></figure><p>Now when you hear the words “Gimbal lock!” being shouted on that scene in Apollo 13, you know what it means!</p><p>One possible way to solve gimbal lock is to include a fourth gimbal, one that is actively driven to be aligned 90 degrees from the direction of the first. Now, even when two axes come into alignment, you have an extra axis to continue giving you a reference point to automatically correct the misbehaving gimbal.</p><p>At this juncture, we must keep in mind the conditions on-board the Apollo spacecraft. Minimizing the overall weight was of utmost importance, and every kilogram was expensive. Hence, the project leads made a very controversial decision — to include only three gimbals instead of four.</p><h4>The Solution</h4><p>The problem of gimbal lock made it impossible to rely only on dead reckoning to determine the spacecraft’s state. NASA needed a more reliable way of updating the position, and hence came the Deep Space Network. The DSN is a number of large antennas spread over different countries across the planet, such that there’s always at least three of them on any one side of the Earth. It’s large, 70-meter antennas were developed for unmanned deep-space missions. Together, they can effectively triangulate the position of the spacecraft and transmit that to the flight computer! Eventually, NASA decided to use the DSN as the primary means of determining the spacecraft’s position. The on-board inertial guidance system was still important, as it gave the astronauts a real time indication of their attitude.</p><p>However, a mission of such magnitude required a lot of redundancy, and there were still some problems with using just the DSN. For one, the system wouldn’t work on the dark side of the moon, where radio communication wouldn’t be possible with the Moon in the way. Hence, <em>yet another</em> system was added to aid navigation, a system used by ancient voyagers to calculate their heading — the <em>stars</em>! The spacecraft was equipped with a sextant, which can accurately measure angles, and the astronauts were trained to identify specific stars, using which they could re-calibrate the gimbals if all else failed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*xiG8SO0lEwnQIQ2l7JJUOA.png" /><figcaption>Jim Lovell using the sextant for star alignment on Apollo 8</figcaption></figure><p>In fact, astronauts regularly used the star alignment method to re-calibrate the gimbals, and also simply as an exercise to check if the flight computer was giving them the correct readings. Such an alignment typically took about an hour, and was a pretty tedious process for the spacemen. The calibration program on the flight computer would show the error between the coordinates that the astronaut got and the actual values it measured, and displayed them on the screen. If the astronaut got it perfectly, the system would show 0 0 0 0 0, indicating no error, and was also called &quot;All Balls&quot;!</p><h4>The Test</h4><p>The Deep Space Network performed excellently, and would become the standard for NASA missions for generations to come. Even other countries’ missions (Like India’s Mangalyaan for example) use the DSN.</p><p>Gimbal lock still caused problems, and occurred <em>thrice</em> over the 10 missions that went out to the moon. Despite that, the inclusion of redundant systems and the ingenuity of the Apollo Guidance Computer meant that it never posed a serious threat to mission safety. The stars would be there to save the day!</p><h4>A Way for the Future</h4><p>Over the years, guidance systems have improved immensely in capability and yet, even modern spacecraft still conceptually the same inertial guidance units for navigation. The Apollo missions pioneered several technologies that were still in their infancy, and truly inspired a leap for the world technology and engineering.</p><p>If you’d like to read more, I wrote an article about the Apollo Guidance Computer over on the Delta Force blog. Do check it out!</p><p><a href="https://medium.com/delta-force/the-magic-behind-apollo-cf89aede34d4">The Magic behind Apollo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94bc55a19847" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nakshatra/mapping-to-the-moon-94bc55a19847">Mapping to the Moon</a> was originally published in <a href="https://medium.com/nakshatra">Nakshatra, NIT Trichy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Magic behind Apollo]]></title>
            <link>https://medium.com/delta-force/the-magic-behind-apollo-cf89aede34d4?source=rss-ebaea1e8d600------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf89aede34d4</guid>
            <category><![CDATA[space]]></category>
            <category><![CDATA[operating-systems]]></category>
            <category><![CDATA[nasa]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Venkatraman Srikanth]]></dc:creator>
            <pubDate>Sat, 02 Jun 2018 19:14:07 GMT</pubDate>
            <atom:updated>2019-07-17T16:51:10.950Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Greatest Computer Ever Made</h4><p>Let’s just take a moment to visualize something. In 1969 — yes that’s right, nearly 50 years ago — people walked on the moon! It seems to be an obvious piece of history today, but that doesn’t take away from the wonder.</p><p>That’s the magic of the Apollo program. In what was perhaps the most awesome series of events in generations, NASA managed to get 12 people to put their feet on the moon, and it was by no means any small feat. The Apollo missions required groundbreaking engineering innovations, and above all some sheer guts. There are so many different aspects to handle when it comes to planning a mission like this. After all, they don’t use the term “rocket science” without reason!</p><p>One particular aspect of Apollo that I’ve always wondered about is the part where they actually <em>get</em> to the moon. The most crucial component in this process is the flight computer, which gives the astronauts a real time overview about the spacecraft, and has programmed routines to make their lives easier. This machine, as you’ll see soon, was a milestone for instrumentation, control and software engineering.</p><p>It was completely designed, built and programmed at MIT’s Instrumentation Lab. That’s right, not a corporate company. Even giants like IBM wanted to take up the project, but NASA placed their faith in this university. Well, MIT isn’t just some ordinary university though, and their innovations would change the world.</p><h4>The Computer</h4><p>Let’s get to the star of our show, the messiah, the Apollo Guidance Computer. Why do I evangelize, you ask? To understand how heavenly the software was, let’s first examine how hellish the hardware that they had to work with was.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rpc2XWLLQeucGm7xEOJ-VA.png" /><figcaption>Apollo Guidance Computer</figcaption></figure><p>Here’s the computer itself! Unimpressed? At the time, a computer was the size of a room, and sometimes an entire building. This one had to fit in a tiny package on board the command module, and its size imposed severe restrictions on the hardware.</p><p>How much RAM does your computer have? Eight gigabytes? Four perhaps? The AGC had <strong>kilobytes</strong>. Just two kilobytes. With only this tiny space they had to work with, programs needed to be incredibly terse and efficient.</p><p>Apart from the 2Kb of erasable RAM, the programs themselves had to be stored in only 36Kb of read-only memory, or ROM. Also, since these components would be enduring harsh accelerations and forces on the rocket, they needed to develop memory that wouldn’t fail at any cost. The solution was C<em>ore Rope Memory (CRM)</em>, shown in the image. Ones and Zeroes were literally <em>weaved</em> into a board on a loom by textile workers! Gives a whole new meaning to storing strings, eh?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*JSo_q17Hx6DZ_OSMBdu0-w.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*zSae-WTKYANrCcLLc8VpsQ.jpeg" /><figcaption>Image 1: Workers weaving programs into CRM on a loom | Image 2: A closer look at a CRM block</figcaption></figure><p>The processor ran on <em>integrated circuits</em>, and this first time ever that ICs would be used in a computer. In fact, the technology was so new, the production engineers didn’t even know how to test them! Every single step of this computer’s hardware was a gamble, a story of clever trial and error by some very smart people.</p><h4>The Problem(s)</h4><p>When you attempt a project this ambitious, there’s bound to be problems. A lot of them. The AGC was built at a time when the concept of software itself was a little bit fuzzy. Software was simply part of the process of developing the hardware, and the MIT researchers were <em>expected </em>to program the thing as well. On this project however, the software was by no means trivial. It introduced engineering problems in a field that wasn’t even considered real engineering.</p><p>One problem of particular interest is the issue of handling multi-programming. Clearly, the AGC had a lot of different tasks to do at the same time, like calculate trajectories, run maintenance programs, display information to the user, etc. How would it handle all of these at once, especially with the pathetically low amount of memory it had?</p><p>Traditional computers at the time used a system called <em>round-robin scheduling</em>. When there were multiple tasks to be done, the processor handles each one for a specific slot of time, and keeps cycling between them. For 3 processes P1, P2, and P3, the computer might handle P1 for 10 microseconds, P2 for 10 microseconds, P3 for 10 more, and then go back to P1.</p><p>This method has its problems. For one, if there comes along a short program, then you’re wasting the remainder of the cycle. If there’s a long or important program that’s demanding a lot of computing power, you aren’t giving it enough attention. Round-robin can work for large server computers that might be working with repetitive tasks, but for a real-time system that must be responsive for the user, it fails.</p><h4>The Solution</h4><p>The engineers realized that they needed a method for the processor to complete the important jobs first, and know which jobs to keep for later — a notion of <em>priority</em>. The tasks should also be processed one by one, so that you finish the important tasks as soon as possible — <em>a run queue</em>.</p><p>The solution is to assign each process a particular priority, and keep moving the higher priority tasks to the top of your queue. This <em>priority-queue</em> system ushered the age of modern multi-programming and is still used in commercial operating systems.</p><p>Apollo had two separate job queues — The Waitlist and the Executive. Programs would move from the Waitlist to the Executive once the higher priority processes were executed.</p><p>When a higher priority process comes along, it is moved straight to the top of the Executive, in what is called an <em>interrupt</em>, as the executing process is interrupted to make way for the more important process. The AGC also had a 12-word erasable area called the Core Set, where it stored information about the programs that are executing. Hence, interrupted processes can be resumed where they were left off. Clever!</p><h4>The Test</h4><p>Priority-interrupt scheduling showed it’s true power during Apollo 11, after the Lunar Module initiated its descent towards the Moon. When the spacecraft was at 30,000 feet above the Lunar surface, while the descent program was executing, the computer ran a warning alarm with the code 1202. In what has to be called the most important tech support call of all time, engineers Steve Bales at Mission Control in Houston discovered that the code meant “Executive Overflow — No Core Sets”, implying that the computer was handing more than it could take.</p><p>Think about how much work the system must have been doing at the time — It had to know where the lunar module was and where it was moving, information called state vector. It needed to maintain the right attitude based on that position, as well as velocity, altitude, and engine performance data. It also needed to adjust the abort trajectory constantly, ready to get the crew back into orbit should something force an abort. All this consumed nearly 90% of the CPU’s computing time.</p><p>Houston identified that the overflow could be due to pilot Buzz Aldrin leaving the external radar on in passive mode (called <em>SLEW </em>mode), and that might be still be eating some of the computer’s precious clock cycles. Sure enough, once the radar was turned off, the alarms ceased and the computer was stable once again.</p><p>Without a priority-interrupt system, the system would have crashed when the program gave it a new job, and would need a hard reboot. Instead, the scheduler simply chucked out some lower priority tasks and sounded the alarm, keeping the system alive. Without the scheduler, the moon landing would never have happened!</p><h4>The Greatest Computer Ever Made</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sLS7hmGsq6AG_qddzDI1zQ.jpeg" /><figcaption>Margret Hamilton, Director of Software Engineering at the MIT Instrumentation Lab, with the AGC source code.</figcaption></figure><p>I only talked about one small part of the AGC here, but it was truly a revolutionary machine in every way. As a programmer whose programs regularly leak memory, it baffles me how the software was <em>that</em> well optimized, to be able to do so much with so less. This wasn’t just a computer that had to work pretty well, it was a computer that would kill people if it failed. Perfection requires effort, enormous amounts of effort. The work was so demanding, 15 MIT engineers got divorced while working on the project! The years of passionate work building the AGC speaks in the stellar success story of the Apollo program.</p><p>I think it’s safe to say that this is indeed the greatest computer ever made, and will be for ages to come.</p><h4>Notes</h4><p>I had a lot of fun writing this article, and I learned a lot as well!</p><p>NASA has some great material explaining the architecture of the AGC, and the code has been painstakingly digitized and is available on GitHub.</p><p>Sources -</p><ul><li>NASA History article explaining the AGC Architecture — <a href="https://history.nasa.gov/computers/Ch2-6.html">https://history.nasa.gov/computers/Ch2-6.html</a></li><li>An excellent documentary about the Apollo missions, and specifically an episode about the AGC — <a href="https://youtu.be/9YA7X5we8ng">https://youtu.be/9YA7X5we8ng</a></li></ul><p>If you’d like to read more, I wrote an article about Apollo’s guidance instrumentation over on the Nakshatra blog. Do check it out!</p><p><a href="https://medium.com/nakshatra/mapping-to-the-moon-94bc55a19847">Mapping to the Moon</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf89aede34d4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/delta-force/the-magic-behind-apollo-cf89aede34d4">The Magic behind Apollo</a> was originally published in <a href="https://medium.com/delta-force">Delta Force</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Computers Make Random Numbers]]></title>
            <link>https://medium.com/delta-force/how-computers-make-random-numbers-51e8938d9d53?source=rss-ebaea1e8d600------2</link>
            <guid isPermaLink="false">https://medium.com/p/51e8938d9d53</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[random-numbers]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Venkatraman Srikanth]]></dc:creator>
            <pubDate>Fri, 06 Oct 2017 13:34:33 GMT</pubDate>
            <atom:updated>2017-10-28T08:58:47.601Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*aXW_00lLrZn0_V4ytKoQUw.gif" /></figure><h3>Predictable Chaos</h3><h4>How Computers make Random Numbers</h4><p>In software, and in engineering in general, there is necessity for reproducible randomness — numbers and images that seem random, that look and feel random, but are actually generated using definite algorithms. This is called <em>pseudo-randomness</em>, and we’ll be taking a closer look at simple ways to make pseudo random numbers. By the end of the article, we’ll have formulated a simple theorem for producing these seemingly random numbers.</p><p>Defining what exactly randomness <em>is</em> can be a challenging task. There are some tests (<em>Kolmogorov complexity</em> for example), that can give you a proper mathematical value for how random a sequence is, but for our case, we won’t bother. We will simply be trying to produce a sequence that has numbers following a seemingly unrelated pattern.</p><p>Often, the requirement is not just a single number, but several random ones, generated continuously. Hence, given a starting value, we need to way to produce more values. This starting value is called the <em>seed</em>, and we’ll see how to get the seed later. For now, let’s focus on generating a set of numbers.</p><h4>Generating Random Numbers from a Seed</h4><p>One approach could be to apply some crazy mathematical formula to the seed, and mangle it enough so that the output number seems unpredictable, and then use <em>that</em> as the seed for the next iteration — but what should this ‘mangling’ function look like?</p><p>Let’s try experimenting with this idea, and see where it gets us. This mangling function will take one value and return another one. Let’s call it <em>R</em>.</p><pre>R(Input) -&gt; Output</pre><p>Let’s start off with <em>R</em> being a stupidly simple function. R will simply add 1.</p><pre>R(x) = x + 1</pre><p>If our seed value is <em>1</em>, <em>R</em> will generate the series <em>1, 2, 3, 4, …</em>. Not random at all is it? We’ll get there. Let <em>R</em> add any constant <em>c</em> instead of <em>1</em> now.</p><pre>R(x) = x + c</pre><p>If <em>c</em> is say <em>7</em>, we’ll get the series <em>1, 8, 15, 22, …</em>. We still haven’t gotten very far. One obvious property that we’re missing is the fact that <em>numbers shouldn’t always be increasing — they should be scattered about the rang</em>e. We need to make our number line lead back onto itself so that it will produce smaller values too — <strong>a number circle</strong>!</p><p>Consider a clock face — our number line starts at 1, and wraps around at 12 (or 0). Since computers are more comfortable with math that begins at 0, let’s assume clocks have 0 at the top instead of 12.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*4g7Sl3v-4NtPkbduzKoRrw.png" /><figcaption>A trace of the function we’ve defined</figcaption></figure><p>Now, starting at 1, we again keep adding 7. Go on, trace it out on a clock face! We get</p><pre>1  8  3  10  5  0  7  2  9  4  11  6  1  8 ...</pre><p>Progress! We observe that after 12 numbers, our series continues to repeat, no matter what number we choose to start at. This is a very important property to keep in mind — if our cycle has <em>n</em> elements, we can only generate a maximum of <em>n</em> elements before our sequence repeats.</p><p>Let’s revise our <em>R</em> function to match our logic. Limiting the cycle length is nothing but the <em>modulus</em> or remainder operator.</p><pre>R(x) = (x + c) % m</pre><p>At this point, you’ll also observe that some numbers are inherently bad choices for <em>c</em>. If <em>c</em> was 4 and we started at 1, our sequence would be 1, 5, 9, 1, 5, 9, 1, 5, 9, … which is a horrible sequence! Its not random at all! Its clear that the numbers we choose for the length of the cycle and the number we choose for the jump <em>c</em> must be related in a special way.</p><p>If you try this out for a couple of values, the property is easy to see — <strong><em>m</em> and <em>c</em> must be relatively prime, </strong>also called co-prime.</p><p>Till now, we’ve considered jumping numbers by addition, but what about by multiplication? Perhaps we can multiply <em>x</em> by a constant, say <em>a</em>.</p><pre>R(x) = (ax + c) % m</pre><p>The properties that <em>a</em> must obey so that we produce a full cycle are a little more specific than for <em>c</em>. In order to produce a valid cycle of numbers,</p><ol><li>a-1 must be divisible by all prime factors of <em>m</em></li><li>a-1 must be divisible by 4 if <em>m</em> is divisible by 4</li></ol><p>These properties, along with the rule that <em>m</em> and <em>c</em> must be co-prime, constitute the Hull-Dobell theorem¹. The proof of this theorem is beyond the scope of this article. You could of course, come to the same conclusions if you took a bunch of values for the different constants and see what you get!</p><h4>Deciding the seed</h4><p>One thing we haven’t addressed yet, is the issue of deciding the initial seed. We <em>could</em> fix it to some constant number. This is useful in cases where you need random numbers, but they have to be the same every time the program is executed — generating the same map every game for example.</p><p>Another way to decide the seed is to fetch it from a source that is different each time the program is executed — like the system time. This useful in a case where a general random number is needed, like a program to simulate a dice roll.</p><h4>Our End Result</h4><p>Applying a function on its result over and over like we’re doing is simply a recurrence relation. Let’s define our formula as a recurrence relation.</p><p>The final relation looks like this:</p><pre>x(n) = (a * x(n-1) + c) % m</pre><p>Where x0 — or the first starting value of x — is the seed, a is the multiplier, c is the constant to add, and m is the modulus.</p><p>What we’ve made here is called a Linear Congruential Generator, or an LCG. These are popularly used, because the calculation is very fast and they’re simple to implement.</p><p>Different languages and compilers have different implementations of the LCG, meaning the values of these constants change. For example, the random number function in libc, the C standard library for Linux, uses <em>m = 2^32</em>, <em>a = 1664525</em>, and <em>c = 1013904223</em>. A compiler like gcc would typically use these values.</p><h4>Final Remarks</h4><p>There are more complex generation algorithms out there, but the LCG is a simple and classic one, and is easy to understand as well. If you’d like to dive deeper, do check out the original paper by Hull and Dobell (linked below), which has elegant proofs for the LCG conditions.</p><p>Random number generation has abundant applications in computer science, and is especially important in cryptography.</p><p>That’s all for this article, thanks for reading!</p><p>[1] Hull and Dobell (1962) <a href="http://chagall.med.cornell.edu/BioinfoCourse/PDFs/Lecture4/random_number_generator.pdf">Random Number Generators</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51e8938d9d53" width="1" height="1" alt=""><hr><p><a href="https://medium.com/delta-force/how-computers-make-random-numbers-51e8938d9d53">How Computers Make Random Numbers</a> was originally published in <a href="https://medium.com/delta-force">Delta Force</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Farewell, Cassini!]]></title>
            <link>https://medium.com/nakshatra/cassinis-journey-dd581edfc9c9?source=rss-ebaea1e8d600------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd581edfc9c9</guid>
            <category><![CDATA[cassini]]></category>
            <category><![CDATA[astronomy]]></category>
            <category><![CDATA[saturn]]></category>
            <dc:creator><![CDATA[Venkatraman Srikanth]]></dc:creator>
            <pubDate>Sat, 16 Sep 2017 09:56:04 GMT</pubDate>
            <atom:updated>2017-09-19T11:10:37.207Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4lOhgUs3Z32JNvWm5yNng.jpeg" /></figure><p>Just a few hours ago, NASA confirmed that the Cassini mission is over — the spacecraft has plunged into Saturn and destroyed itself. This marks the end of what has been one of the greatest interplanetary missions of all time!</p><p>Cassini is a bus sized spacecraft launched way back in 1997. Since then, it has spent 13 years orbiting Saturn, studying the planet and its fascinating system of moons. The amount of images, data, and science that has come out of Cassini has been astounding. It has also given us some spellbinding discoveries and jaw-dropping colour photographs. Alas, all good things must come to an end, and Cassini’s time has come to a close. To preserve the Saturn moon system, NASA scientists have plunged it into Saturn, where it has burned up in a fiery ball in the planet’s dense atmosphere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*TM2wp6MF6JN3vms1vnqoMw.jpeg" /><figcaption>Mock-up of Cassini shattering as it hits Saturn’s thick atmosphere</figcaption></figure><p>Cassini was also responsible for deploying a lander, named Huygens. Huygens is a small probe that descended on Titan, Saturn’s largest moon. Huygens sent back valuable data about Titan’s surface and atmosphere, and gave us the only photo from a world in the outer solar system — a truly monumental achievement! Here’s a picture from the surface of Titan, a rocky landscape more than a billion miles from us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*iCOzwDNwVeg_qKCt_LsAIg.jpeg" /><figcaption>Surface of Saturn’s moon, Titan</figcaption></figure><p>Coming back to Saturn, the planet is often hailed as the most beautiful because of its incredible rings. Indeed, when I first saw Saturn through a telescope, I was blown away — the rings look exactly like they do in the pictures, seemingly hanging around the planet like a golden wreath! It’s one of those moments that truly make you question your place in the universe, and Cassini has taken that emotion to <em>cosmic</em> proportions. The photos of the planet and it’s complex moon system have been nothing short of phenomenal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CB5l4BqjByk3wBGv1VVSWA.jpeg" /><figcaption>Saturn and Titan</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xsR6TrpmECZNMJLfnqmeYA.jpeg" /><figcaption>Beautiful rings!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f42T5I4KqnaS9Sc086eBXg.jpeg" /><figcaption>The blue dot, that’s us!</figcaption></figure><p>September 15th, 2017 was truly a heartbreaking day for the NASA scientists and engineers who have been part of this gargantuan mission from the very beginning. In fact, there were even Cassini themes tissue pouches distributed for the teary-eyed, and grief counselling was offered. One can assume that the feeling was akin to that of losing a child — one that has accomplished above and beyond expectations however. Cassini-Huygens is a resounding success, and the space community will miss it’s presence.</p><p><strong>So long and thanks for all the fish, Cassini!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd581edfc9c9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nakshatra/cassinis-journey-dd581edfc9c9">Farewell, Cassini!</a> was originally published in <a href="https://medium.com/nakshatra">Nakshatra, NIT Trichy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>