Have you heard of elliptic curves before? They are used extensively in number theory and cryptography. The reason elliptic curve cryptography is gaining popularity is because it’s fundamentally much stronger than the RSA algorithm, the algorithm that we all love and adore. If you don’t know what elliptic curves are, just google it and see what they look like. You are reading this sentence without googling it, aren’t you? Okay I’m going to assume that you know what elliptic curves look like. Do they look anything like ellipses? No! So why are they called “elliptic” curves? Continue reading

# Author Archives: Prateek Joshi

# What Is External Sorting?

Sorting is one of the most common things we do in programming. We are given a bunch of numbers and we want to arrange them according to some rule. Let’s say we want to arrange them in ascending order. To sort these numbers, people tend to use a sorting algorithm that takes place entirely within the memory of a computer. The memory we are talking about is the RAM. Here, we take all the numbers and store them in the memory so that we can sort them. This is possible only when the amount of data is small enough to be stored in the memory. What if we have a hundred trillion numbers to be sorted? It’s too big to be stored in the computer’s memory. How do we do it? Continue reading

# What Is A Holomorphic Function?

How do you feel when see the term “holomorphic function”? It just feels like we shouldn’t be looking further into it, right? I mean, it looks like an esoteric mathematical concept that should remain in advanced textbooks. Interestingly enough, holomorphic functions are very useful in real life. Holomorphic functions are ubiquitous in the field of complex analysis. Just to clarify, “complex analysis” doesn’t refer to an analysis that’s complex or difficult. Instead, it refers to analysis of functions of complex numbers. Alright, so let’s go ahead and see how something like this can possibly be useful in real life, shall we? Continue reading

# How Do We Know That There Are Infinitely Many Prime Numbers?

There is a very famous theorem which says that there are infinitely many prime numbers. For people who are new to this, a prime number is a number that doesn’t have any divisors except for 1 and itself. For example, 11 is a prime number because it doesn’t have any divisors apart from 1 and 11. On the other hand, 12 is not a prime number because it is divisible by 1, 2, 3, 4, 6, and 12. Now how do we know that there are infinitely many primes? As numbers get bigger, they tend to have more divisors. So may be at some point, all the numbers can possibly start being composite and they will have a lot of divisors, right? We can delve into a deep mathematical proof to prove this, but let’s take a different route. Let’s see if we can prove this with logic, shall we? Continue reading

# Why Do We Need size_t?

In statically typed programming languages, datatypes play a very important role. Some of common datatypes are int, float, char, double, etc. Different datatypes have different functionalities and we use them depending on our requirements. In modern C++ code, the type “size_t” is used a lot of instead of int or unsigned int. It appears in many different scenarios like parameters to string functions, standard template library (STL), etc. Ever wondered why we need to use it in the first place? Does it have any real advantage? Continue reading

# What Is Zeta Function Regularization?

There is a popular mathematical result which says that the sum of all natural numbers is -1/12. I have discussed it in detail here. This looks very unintuitive to a first time observer. In fact, most people would say that this is some kind of mathematical trickery. How can a bunch of positive numbers sum up to a negative fraction, right? Actually, there is a very real purpose to this whole thing of adding up all the natural numbers to get a negative fraction as the result. However, our general sense tells us that this shouldn’t be possible. The discussion in one of my previous blog posts was about the mathematics involved in this result. This discussion is more about the underlying fundamentals and where these results come from. So how do we explain this situation? Where is it used in real life? Continue reading

# How To Setup Nginx For Load Balancing?

Let’s say that you have a nice idea for a website and you want to host it somewhere to make it available to the users. To do this, you put your website on a server somewhere on the cloud. Then, you purchase a domain name and you redirect all the requests to this server. But you soon realize that you are getting too much traffic, and that your server won’t be able to handle all of it by itself. So you go ahead and get three more servers. Now you want make sure all your servers share the load in a nice way. How will you do that? We would like to avoid the situation where one of the servers is getting all the traffic, and the remaining servers are getting a small amount. That wouldn’t serve our purpose here! So how we do we handle this? Continue reading