<?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 Hyeok Jung Kim on Medium]]></title>
        <description><![CDATA[Stories by Hyeok Jung Kim on Medium]]></description>
        <link>https://medium.com/@hyeokjungkim?source=rss-b04f77919689------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*i4bw_sKaTspkipca.</url>
            <title>Stories by Hyeok Jung Kim on Medium</title>
            <link>https://medium.com/@hyeokjungkim?source=rss-b04f77919689------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 01:27:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hyeokjungkim/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[Binary Heaps]]></title>
            <link>https://medium.com/@hyeokjungkim/binary-heaps-f8e40e20c5cc?source=rss-b04f77919689------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8e40e20c5cc</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Hyeok Jung Kim]]></dc:creator>
            <pubDate>Thu, 24 May 2018 13:58:26 GMT</pubDate>
            <atom:updated>2018-05-24T13:58:26.907Z</atom:updated>
            <content:encoded><![CDATA[<p>When it comes to solving problems, I believe that there exists a hierarchy in the types of solution that one can come up with — a working solution is naturally better than a broken one and an efficient solution is much preferred over a barely-working solution. For instance, consider the issue of commuting. While I’m fortunate to live in New York City where there is public transportation to help me get from point A to point B, the MTA is not without its flaws. So, a more efficient solution might be to drive everywhere and thus, not have to deal with the MTA. However, one issue with driving, as it often is for any efficient solution to a problem, is that it might require more preparation on my part to make sure I have access to the right tools. For the specific case of commuting, I first need to have access to a car in order to drive as well as have a license.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*JUVrQMrhxvnLYwzV.jpg" /><figcaption>There has to be a better way!</figcaption></figure><p>What does this have to do with programming? Well, when we program and code, we’re essentially solving problems and figuring out solutions to problems. So, consider this problem: You have an unsorted list of integers and you want to somehow find the three biggest numbers in the list. A broken solution for this might be to put the elements in an array and grab the last three elements and hope that they’re the biggest three. This is clearly not at all effective as it’ll rarely work. One working solution might be to put the list in an array, sort it from smallest to greatest and grab the last three elements. Since sorting an array takes O(n log n) time and grabbing the last <em>k</em> elements takes O(k) time, the overall runtime for this algorithm is O(n log n + k) time. A slightly more efficient way to do this might be to put the list in a <em>max-heap</em> and then grab the maximum element three times. But much like the analogy with the commuting, this requires the correct tool. But, what <em>exactly </em>is a heap?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*JoK0n_x4c36CiSJp.gif" /><figcaption>Heap of garbage? Heap of leaves?</figcaption></figure><p>A binary heap (sometimes called binary trees), like array or hashes, is a data structure that can store primitive data. But unlike arrays and hashes, which are both relatively linear in the way that we traverse them, binary heaps are hierarchical with parents and children. For the sake of simplicity, we’ll pretend that heaps can only store numbers as this will make talking about heaps easier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/0*KfSF9OawzSwGC0Cj.jpg" /><figcaption>Both valid max-heaps.</figcaption></figure><p>At the top of each tree is ironically what we call the root node. Depending on the type of heap, the root is either the biggest (max-heap) or the smallest element (min-heap) in the dataset. From the root, each node(element) has <strong>at most</strong> two children nodes related to them, which are either going to be smaller or bigger than their parent (smaller if max-heap and bigger if min-heap). It’s important to note that in order to get the most out of a binary heap, the heap need to also be balanced, meaning that within every level, other than the last bottom level, there should be 2^(n-1) number of elements, where n is the level number. The last level where the “leaves” of the heap are do not need to be filled, since there just might not be enough elements in the remaining list after we fill up the previous levels.</p><p>Just like how getting a car can be a headache at first, setting up a binary heap seems somewhat tedious. But, in the long run, a binary heap can set you up for success if used correctly. For instance, in a max heap, getting the biggest element is easy as getting the root node, which is done is O(1) time. But how would we get the next two biggest element? Since sibling nodes have no restriction on how they compare with one another, it’s a little harder to get the second biggest number. So, what we do is remove the root node and then, from the two sub-heaps, we recreate one big heap of size n-1. Although this seems inefficient, since we have a pretty solid structure already in place, we can go about this in a relatively sneaky way. Note that the following method discusses how to remove the root node from a max-heap, but the steps can be generalized to remove any element from the heap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*2qE2ulPW3p5stW86." /><figcaption>Getting the minimum element out of a min-heap</figcaption></figure><ol><li>We swap the root with the last node in the last level. Since the root is now at the bottom level, we can remove it and still preserve the general shape of the heap.</li><li>But now we have the root out of place. Since we grabbed it from the bottom, it is no longer the biggest element. So we compare the element with its “children” nodes in the second level and see which one is bigger. If the grabbed element is bigger than both, then the property of the heap is preserved and we are done. If the grabbed element is smaller than one of its child, we swap their positions. If it’s smaller than both the elements, we swap it with the bigger of the two children. No matter what happens, after this step, the root of the heap will be the biggest node.</li><li>If the node that we grabbed from the bottom has swapped with its children in the second level, then we still need to make sure that the grabbed node is in the correct location. So we continue to compare the node with its children and swap places downwards when necessary until the node is bigger than either of its children and/or it’s reached the end level.</li></ol><p>Although this sounds complicated, because of the binary structure of the heap, we’re making a significantly fewer number of comparisons than if we were to do this with a regular array. In fact, all this happens in O(log n) time, meaning that if we do this k number of times to grab the k largest element, we will be able to do so in O(k log n), which is better than our runtime of O(n log n + k) which we got from using an array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*4I2iQ_7kDeIdnzd8C39gqw.gif" /><figcaption>Hooray for efficiency!</figcaption></figure><p>But let’s say our list is dynamic and we’re constantly pushing numbers in and out. We already know that pulling numbers out of a heap is slightly faster than pulling them out of an array; How do the two compare when we’re pushing numbers in? In a sorted array, we would insert the element at the beginning of the array and have it swap across the array until the element next to it was bigger than the inserted array. Since we would need to make at most n comparisons, this has a runtime of O(n). Not bad.</p><p>But for a heap, the process for inserting an element is very similar to the process for removing an element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*1RKAGtQKPKWDPYZERFK3jg.gif" /><figcaption>Inserting 1 into a min-heap.</figcaption></figure><ol><li>We first attach the element we want to insert in the last level of the heap.</li><li>We compare the element to its parent and if the element is bigger, than we swap. If the element is smaller, than we stop.</li><li>We continue to traverse up the heap until its parent is bigger.</li></ol><p>Once again, due to the structure of the tree, we have to make at most log n comparisons meaning that our runtime of inserting elements is O(log n) for a heap. Once again, our heap is more efficient in the runtime of pushing elements in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*F0nIOsq57oaLr1pBnW700Q.png" /><figcaption>Efficiency of heaps vs efficiency of arrays.</figcaption></figure><p>However, one distinct advantage that an array has over a heap is that the former is a far more common data structure than heaps. Most computer languages have a built-in concept of an ordered list or arrays, so working with them seems more natural than working with <a href="http://www.collectionsjs.com/heap">heaps</a>. However, since the heaps that we’re working with are balanced and have a nice predictable shape about them, we can use an array to represent heaps. Numbering the nodes in the heap with the root being 1 and increasing as we go from left to right, we can begin to notice some patterns. For instance, node 1 has children 2 and 3. Node 2 has children 4 and 5. Node 3 has children 6 and 7. We can generalize this for any parent node <em>i</em> to have children 2<em>i</em> and 2<em>i</em> + 1 and any child node <em>j</em> to have the parent floor(<em>j/2</em>). With this arithmetic, we can store the nodes of a heap in an array without any pointers and thus, get the best of both worlds!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/0*ES1IkJ8tgJgQCrpS.gif" /><figcaption>Array implementation of a heap.</figcaption></figure><ul><li><a href="http://www.collectionsjs.com/heap">http://www.collectionsjs.com/heap</a> (JavaScript Collection for a heap)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8e40e20c5cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Password1]]></title>
            <link>https://medium.com/@hyeokjungkim/password1-f83aa100233a?source=rss-b04f77919689------2</link>
            <guid isPermaLink="false">https://medium.com/p/f83aa100233a</guid>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Hyeok Jung Kim]]></dc:creator>
            <pubDate>Thu, 03 May 2018 14:56:14 GMT</pubDate>
            <atom:updated>2018-05-03T14:56:14.712Z</atom:updated>
            <content:encoded><![CDATA[<p>Although some of us might not like to admit it, humans as a whole need the Internet to function as well as we currently can. The web has become an integral part of almost everyone’s life and it has made information readily accessible to almost everyone at unprecedented speeds. People halfway across the globe can talk to one another in matters of seconds and no longer are people restricted by their physical locations. But as always, with great power comes great responsibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*pgsK9936_OIKWYJpcMicVg.gif" /></figure><p>With information becoming almost synonymous with power, people need to be careful with what gets put out on the web. Although the idea of strangers seeing your personal pictures and videos can be somewhat uncomfortable, the idea of strangers having access to your bank account is downright terrifying. We can try and hide all our personal information behind a username and password, but like any security system, internet security is as strong as its weakest link. Although users are definitely not without flaws, sometimes it is the way that <a href="https://nakedsecurity.sophos.com/2013/11/04/anatomy-of-a-password-disaster-adobes-giant-sized-cryptographic-blunder/">websites</a> store passwords that can cause major problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*tdprVOE-jxAyBsZfYOI9UA.png" /><figcaption>XKCD comic commenting on the Adobe password leak</figcaption></figure><h3>Plain-Text Passwords</h3><p>Although there are a number of ways that websites can store passwords, all methods can be boiled down into three distinct categories. The first (and the simplest) method of storing passwords is to store them in plain-text. That means that if your password is “123456”, a website will store it as “123456” in its database. For obvious reasons, this is not very secure. If the website gets compromised in any way, your password is immediately available for everyone to see, no matter how complicated or convoluted your password might be. Keep in mind that websites that store passwords in plain-text can easily access your password as is and pass that information around, which is highly dangerous. So, if you are on a website that sends you your plaintext password in an email or something, keep in mind that the security of that website is mediocre, at best.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*1WwgBRUBF3l3LTq3eL7Yqg.gif" /><figcaption>Don’t use websites that store their passwords in plain-text… Just don’t.</figcaption></figure><h3>Encrypted Passwords</h3><p>Instead of storing passwords in plain-text, some websites might try to improve their security and opt to secure their passwords with encryption, which takes a password and effectively translates it into a random string. An analogy that is often used with encryption is that it is essentially a safe for your information; you can access it, but only with the correct key. So, should a hacker get access to your encrypted password, there is not much that (s)he can do with that information. The issue with encrypted passwords, however, is that the key to decrypt the password is often on the same server as the database. So if the database of password gets compromised, chances are that the key is also compromised, effectively rendering the encryption useless. So, whether your password is “123456” or “correcthorsebatterystaple”, if the website that you’re using encrypts their passwords, but hides its database behind shoddy security, it makes no difference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*JudEzPSpqGLsWVy8d1qbhQ.png" /><figcaption>XKCD comic commenting on password strength.</figcaption></figure><p>To better understand encryption, let’s go over some examples. But please note that the examples I’ll be using should <strong>never ever</strong> be used for real-life applications as they are incredibly easy for anyone to break.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*euUU9DlirXNwsTePPmIc2A.gif" /><figcaption>DO NOT TRY THIS AT HOME/YOUR OWN WEBSITE.</figcaption></figure><p>For the sake of simplicity, we’ll say that we can only store numerical passwords in our database. So the password that we’ll choose to encrypt will be 123. A very basic encryption that can be done to hide our password might be multiplying it by two, turning our not so secure password into the encrypted number 246. From the website’s perspective, it’s easy to authenticate this password because all it has to do is to take the inputted password and multiply it by two. If the encrypted password is 246, everything’s good and if it’s not, it knows that the inputted password was not 123. But should a hacker get a hold of our encrypted password, it will be, at the very least, tedious to figure out the original password without the key as there are literally infinite ways to get to 246 from any given number. However, as soon as the hacker figures out the key to our horrible encryption system, it’s all over for the website. Any encrypted password it has on its database can be undone and the hacker has access to all the information that we worked so hard to encrypt.</p><p>Since the key used in both our encryption and decryption were effectively the same, the example above is an example of symmetric encryption. All of the keys that we use for the locks in our household can be thought of as symmetric keys as they do both the unlocking and the locking. Since anyone can undo a lock placed by symmetric encryption if they have the right key, it is not wise to store passwords this way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*x2iiZLNC_qaeAqoIkUi04A.png" /><figcaption>A symmetric key is used for both encryption and decryption</figcaption></figure><p>But what if we encrypt our password using <em>RSA encryption</em>? Although it should never be used to store passwords, RSA is an asymmetric encryption algorithm built on the premise that prime numbers are easy to multiply, but pretty hard to factor. I won’t go into the math behind the encryption, but I strongly suggest you <a href="https://brilliant.org/wiki/rsa-encryption/">check it out</a> as it really is a creative and effective way to get around symmetric encryption using modular arithmetic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Ysz6mY8jlVKD-Ph6o-TpBw.png" /><figcaption>The brains behind RSA — a.k.a. Rivest–Shamir–Adleman Encryption</figcaption></figure><p>Before we start encrypting any passwords, let’s first set up a RSA encryption:</p><ol><li>Start with two prime numbers. (Call this <em>p</em> and <em>q</em>)</li><li>Find the product of the two primes (Call this <em>s</em>)</li><li>We find the <em>totient</em> of the two prime numbers, which is he number of positive numbers less than a specific given number which are relatively prime (For our example, <em>p-1</em> and <em>q-1</em>)</li><li>Find the product of the two totients (Call this <em>t</em>)</li><li>Find a number relatively prime to <em>t </em>(Call this <em>n</em>)</li><li>Calculate the multiplicative inverse of <em>n </em>in modulo <em>t</em>, which is the number that when multiplied by <em>n</em> and itself, it is congruent to 1 mod <em>t</em> (Call this <em>d</em>)</li></ol><p>So for our example: <em>p </em>= 11, <em>q</em> = 17, <em>s</em> = 187, <em>r</em> = 160, <em>n</em> = 7 and <em>d</em> = 23. Notice that the product of 7 and 23 is 161, which is congruent to 1 mod 160. The only values that are made public should be <em>n</em> and <em>s</em>. The password that we want to encrypt will still be 123.<br> <br>When we send our password to the database, we will first calculate our password raised to the power of <em>n</em> and find the modulo <em>s </em>of that value. <br>For our example:123 raised to the power of 7 is 425927596977747, which is congruent to 183 mod 187.</p><p>183 is how our password will be stored in the database and once again, if a hacker gets access to 183, this information is meaningless.</p><p>To decrypt 183 back into 123, the website will take the encrypted password and raise it to the power of <em>d</em> and find the modulo <em>s </em>of that value. <br>For our example: 183 raised to 23 is equal to 10873642837729060634567161052271370555328805661263687, which is congruent to 123 mod 187. (Obviously.)</p><p>For our specific example, we unfortunately are limited to 187 numerical passwords (0 to 186), but if our <em>p</em> and <em>q</em> is sufficiently large, we not only get more passwords to use, but this also becomes a problem that is really ineffective to brute-force. Breaking down the publicly available <em>s</em> into its two prime factors gets harder and harder as <em>s</em> gets bigger and without the original two prime numbers of <em>p </em>and <em>q</em>, RSA encryption is pretty hard to crack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*-YTJl9rllgwXa9HtwVj0Hw.gif" /></figure><h3>Hashing Passwords</h3><p>Hashing passwords is somewhat similar to encrypting passwords — it takes the password and translates it into a random string. However, what separates the two is that hashing is a one-way function whereas encryption is a reversible function. So, if encrypting a password is like putting it in a safe, then hashing a password is like putting your password into a fine paper shredder. So like encrypted passwords, if a hacker somehow gets access of your password in a website’s database, (s)he won’t be able to do much with that information to get back to your original password.</p><p>However, if the hacker knows what type of hashing algorithm was used, then (s)he can just make something called a rainbow table — a table of trillions of passwords with their matching hashes. Then, the hacker can match the hash in the website’s database with the ones in the rainbow table and from that, find out the password. However, it is worth noting that this can only be done with <strong>some</strong> hashing algorithms, particularly the bad ones.</p><p>Just like before, let’s try out some examples of hashing algorithms. Just to reiterate, all of my examples have been severely watered down and should never be implemented in real life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5OJsFjQAjRCokMZ0YOyJDQ.png" /><figcaption>ONCE AGAIN, DO NOT TRY THIS AT HOME/YOUR OWN WEBSITE.</figcaption></figure><p>With that out of the way, let’s try to store our 123 password into the database with a hashing algorithm! The hashing algorithm of our choice will do the following:</p><ol><li>Take the square root of our numerical password and then take the square root of the subsequent answers three more times.</li><li>Take only the decimal component of the number.</li><li>Sort the decimal component from least to greatest.</li></ol><p>Here is this hashing algorithm written out in code with the hashed result of 123.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*GUAPzXhqeuywCIYcJKtzOw.png" /><figcaption>The hashed password for 123 is 0111134455667889.</figcaption></figure><p>So under our hashing algorithm, 123 is hashed into 011134455667889, which is what gets stored into our database. However, note that the hashed number of 376 is equal to the hashed number of 904, meaning effectively that the number of passwords that we can use is 903 since we don’t want to use 904. For the same reason, we do not use 0 because the hashed number of 0 is the same as hashed number of 1.</p><p>But notice that <em>arr</em> contains all the hashed values of all our passwords. This is the rainbow table that hackers can use to reverse-engineer the password given its hashed value. So if we somehow saw that a password gets hashed to 0122233444477788, all that we have to do is find that number in the <em>arr</em> array and find out its index. Add one to that and that’s the password pre-hashed, which is something that a hacker should not have access to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mUjSDlykyo-QoOe-SpX7cQ.png" /><figcaption>The values of <em>arr (which is a rainbow table, despite what this color schema might suggest)</em></figcaption></figure><p>So how do we make our hashing algorithm better protected against rainbow tables? Well, what we can do is salt the password before hashing it, which is similar to how a chef might salt his/her food before serving it. Before we run the password through the hashing algorithm, we might add a random number to the our password somehow. For our example, let’s just multiply our numerical password by the number attained from concatenating each user’s birthday month and date. So using my birthday of 517, hashing 123 becomes 1233555678899999.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*5ABZYWX1l6rvtfg7AoCjjw.png" /><figcaption>The hashed password for 123 that is salted is 1233555678899999.</figcaption></figure><p>While this does not solve the issue of unique hashes, it renders rainbow tables relatively ineffective. So even if a hacker gets 1233555678899999 out of the database, unless (s)he knows the ‘salt’ (birthday) and how it was sprinkled onto the password (multiplication), (s)he’ll have to iterate through a lot of tables of different birthdays and different combinations of salting.</p><p>Another way to stop brute-force attempts is to make the hashing algorithm run relatively slow. For example, if a hacker can only go through 25 passwords a second instead of 100, the time that it takes to break one password is quadrupled. And for the user who knows the password, a relatively slow hashing algorithm does not really matter because all that (s)he will have to hash is just one number.</p><h3>General Password Tips</h3><p>As consumers, we often do not have the chance to influence how websites might store their passwords. However, we can change what types of passwords we use and in general, even with shoddy security, we should be using semi-random strings for our passwords. As well as strong passwords, we should also use a variety of passwords for different sites. That way, if one website gets breached, a hacker cannot use the information to gain access to other sites.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*emWgTcA81djiaaJyc4VnxQ.png" /><figcaption>At the end of the day, a security system is as strong as its weakest link. Don’t be the weak link.</figcaption></figure><p>One way to make your password pseudo-random that I found interesting was to make a mnemonic sentence and then take the first or last character of each of the words in the sentence to make the password. So for instance, I might use the sentence:</p><blockquote>“After going to Flatiron School for 15 weeks, I finally cured myself of Imposter’s Syndrome.”</blockquote><p>Taking the first letter/character of each word, I can get the password: “AgtFSf15w,IfcmoIS”, which is definitely random to anyone looking at it. But with the context of that sentence, it’s relatively easy to remember the password.</p><p>Also, if you are at all unsure of your skills to create a hashing algorithm or an encryption, please <strong>do not</strong> try to make your own. Use the reputable ones that have been publicly available for a while. If those algorithms can stand both the test of time and the test of countless of hackers trying to crack it, they’re probably secure and something worth taking a look at.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f83aa100233a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Big-O Notation]]></title>
            <link>https://medium.com/@hyeokjungkim/big-o-notation-4555135ee92f?source=rss-b04f77919689------2</link>
            <guid isPermaLink="false">https://medium.com/p/4555135ee92f</guid>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Hyeok Jung Kim]]></dc:creator>
            <pubDate>Thu, 12 Apr 2018 03:06:29 GMT</pubDate>
            <atom:updated>2018-04-12T03:06:29.502Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine this:<br>It’s been weeks since you first started writing your code for this killer app that you swear will change the way that the world views technology. You’re almost done with it, except for this one particular feature that simply refuses to be debugged. You scour countless Stack Overflow threads and watch just about all of YouTube trying to find a solution, but you come up with nothing. In frustration, you take a break and go walk/run/nap/take a bathroom break and suddenly, it hits you.</p><p>A solution.</p><p>But it certainly is not the world’s prettiest solution; it involves a bunch of iterators and conditionals and even more iterators. But when you run your program, it works. You let out a sigh of relief, pat yourself on the back and promise yourself that you will refactor the code tomorrow. Perhaps there’s a more elegant solution that you’ve just missed and perhaps after a full night’s sleep, you’ll find it. Or perhaps not. Your code works and that’s good, right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*B42U1obPHMcELbdrPIMQww.jpeg" /><figcaption>Your killer app that will change the world.</figcaption></figure><p>Well, not really… At the end of the day, the truth of the matter is that not all code is designed the same. Some eat up less memory than others, some are elegant one-liners and some are just more effective than others. But how do we quantify the effectiveness of a specific algorithm? Enter big-O notation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*VKVBjHA6UJtVHiSnW84Zyw.png" /><figcaption>Not all code is made equal; some are just better than others.</figcaption></figure><p>So, what is big-O notation? The formal definition of it is as follows:</p><blockquote>For some functions f(x) and g(x), defined on some subset of the real numbers, <br>f(x) = O(g(x)) as x → ∞ if and only if there exists a positive constant C and a constant N such that |f(x)| ≤ C|g(x)| for all x &gt; N.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*-z8tHoFBkBAKSuQBsWYNWw.gif" /></figure><p>Rather than trying to parse the definition, let’s first discuss big-O in layman’s terms. <strong>Simply put, the “O” in big-O is talking about the “order” of an algorithm and what the order of an algorithm tells you is how fast or slow your code runs (the runtime of an algorithm) depending on the size of your input/parameters</strong>. Figuring out the exact runtime that your algorithm takes when it is executed requires a somewhat deep understanding of how your language is structured, but here are some general rules:</p><ul><li>We assume that the size of our input is “n”. So, the runtime will be a function of n.</li><li>We assume the worst-case scenario as we are finding the <strong>upper bound of our runtime</strong>. Sometimes our input is nicely formatted, so <strong>our actual runtime may be faster than our expected runtime, but never slower.</strong></li><li>Coefficients of the terms as well as the slower growing terms do not matter when considering the runtime.</li></ul><p>But instead of dealing with hypotheticals, let’s look at some examples (listed from the slowest growing to the fastest growing runtime)!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*8-FT840icnyo3Glav8Kxpg.gif" /><figcaption>A scene from an anime aptly named “The Big O”</figcaption></figure><h3>O(1) Operations — Constant Time</h3><p>The best runtime for any algorithm is said to be constant time and it is considered as a O(1) operation. This means that no matter the size of our input/parameter, your computer will execute the code in the same amount of time. Some examples of algorithms that has a constant runtime might be accessing a given index of an array/hash, adding two numbers together or determining the parity of a binary number. So, for instance, whether you’re accessing the 1007th element in a given array or the 1000000007th element, your computer should take about the same amount of time because both operations are of O(1).</p><h3>O(log n) Operations — Logarithmic Time</h3><p>Operations done in logarithmic time are somewhat trickier to explain, but it helps to think of this as a O(log(base 2) n) operation rather than a simple O(log n), since base 2 makes it easier to relate to the concept of halving. A classic example of an algorithm that is an O(log n)operation is a binary search on a <strong><em>sorted</em></strong> array, in which we try to find an element by essentially cutting the array into halves. We first compare the element that we’re trying to find (call it <em>n</em>)<em> </em>with the term at the middle of the array and depending on whether <em>n</em> is bigger or smaller, we look to the right or to the left of the array, respectively. We then repeat the process for the subarray that we chose and we keep on doing this until we eventually find <em>n</em> or find the index in which <em>n</em> should be in. This concept of constantly halving the size of the input is the key to identifying O(log n) operations and when it comes to working with large sorted databases, algorithms with O(log n) runtime is the preferred way to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*3MucGoqZq_R23WmogAK3WQ.png" /><figcaption>A binary search for the number 19 in the sorted array.</figcaption></figure><h3>O(n) Operations — Linear Time</h3><p>Algorithms done in linear time are considered to be O(n) operations and as the size of our input increases, our runtime increases proportionately. One example of an algorithm done in linear time is going through a given array and searching for a specific instance. So, if we have an array of 200 numbers and an array of 100 numbers and we’re looking for the index of the number 1 in each of them, it’s going to take longer for the same computer to look through the 200-element array since the size of our input is bigger. Now, we could be lucky and find that the index of number 1 is 0 (eg: 1 is the first element in the array), but remember that whenever we’re calculating the runtime, we are going to assume the worst-case scenario because we’re always finding the upper bound of our runtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*0LRA1qYhZKfnrcu3FUpHzQ.png" /><figcaption>We’re iterating through an array to search for an element.</figcaption></figure><h3>O(n²) Operations — Quadratic Time (And Other Polynomial Time)</h3><p>For algorithms done in linear time, if the size of our input increases, our runtime increases proportionately. However, for algorithms done in quadratic time, our runtime is directly proportional to the <strong>square </strong>of the our input size. Algorithms done in quadratic time are considered to be O(n²) operations and and any time that an iterator is used inside another iterator (nested iterators), it is an operation done in <em>at least</em> quadratic time. So, for example, if we are given an array of <em>n</em> numbers and we want to match all the elements in the array with all the other elements in the array as well as itself, our code would look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*9VH9h1dlXFz6u4fYm4FPiA.png" /><figcaption>Pair_nums takes an array of numbers and pushes a doubleton into an empty array.</figcaption></figure><p>And if we use even more nested iterators, our runtime quickly goes from quadratic to higher degreed polynomials (cubic, quartic, etc.) and we consider that as O(n^c) operations, where <em>c</em> is the number of iterators being nested. Much like algorithms done in linear time, remember that we are going to consider the worst-case scenario.</p><h3>O(2^n) Operations — Exponential Time</h3><p>Algorithms done in exponential time are considered as O(2^n) operations and they are going to be the fastest growing operations that I will cover in this blog post. Specifically for O(2^n) operations, with each addition to the input, our runtime will essentially double. An example of this type of algorithm is the recursive method to get the nth <a href="https://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci number</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*dPrZS_kJZHM2n6zy_yz9lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*cMmghjMHPe8PgRWm7K5C2A.png" /><figcaption>As we figure out the next Fibonacci number, the number of branches (almost) doubles, so we run twice as much operations.</figcaption></figure><p>At first, it may be hard to remember the order of growth for each kind of runtime especially when you first learn about big-O. But thankfully, the great thing about big-O is that it’s heavily intertwined with mathematics, so we can approach the topic in multiple ways. For all the visual learners out there, if we were to graph the parent functions of all the runtimes, we can see how fast each type of graph rises — the higher the graph, the faster the growth in runtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*k-acuFitTKegB5l5JTn0tA.png" /><figcaption>The higher the graph, the faster the growth in runtime. The lower the graph, the more efficient the graph.</figcaption></figure><p>Now that we have a somewhat better understanding of big-O, let’s see them in action! We’ll take a look at two specific methods that both accomplish the same goal of seeing <a href="https://medium.com/@lin.alice72/intro-to-hashes-with-two-sum-8af115af632a">if two numbers in the array add up to a target number</a> and compare their runtime. In order to find out the runtime of each code, let’s first go through each of them and write down what’s happening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*gz0X2cR0UgmB5tYaYOoi8w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*WBQNUv19iCl0xIXpzFLYdQ.png" /><figcaption><strong>Left</strong>: Method 1 <strong>Right</strong>: Method 2</figcaption></figure><p>For method 1:</p><ol><li>We loop through the num_arr, with one “pointer” called n.</li><li>While n stays on one element, we once again loop through num_arr with a different “pointer” called n2.</li><li>We compare if the target number minus n is equal to n2.</li><li>We return an array (whether it’s the array of two numbers or the empty array).</li></ol><p>For the first step, what would be the runtime? Well, we first loop through the num_array, meaning that the runtime depends solely on the size of the num_array. If there’s 10 elements in the num_array, we’re going to do 10 operations whereas if there were 75 elements in the num_array, we’re going to do 75 operations. So that’s a O(n) operation.<br> <br> The second step is a little bit weird. We’re still looping through the num_array, so that’s still going to be an O(n) operation. But how should that be combined with the first step? Should we be adding the runtime or should we be multiplying it? Well, for this specific case, we’re iterating through the num_array for each of the elements in it, so we would actually be multiplying it. This is the nested iterator that we talked about before when talking about O(n²) runtime.<br> <br> For the third step, we’re actually doing two things at once; we’re subtracting two numbers and seeing if it’s equal to another number. So, that’s two O(1) operations being done twice, or O(1) + O(1).</p><p>In the last step, returning an array is also a O(1) operation since all that requires the computer to do is to create an array by accessing its memory.</p><p>But note that for steps 3, we’re doing it in the context of the iterated loop. So, all in all, our method takes about O(n)*(O(n)*O(1)) + O(1) or O(n² + 1) runtime. But remember for big-O notation, we don’t care about coefficients and the slower growing terms. So our overall runtime of the first method is O(n²). Not bad, but not good either.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*umlz9FKZu10hB3EcKMXjeg.gif" /><figcaption>O(n²) runtime is decent… But we could definitely do better.</figcaption></figure><p>Let’s do the same thing for method 2:</p><ol><li>We create a hash.</li><li>We loop through the num_array, with one “pointer” called n.</li><li>We make a comparison by accessing a hash with the key n.</li><li>We return an array (whether it’s the array of two numbers or the empty array).</li></ol><p>For the first step, the creation of a hash is an O(1) operation (because once again, all that a computer needs to do is allocate some memory for the hash).</p><p>For the second step of looping through the num_array, we are running an O(n) operation.</p><p>For the third step, we’re accessing a hash, which as described previously, is an O(1) operation and then, comparing the result to another value, which is another O(1) operation.</p><p>Returning an array is still an O(1) operation.<br> <br> So, for method 2, our overall runtime is O(1) + (O(n)*O(1)) + O(1) or O(n+2). Remembering to get rid of the less significant terms and coefficients, we get that the overall runtime for method 2 is O(n), which is much better than method 1’s runtime. Two functions that accomplish the same goal, but one is definitively better than the other in terms of runtime!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*qBV-PPXOJwBjIZDblAnqKw.gif" /><figcaption>Hooray for refactoring!</figcaption></figure><p>So, now that we feel a lot better with big-O notation, let’s try to see if we can make sense of the formal definition. Here it is, once again:</p><blockquote>For some functions f(x) and g(x), defined on some subset of the real numbers, <br>f(x) = O(g(x)) as x → ∞ if and only if there exists a positive constant C and a constant N such that |f(x)| ≤ C|g(x)| for all x &gt; N.</blockquote><p>Referring back to our example of finding the runtime for method 1, we can set the following:</p><ul><li>f(x) as the overall runtime of the method in terms of x (<em>f(x)=x²+1</em>)</li><li>g(x) as the parent function of the overall runtime (<em>g(x) = x²</em>)</li><li>C as 100</li><li>N as 2</li></ul><p>Now, when we make the substitution into the right side of the bi-conditional statement, we get the true statement:</p><p>|x²+1| ≤ 100|x²| for all x &gt; 2</p><p>Since we were able to find a positive constant <em>C</em> and a constant <em>N</em>, then <em>g(x) </em>is one of our possible runtime. Note that if <em>g(x) </em>were a lower degree polynomial, the inequality would not be true for all values of x past a certain point. In fact, notice that g(x) could have easily been a higher degree polynomial such as <em>g(x)=x³ </em>or even <em>g(x) = x!</em>. This is because that whenever we calculate runtime, we are looking for <em>an </em>upper bound on the limit, not necessarily the lowest <em>upper bound</em>. So, while it is technically correct to say that the runtime for method 1 is O(n³) or even O(2^n), we generally want to try to find the lowest runtime so that the information we have is not only accurate, but useful as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*BToOqfF9fSOWusn4qOsZ9w.png" /><figcaption>Graph representation of the definition pulled from Wikipedia.</figcaption></figure><p>Resources:</p><ul><li><a href="https://justin.abrah.ms/computer-science/big-o-notation-explained.html">Blog on big-O</a></li><li><a href="https://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/">Blog on big-O</a></li><li><a href="https://www.khanacademy.org/computing/computer-science/algorithms/asymptotic-notation/a/big-o-notation">Khan Academy on big-O</a></li><li><a href="http://web.mit.edu/16.070/www/lecture/big_o.pdf">Notes from MIT on big-O</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4555135ee92f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ruby Ancestry]]></title>
            <link>https://medium.com/@hyeokjungkim/ruby-ancestry-d7f5d808e7d7?source=rss-b04f77919689------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7f5d808e7d7</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ancestry]]></category>
            <dc:creator><![CDATA[Hyeok Jung Kim]]></dc:creator>
            <pubDate>Wed, 28 Mar 2018 02:46:34 GMT</pubDate>
            <atom:updated>2018-07-23T13:35:01.393Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.ancestry.com/">Ancestry.com</a> is a website dedicated to the idea of helping people discover their backgrounds on the premise that through knowing their family story, they are able to find out more about their own story. When I first learned about super-classes and modules during our study of Ruby, terms such as “ancestry” and “inheritance” were also used. But unlike Ancestry.com, I couldn’t just simply pay some money to find out more information. In order to find out the full story of Object Inheritance within Ruby, I needed to do some additional research.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PDv1YenTsDduFKXEIjE0nw.png" /><figcaption>Know the story behind your history!</figcaption></figure><p>Before we dive into the depths of Ruby ancestry, we must first set the stage for what an ancestor is in programming. When it comes to family, a direct ancestors might be your grandma, your father or even your great-great grandpa. But for a Ruby class, things are not as clear-cut. While the concept of direct ancestors exist in the form of <strong>super classes</strong>, things like <strong>modules </strong>which aren’t quite as hierarchal can also be part of a class’ ancestry chain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*J1sK7trPMVv6OB-3wv36Wg.png" /><figcaption>Although give_birth is not explicitly defined for our Dog class, an instance of a dog (Spot) can still give birth since Dog inherited the method from Mammal!</figcaption></figure><p>By themselves,<strong> super classes</strong> are no different from regular classes in Ruby; it is only when other classes inherit them (<strong>through the &lt; symbol in its declaration</strong>) that they become part of the classes’ ancestry chain and earn the title of being a super class. But despite what the name might suggest, super classes are no better than regular classes in Ruby. In fact, the classes that inherit the super class (called<strong> sub-classes</strong>) have the slight advantage of inheriting (getting access to) all the methods written in the super class. So, they naturally come with more methods that one might think! For example, if we have a mammal class that has a #<em>give_birth</em> method, any class that inherits the mammal class will also have a #<em>give_birth</em> method.</p><p>A <strong>module</strong>, on the other hand, is different from super classes as it cannot instantiate a new object. However, it still has methods that other classes can inherit several different ways and depending on how the module is incorporated into the class, both the type of methods in the module and the ancestry chain of the class inheriting it can change.</p><p>When a class<strong> include</strong> a module, the methods that it inherits from the module all become instance methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*4RYxmja1Ki42_VJtsIvsbg.png" /><figcaption>When we include a module, the methods in the module can only be called on the instance(s) of a class.</figcaption></figure><p>When a class <strong>prepend</strong> a module, the methods that it inherits from the module all become instance methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*R5LsI04LdChPhqdzMmxNig.png" /><figcaption>When we prepend a module, the methods in the module can only be called on the instance(s) of a class.</figcaption></figure><p>When a class <strong>extend </strong>a module, the methods that it inherits from the module all become class methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*d7KbtPttLitvZJV9iSQnbg.png" /><figcaption>When we extend a module, the methods in the module can only be called on the class.</figcaption></figure><p>But wait! There doesn’t seem to be a difference between including a module and prepending a module. So, why the distinction between the two?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*DHjXKwSWlpNvBvrbsgI6WQ.png" /><figcaption>Since we specifically define give_birth for our Platypus class, that is the one that gets called when we call it on a Platypus instance.</figcaption></figure><p>To delve into the differences, it is worth talking about a few other concepts beforehand — such as the .<strong><em>ancestors</em></strong> method and the overriding of a super class’ methods. Going back to our mammal example, what if we were modeling a platypus which is a mammal that gives birth through the use of an egg? Our #<em>give_birth</em> method from the mammal’s class is not correct for our platypus, so we must write another #<em>give_birth</em> method for our platypus sub-class. In order to do that, we simply write a method with the same name under the platypus sub-class and write the code there. While this does not overwrite the #<em>give_birth</em> method for any other class that inherits the mammal class, for our specific platypus, the #<em>give_birth </em>method defined in the platypus class has a higher priority and is therefore the one that gets called.</p><p>So, let’s do a similar thing for the methods in our modules. In addition to defining the methods in our module, let’s also include a different method under the same name in our sub-class and see what happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*yX8_DALdfyrXJ2PV6_QVsg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*0WA4z9AYACno3Hm6ph72Xw.png" /><figcaption>Notice the difference in what each instance returns when #method is called on it.</figcaption></figure><p>And this right here shows the fundamental difference between <strong>prepend</strong> and <strong>include:</strong></p><p>If you overwrite a function in a class that includes a module, the method in the class takes priority.</p><p>If you overwrite a function in a class that prepends a module, the method in the module takes priority.</p><p>So how does all of this work? Well, it works through the magic of object ancestry! To see the ancestry chain of any class in Ruby, there is a class method called <em>.ancestors</em> which returns an array of something akin to a family tree with the most direct ancestors at the beginning of an array and the faraway ancestors towards the end. So, let’s call <em>.ancestors </em>on our SubClass1 and SubClass2 and see what we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*QDYyjlUCdrmgbdURyj_VUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*JmT9R8L4Q9K5F5c7FM3x6g.png" /><figcaption>Notice the difference in each of the classes’ ancestors.</figcaption></figure><p>Notice here how the order of the ancestors differ between the two classes. In SubClass1 in which we included a module, the SubClass1 was the most direct ancestor. However, in SubClass2 in which we prepended a module, the Methods module was the most direct ancestor. When we call the #<em>method</em> on our instance, Ruby looks in the most direct ancestor for our definition of <em>#method</em>.<em> </em>If the most direct ancestor does not explicitly define the method that we are calling, then Ruby traverses up the family tree until it finds a module or a class that does define the method and then, executes that method.</p><p>This is also how the concept of <strong>super</strong> works. When you invoke super on a method in a class, Ruby looks for a method with the same name in the class directly above it and tries to execute that. So, for our previous examples, if I want to return both “I am defined in the subclass.” and “I am an instance method.” using super, the location of where I would write super would have to be different.</p><p>For SubClass1, I would invoke super in the SubClass1 method as calling it there would tell Ruby to look in the class above it (in this case, our Methods module) and execute the code with the same name. But for SubClass2, I would invoke super in the Methods module since calling it in the SubClass2 method would tell Ruby to look in the Object class for a method with the same name, which does not exist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*-mDbO_j5RMGB5QCE2um0rA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*LBAqiZkLRJT65rhXAQdPqw.png" /><figcaption>Notice the differences in the location of where super is invoked.</figcaption></figure><p>At this point, you might be wondering what the top three classes in each of the ancestor chains are. Nowhere in our code do we explicitly define what an <strong>Object,</strong> <strong>Kernel</strong> and <strong>BasicObject</strong> is, so where are these three classes coming from? And the answer to that lies in the innate structure of Ruby. Since Ruby is an object-oriented language (meaning that everything in Ruby is an object), every class, whether it is explicitly defined or not, inherits some basic methods from the three classes naturally. In other words, Object, Kernel and BasicObject can be thought of as the progenitor for everything in Ruby; they are the superclasses (<strong>Object</strong> and <strong>BasicObject</strong>) and the module (<strong>Kernel</strong>) for every class in Ruby.</p><p>Here are some noteworthy methods from each of the three classes/modules:<br><strong>BasicObject </strong>—</p><ul><li>.new() : Instantiates a new object from a class</li><li>#! : Negates a boolean</li><li>#id : Returns the object_id for a given instance</li><li>#equal? : Returns true if the instance calling it and the argument it receives are the same object</li></ul><p><strong>Kernel</strong> —</p><ul><li>#Array : Returns the argument as an array</li><li>#Hash : Returns the argument as a hash</li><li>#Integer : Returns the argument as a FixNum or a BigNum</li><li>#String : Returns the argument as a string</li><li>#loop : Repeatedly executes a block</li><li>#puts : Prints out the argument(STDOUT)</li></ul><p><strong>Object</strong> —</p><ul><li>#class : Returns the class of the argument</li><li>#is_a? : Returns a boolean if the instance is an instantiation of the argument class</li><li>#methods : Returns an array of all the methods that a class has</li><li>#nil? : Returns a boolean if the instance is nil</li></ul><p>Although I have only mentioned a few of the methods from these three classes, you can see that a newly instantiated class in Ruby comes packed pretty well with lots of basic functions. Without them, much of the code that we write would become non-trivial. So, much like any human, Ruby is a language whose story continues to be very dependent upon its ancestors and what they have provided. And by delving a little deeper into the “family history” of Ruby, I hope that you have figured a little bit more about the ongoing story of Ruby programming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*tT3267Ycg0so4RkbDLSiCQ.png" /><figcaption>Even for a class without any explicit methods, there is a sheer number of methods readily available to it, thanks to Ruby Ancestry!</figcaption></figure><p>Resources/A Little Bit More:</p><ol><li><a href="https://ruby-doc.org/core-2.5.0/Object.html">Object Class</a>, <a href="http://ruby-doc.org/core-2.2.1/Kernel.html">Kernel Module</a>, <a href="http://ruby-doc.org/core-2.2.0/BasicObject.html">BasicObject Class</a></li><li><a href="http://rubylearning.com/satishtalim/ruby_overriding_methods.html">Usage of Super</a></li><li><a href="https://ruby-doc.org/core-2.1.0/Module.html">Ancestor Method</a></li><li><a href="http://gshutler.com/2013/04/ruby-2-module-prepend/">Prepend</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7f5d808e7d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>