This Is How Google Calculates Billions Of Search Results, 5 Most Famous Algorithms In Tech

Dhir Acharya - Jun 02, 2019


This Is How Google Calculates Billions Of Search Results, 5 Most Famous Algorithms In Tech

Algorithms appear everywhere, they are simple functions hovering between mathematical problems and computer programs. These are five vital algorithms.

Algorithms appear everywhere, they are simple functions hovering between mathematical problems and computer programs. Today, most consumer technology involves algorithms in its common problems, from using W-Fi to dealing with lost packets, or giving credit-card info to an online shop.

So these are five algorithms that are vital in our life.

Pagerank, used by Google to calculate search results

While Google still keeps a secret about how it organizes search results, the way its search algorithm works went public as far as fifteen years ago.

Google-has-an-algorithm-to-calculate-its-search-results-2
Google has an algorithm to calculate its search results

The core here is the PageRank system, which helped Google quickly dominate the internet search. A decade ago, competitors used human labors for their webpages’ indexes, but the algorithm allowed Google to automatically value websites, giving the company a huge advantage as it grew rapidly.

The algorithm looks at all links to and from every page on the Internet. A link to a page indicates that the page has information that’s worth sharing, and therefore can be considered a vote for its validity. So a page with more inbound links gets higher PageRank.

However, there was another measure: links from pages with a high PageRank will confer a higher PageRank. That means being linked to Stanford the university is much more valuable compared with being linked to by Stanford’s the map shop.

Google-search-results-1
Google search results

Google has also made a lot of tweaks and adjustments to further improve search results, like punishments for ‘link farms’, which are networks of sites linking to each other to increase their PageRank. The tech giant also personalized search results based on what it knows about users’ search history.

Nevertheless, along with the increasing intensity of search demand, the search giant has to adapt. Search Engine Land’s Danny Sullivan said that Hummingbird, Google’s latest update to the algorithm, is built on both new and existing parts. The company released this update so that users can ask the search engine actual questions, instead of merely typing relevant words. Sure, more tweaks will come in the future to deal with new problems, but PageRank will always secure a place at the heart of everything.

Public key cryptography, to keep credit data secure

The term refers to a broad collection of algorithms lying at the heart of virtually all forms of security on the Internet. Public cryptography, using what’s could be ‘magic maths’, allows people to encode data with a key that no one can then decode it.

If user A wants to send a piece of information to user B, which they don’t want anyone else to see, for example, a credit card number A uses to purchase a computer, A has to encrypt it. In the past, A could only do this by sharing a secret: a cipher that only A and B understand. This is the way encryption worked until WWII. However, A and B cannot use an open channel to agree on their cipher. If they can meet in person, it would be easy, but what if A and B are too far to reach each other?

Public-key-cryptography-secures-credit-data-3
Public key cryptography secures credit data

Public key cryptography means A can tell anyone their public key, and that anything encoded using that only him can understand. B sees the key, locks up the credit card data with it, and sends the computer to A. Only B has a second, private key which he can use to decrypt and read the data.

Unluckily, it’s hard to do this every time using a computer’s chip, so there’s another step added in where both A and B use their keys together to create a mutual secret. The shared secret can be used in old-fashioned symmetrical ciphers. However, it’s still about public and private keys.

Correcting errors

When CDs appeared, people thought they were a resilient replacement for cassettes and vinyl, but all those who have played an album that’s carelessly preserved know that’s not completely true.

But it could get worse. It’s a feat to read data correctly from microscopic pits carved on a metal sheet covered with plastic, something that only later-generation optical media can compound and even further shrink the pits.

Error correction is behind such reliability, through using a cunning algorithm that makes CDs readable even when the data stored on them is heavily damaged.

CDs-use-error-correction-4
CDs use error correction

Think of a CD data, in hugely simplified form, as a line of 1s and 0s, like the following:

101

010

000

If the process of reading the CD has an error, one of the 0s may turn into 1. If we don’t use error correction, we can’t tell whether this has happened or not and there would be no way to fix it.

To correct errors, the simplest way is adding another load of data. By counting up each column and row, and if the number of 1s is even, another 1 is added. Otherwise, a 0 is added.

1011

010

0001

000

Now, in case a 0 is misread, the player can use the error correction codes to check and find out there’s a mistake or even the real value. For instance, the player misread the bottom right 0 as 1. Now, when it reads the error correction code for this row, it can tell that there are too many 1s. next, it will conduct cross-check with the error correction codes on each column and find out there’re too many 1s in one column too.

Once the player figures out where the error is, it can go on with playing music.

The applications of error correction are beyond disc drive. Almost all electronic devices that transfer data between places will have error correction, including DSL and WiFi.

Protecting passwords

Sometimes, you need to check if you have received the exact file you expected. Or you’re worried someone has tampered with it. You can do that by looking at its hash.

We don’t have a unique algorithm to make hashes of data, we just make use of any process that can grab data and output something that meets a few criteria.

Algorithms-also-help-in-protecting-passwords-5
Algorithms also help in protecting passwords

If a cryptographic hash function is good, it will generate the same output each time it’s given the same input. If the message changes, the hash will change and it’s almost impossible to work backward from the hash to the message and two messages can barely have the same hashes.

However, hashing data has more uses than checking files: it helps protect passwords.

It’s an awful and undeniable fact that today, you can lose your password at any time, which can cause you a lot of troubles. That’s why companies now don’t keep passwords in plaintext, they hash the passwords the first time users type them and keep that only.

After that, each time the user logs back in, the company takes another hash and compare with the one it stores. If the pair match, that means the password is correct. And if the site is hacked, the attacker only gets the hashes, which they can reverse into passwords.

Perlin noise, to generate landscapes in games

In games, developers can use tech to create terrain, as in Dwarf Fortress or Minecraft. They can just make random noise and use it on a landscape, but that would lead to something that’s too random. So, if you want the terrain to resemble the real world, including hills, mountains, pebbles, and boulders with full effects and various scales, Perlin noise is here to help.

This algorithm creates some random noise at a lot of frequencies, then it smooths it out and adds them together.

A-landscape-generated-by-Perlin-noise-6
A landscape generated by Perlin noise

Comments

Sort by Newest | Popular

Next Story