Author Archives: k1ngdr3w

Ancient India’s Mathematical Impact On The World

I’ve always wanted to travel to India, and I’m finally getting a chance to visit Chennai (along with some other places) this winter break.  I’ll be teaching my company’s Chennai, India team about service oriented architecture automation – aka boring computer stuff. However, I’ve also set some time aside to go sightseeing on the company’s dime!  We always seem to bring up India-birthed math topics, or mathematicians in class, so I thought it would be very fitting to blog about how India has impacted us!   Make sure you get your Tetanus, Diphtheriaand Typhoid booster shots, this journey may get a little out of hand!

*Spoiler alert: You can’t contract any foreign diseases from a blog post.

When I think of India, computer software, call centers, spicy food, and the Taj Mahal come to mind.  After making my way past these generalizations, I started to see how crucial this South Asian country’s mathematical contributions have been to mankind. India has been credited with giving the world many important mathematical discoveries and breakthroughs – place-value notation, zero, Verdic mathematics, and trigonometry are some of India’s more noteworthy contributions. This country has bred many game-changing mathematicians and astrologists. Over the course of my research I identified the “big three” mathematicians. The first, and arguably most important mathematician and astronomer (Ancient astronomers are similar to modern day astrologist!)  in India’s history, was Aryabhata.  Soon after Aryabhata, came Brahmagupta.  Brahmagupta followed in Aryabhata’s footsteps and built upon some of his more groundbreaking theories. Nearly 500 years later Bhaskara II (Not to be confused with Bhaskara I.) was born. While building upon the mathematical and astronomical work of his forefathers, Bhaskara II also paved his own way to become one of the “greats”. The “big three’s” findings, laid down some of the most vital building blocks in the history of mathematics, but how has that impacted us?

Aryabhata

An artist’s rendition of Aryabhata. Image: Public domain, via Wikimedia Commons.

Aryabhata

We will start off on this journey with Aryabhata (sometimes referred to as Arjehir), a well-known astrologist and mathematician, born in the Indian city of Taregana sometime between 476-550 AD. He lived during a time period we now refer to as “India’s mathematical golden age” (400-600 AD), and it is of no surprise why historians recognize this time period; Aryabhata’s achievements really were golden. He is most noted for dramatically changing the course of mathematics and astronomy through many avenues, which he recorded in a variety of texts.

Sanskrit writing. Image: Diggleburnz, via Flickr.

Sanskrit writing. Image: Diggleburnz, via Flickr.

Over the course of many wars and centuries, only one of Arybhata’s works survived. Aryabhatiya, which was written in Sanskrit at the age of 23, recorded the majority of his breakthroughs. Oddly enough, he only referenced himself 3 times throughout his workWithin this text, Aryabhata formulated accurate theories about our solar system and planets, all without a modern-day telescope. He recognized that there were 365 days in a year. He developed simplified rules for solving quadratic equations, and birthed trigonometry. Aryabhata’s original trigonometric signs were recorded as “jya, kojya, utkrama-jya and otkram jya” or sine, cosine, versine (equivalent to 1-cos(θ) ). He worked out the value of as well as the area of a triangle. Directly from Aryabhatiya he says: “ribhujasya phalashariram samadalakoti bhujardhasamvargah”. This translates to: “for a triangle, the result of a perpendicular with the half side is the area”. Most importantly, in my opinion, he created a place value system for numbers. Although in his time, he relied on the Sanskritic tradition of using letters of the alphabet to represent numbers. Aryabhata did not explicitly use a symbol for zero however. It kind of hard to conceptualize, but none of these things had ever been done, at least to this extent, before.

Brahmagupta

Brahmagupta, an Indian mathematician and astronomer. Image: public domain, via Wikimedia Commons.

Brahmagupta. Image: public domain, via Wikimedia Commons.

Brahmagupta was born in Bhinmal, India presumably a short time after Aryabhata’s death in 598 AD. He wrote 4 books growing up, and his first widely accepted mathematical text was written in 624 when he was only 26 years old! I find it funny that most of the chapters in his texts were dedicated to disproving rival mathematicians’ theories. Brahmagupta’s most notable accomplishments were laying down the basic rules of arithmetic, specifically multiplication of positive, negative, and zero values. In chapter 7 of his book, Brahmasphutasiddhanta (Meaning – The Opening of the Universe), he outlines his groundbreaking arithmetical rules. In the context below, fortunes represent positive numbers, and debts represent negative numbers:

A debt minus zero is a debt.
A fortune minus zero is a fortune.
Zero minus zero is a zero.
A debt subtracted from zero is a fortune.
A fortune subtracted from zero is a debt.
The product of zero multiplied by a debt or fortune is zero.
The product of zero multipliedby zero is zero.
The product or quotient of two fortunes is one fortune.
The product or quotient of two debts is one fortune.
The product or quotient of a debt and a fortune is a debt.
The product or quotient of a fortune and a debt is a debt.

However it seems Brahmagupta made some mistakes when explaining the rules of zero division:

Positive or negative numbers when divided by zero is a fraction the zero as denominator.
Zero divided by negative or positive numbers is either zero or is expressed as a fraction with zero as numerator and the finite quantity as denominator.
Zero divided by zero is zero.

Since our early teens we’ve know anything divided by zero is not zero. When zero is the denominator, the fraction will always “fall over” – that’s how I learned it as a youngin! However, we still have to give Brahmagupta credit, he was so close to getting it all right.

Bhaskara II

Bhaskara II is similar to the other mathematicians we’ve discussed in this post.  He was born in 1114 AD, in modern day Karnataka, India.  He is known as one of the leading mathematicians of India’s 12th century.  He blessed the world with many texts but Siddhanta Shiromani, and Bijaganita (translates to “Algebra”) are the ones that have shined through the centuries.  These specific texts documented some of his more important discoveries. In Bijaganita, Bhaskara demonstrated a proof of the Pythagorean theorem, and introduced a cyclic chakravala method for solving indeterminate quadratic equations:

y = ax2 + bx + c

Coincidentally, William Brouncker was credited for deriving a similar method to solve these equations in 1657, however his solution is more complex. From Siddhanta Shiromani, Bhaskara gave us these trigonometric identities:

 sin(a + b) = sin(a) cos(b) + cos(a) sin(b)
sin(a – b) = sin(a) cos(b) – cos(a) sin(b)

If I had a dollar for every time I relied on these identities, or any of their variations throughout my mathematical career, I’d probably have enough money for a new laptop! Although Newton and Leibniz are credited for “inventing” calculus, Bhaskara had actually discovered differential calculus principles and some of their applications.

A World Without Aryabhata, Brahmagupta and Bhaskara II

I know this is a long shot, but let’s entertain the idea of a world without any of Aryabhata’s, Brahmagupta’s, or Bhaskara’s work.  Granted, future mathematicians would have undoubtedly discovered a portion of the “big three’s” breakthroughs, at least in one way or another. While it’s pretty obvious someone else would’ve invented a number system with a placeholder, or a zero equivalent, it’s not as clear with more complex things such as trigonometry. The foundation built by the “big three” could’ve altered slightly. This alteration could’ve given us a Leaning Tower of Pisa rather than an Eiffel tower – metaphorically speaking, that is. The main point you have to realize is: without the “big three” the progression of mathematics would have been slowed in one way or another, thus effecting our world today. If the “big three” didn’t exist there’s no telling how far back it could’ve set humanity.

That being said, these mathematicians’ theories, methods, and proofs served as building blocks for other mathematicians (globally). If you want to build out a brilliant theorem or proof, you have to start with, or at least incorporate the basics, at some point. Without these basics, the world would have been set back, at least in the realm trigonometry and algebra. It’s hard to imagine using any other number system than what we use today, especially without a numerical placeholder! Young children would be less eager to learn math because writing down large numbers would be a tedious process.  What would we have used in place of zero? What about  math with negative numbers?

Trigonometry electrifies our lives and rings in our ears.  I think it is the biggest part of Aryabhata’s work that we take for granted. Without his trigonometric discoveries we wouldn’t have useful conventional electricity. The natural flow of alternating current, or AC current, is represented by the sine function. Electrical engineers and scientists use this function to model voltage and build the electronics we use every day. Alternating current primarily comes from power outlets, but it can also be synthesized in our electronic devices. Trigonometry is also extremely relevant today in music. Sine and cosine functions are used to visualize sound waves. This is especially important in music theory and sound production. A musical note or chord can be modeled with one or many sine waves. This allows sound engineers to morph voices and instruments into perfect harmony. However, Aryabhata is to blame for all that auto-tuned, T-Pain nonsense we hear on the radio!  Lastly, trigonometry has a strong presence in modern day architecture. It’s a necessity when building complex structures and designs. We’d have to say goodbye to beautiful architecture and reliable suspension bridges if it weren’t for Aryabhata.

References:

http://www.shalusharma.com/aryabhatta-the-indian-mathematician/

http://en.wikipedia.org/wiki/Aryabhata

http://www-history.mcs.st-and.ac.uk/Biographies/Brahmagupta.html

http://www.famous-mathematicians.com/brahmagupta/

http://www.clarku.edu/~djoyce/trig/apps.html

http://www.winentrance.com/general_knowledge/scientists/bhaskara-ii.html

History of Mathematics – BBC:

https://www.youtube.com/watch?v=pElvQdcaGXE

Cryptography – Keeping Our Online Secrets Safe Since the 90s

ElectronicMediaPieChart

A breakdown of time Americans spend with electronic media. Image: Courtesy of http://www.statista.com/chart/1971/electronic-media-use, Felix Richter

We live in an era where the internet is king. Between our cellphones, tablets, game consoles, laptops, and other devices, the average American adult (18+) spends 11 hours per day ingesting electronic media in some way, shape, or form.  I’m sure we can all admit that on a weekly basis we access or create data that we don’t necessarily want the public to see. Whether it be our bank account or credit card information, our Facebook interactions, our emails, our tweets, our PayPal activity, or even our browsing history. That being said, I’m sure some of us take our internet privacy for granted; but how exactly does are internet privacy remain… private? The answer is simple: modular arithmetic. More specifically, cryptographic algorithms.

A History of Cryptography

Cryptography dates back to Egyptian scribes in 1900 B.C., and it was first used in their hieroglyphs. The Egyptians presumably wanted hide the content of their hieroglyphs from others, and they used very basic cryptography to do so. As you can imagine, this whole “keeping a message’s content safe” idea would become widely popular as mankind become more and more intelligent. The Romans, specifically Julius Caesar himself, created the first truly math-oriented cryptography. He used it primarily to protect messages of military significance. Caesar’s cryptographical ideas would later be used to build out modern day cryptography.

There are two main types of cryptography widely used across the web today: symmetric-key encryption, and asymmetric-key encryption (we’ll go into details later, I promise!). Both of these types of encryption rely on modular arithmetic. We must give credit where credit is due. Friedrich Gauss (1777-1855), birthed modular arithmetic in 1801. Believe it or not, this famous mathematician made most of his breakthroughs in his twenties! For those that aren’t familiar with modular arithmetic, here’s a timeless example (pun intended, wait for it…).  The length of a linear line can have a start and end point, or it can go on to infinity in either direction. In modular arithmetic, the length of a “circular” number line is called the modulus. To actually do the arithmetic, consider this example: Take a regular clock (see, here’s the pun!), consisting of the numbers 1-12 . Clocks measure time on a 12 hour time table before starting back over at 1. The modulus for a 12-hour clock is 12 because it has 12 different numbers for the number of hours. To actually do the arithmetic, take this for example: It’s 8PM and we want to add 9 hours (8 + 9 mod 12). 8 +9 equals 17, however when using a modulus of 12, our number line wraps back around after counting to 12. For this we would count forward from 8 – ie. 8, 9 ,10, 11, 12, 1, 2, 3, 4, 5. So, (8 + 9 mod 12) = 5 AM in this case.

Caesar Cipher

CaesarCipher

A basic Caesar Cipher using a left shift of 3. Image: Matt_Crypto, via Wikimedia Commons.

As I said above, the Caesar cipher has acted as a building block for some of our modern day cryptography. Caesar’s main encryption step is incorporated in some of the more complex schemes we still rely on today. However, the Caesar cipher can be easily broken, or decrypted (more on this soon!). This particular cipher is concerned with the alphabet. The theory behind it is replacing each letter in the alphabet with a different letter some fixed number of positions down the alphabet (this is reffered to as the shift). For instance, with a shift of 3, A would replace D, and B would replace E.

Original: ABCDEFGHIJKLMNOPQRSTUVWXYZ

Cipher:   XYZABCDEFGHIJKLMNOPQRSTUVW

This can be represented mathematically using modular arithmetic. The encryption of any letter ‘x” by a shift ‘n’ can be described as follows:

Encryption:

E(x) = (x + n) mod 26

Decryption:

D(x) = (x – n) mod 26

Brute-Force Attacking:

This cipher is extremely easy to break. There are only 26 possible shifts (26 different english letters). When taking a brute-force approach, it’s only a matter of varying through the different shifts until the message is decrypted. In fact, this process could be optimized by analyzing the encrypted string, finding frequently used letters and associating them with common vowels. That way, you could brute force using intelligent shifts. However, this approach would have to be modified when switching between languages.

Cryptography Online

As promised, I will explain the two types of internet cryptography. First, we have symmetric-key cryptography. This is based on the concept that both communicating parties share the same key for encryption as well as decryption. This key is mathematically applied to a numerical equivalent of the data each party is encrypting/decrypting. It is imperative that this key is kept secret. If another party finds out what the key is, none of the encrypted data is safe anymore. Symmetric-key cryptography uses either stream ciphers (encrypt the numerical representation of the data one digit at a time.), or block ciphers (taking blocks of digits, and encrypting them as a whole). Symmetric-key algorithms have an advantage over asymmetric in that they require less computational power.

AsymmetricCrypto

Asymmetric-Key encryption. Anyone can encrypt data using the public key, but the data only be decrypted with the private key. Image: Dave Gothenburg, via Wikimedia Commons.

As for Asymmetric-key cryptography (aka public-key cryptography) we use a slightly different approach. This cryptosystem implements both a private and public key. The public key is used to do the encryption (just like symmetric key cryptography), but the private key is used to do the decryption. The word “asymmetric” stems from the different keys performing opposite functions. This type of cryptosystem is more user friendly, and requires less administration. This is why public-key cryptography is widely implemented across the web.

The RSA Cryptosystem

The RSA cryptosystem is one of the most practical applications of modular mathematics we see today. In fact, if you look at your browser’s address bar right now and you see an “https” at the beginning of your URL, you’re more than likely relying on an RSA encryption to keep your data secure. RSA was created was created in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman at MIT. As far as cryptosystems are concerned, RSA in particular is one of the most straightforward to visualize mathematically. This algorithm consists of three parts: key generation, encryption, and decryption. I will be walking through a widely-used example using 3, and 11. Not only does this process use Gauss’s modular arithmetic, it also uses Euler’s totient function φ(n). (A function that counts the totatives of n – the positive integers less than or equal to n that are relatively prime to n.)

Generating the key is the most confusing part, but here’s a somewhat simplified version (don’t get nauseous!):

  1. Randomly pick 2 prime numbers p and q : p=3 q=11
  2. Calculate the modulus : n = p * q  ->   3 * 11 = 33
  3. Calculate the totient φ(n)  : z = (p – 1) * (q – 1) -> ( 3 – 1) * (11 – 1) = 20
  4. Choose a prime number k, such that k is co-prime to z : k=7
  5. n and k become the public key
  6. Calculate the private key : k * j = 1 mod z | 7 * j = 1 mod 20
  7. In the previous step, we’re only interested in the remainder. Since we’re working with small numbers here, we can say –> 21/20 gives us “some number” with a remainder of 1. Therefore – 7 * j = 21 -> j = 3
  8. j becomes the private key

After the public and private keys are generated, encryption and decryption become easy!  Given P is the data we’d like to encrypt and E is the encrypted message we want to generate:

P^k = E (mod n)  – When P (data we’d like to encrypt) = “14”  We get: 14^7 = E mod 33  So E=20

Given E is the encrypted data we’ve received, and P is the data we want to decrypt:

E^j = P ( mod n) – 20^3 = P mod 33  So P = 14

This proves RSA works!

Does the RSA Cryptosystem Really Keep Me Safe?

Theoretically, a hacker could factor the modulus “n”  in the steps above. Given the ability to recover the prime factors p and q an attacker can compute the “secret exponent” “d” from the public key (n, e). Once the hacker has this “secret exponent”, they can decrypt all data sent with its matching public key. RSA keeps us safe from hackers because there is no known algorithm (The NSA probably has one!) that can factor these large integers in a timely manner. In fact, the largest known number ever factored was 768 bits (232 digits!) long, and this was done with a supercomputer using a state-of-the-art implementation. If that doesn’t make you feel safe enough, RSA keys are typically 1024 to 2048 bits (617 digits!) long, so we don’t need to worry about our data getting hijacked. However it is recommended that we use a value of n that is at least 2048 bits long to ensure the encryption is never cracked.

Sources:

http://en.wikipedia.org/wiki/RSA_(cryptosystem)

http://blogs.ams.org/mathgradblog/2014/03/30/rsa/

http://www.studentpulse.com/articles/41/a-brief-history-of-cryptography

http://www.ti89.com/cryptotut/mod_arithmetic.htm

http://en.wikipedia.org/wiki/Modular_arithmetic

http://cunymathblog.commons.gc.cuny.edu/

How and Why RSA works:

https://www.youtube.com/watch?v=wXB-V_Keiu8

Use Your i-M-A-G-i-N-A-T-i-O-N

It’s kind of embarrassing to admit this as a 24-year-old college student, but I have an imaginary friend. His name is √(-1). He doesn’t keep it as real as some of my other friends, but he’s always my main dude in some of the more complex friendships I get involved in. He’s got a pretty interesting life story, and he’s exceptionally old and wise (imaginary friends never die). He was birthed by the Greek mathematician Heron of Alexandria in the first century A.D. He had a rough childhood (neglected and completely ignored by his father), partially because no one understood him. People ignored him, calling him useless. His name was even meant to be derogatory at one point. √(-1) met Gerolamo Cardano (coined the term “imaginary”), his first true friend, in 1637. After Cardano passed away, √(-1) was lonely until he was accepted into a new circle of friends during the 1700 and 1800s: Leonhard Euler, Carl Gauss, and Caspar Wessel. Although his new friends were a little on the nerdy side, they helped restore his personal image – eventually helping him to become a internationally known, and well respected celebrity.

imaginaryFriends

Image: Matheepan Panchalingam, via Flickr.

Okay, enough with my weird metaphorical stories. I’m here to tell you all about imaginary numbers. Now although the previous paragraph was strange and pretty corny, a lot of truth resides within. Heron of Alexandria was the first known person to have encountered imaginary numbers, back in the first century A.D.¹ He has been called a Greek mathematician, but interestingly enough, we now believe he may have actually been Egyptian.¹ So, how did Heron, the father of imaginary numbers, make such an important discovery? Well, he was trying to find the volume of a frustum of a pyramid with a square base. Specifically a pyramid with a side of the lower base is 28, of the upper 4, and the edge 15. Now the formula to solve this problem, as noted in the Stereometria of Heron of Alexandria is:

equation 1

Using a = 28, b = 4, and c = 15, Heron ultimately reduced this problem to equal √(81 – 144). However instead of writing h = √(-63), he wrote h = √(63).¹  Now whether Heron did this intentionally or not, we’ll never know. What we do know is this: No other scholar even bothered to take notice of these imaginary numbers for at least a thousand years. Believe it or not, from here it took another five hundred years for scholars to start taking imaginary numbers seriously.¹

The Italian engineer and architect Rafael Bombelli started searching for solutions to cubic equations in 1572, and during that time, he started defining some guidelines for using imaginary numbers.5 At this point, most mathematicians didn’t want to believe these numbers were significant, or that they even existed. Bombelli’s “wild idea” – that you could multiply imaginary numbers and end up with a real solution, didn’t sit well with fellow scholars. In fact, Bombelli didn’t even think imaginary numbers could ever have a true purpose, he just viewed them as a useful artifact to solve his equations. Later on, along came Leonhard Euler, a math rockstar in many people’s eyes. Euler really takes the cake here for noticing one of math’s more bizarre imaginary (in a math sense) equations. He showed the world how closely i, e, and π are related and further convinced the math community that i was relevant:Today, this is known as Euler’s identity.

e = cosπ +i(sinπ) 

Which reduces to:

e = -1 + 0

In simpler terms:

e = -1

In 1842 Carl Gauss did the impossible. He actually defined imaginary numbers (although Cardano coined the term “imaginary”.). Later on, once the reality of i was more widely accepted, our understanding mathematics expanded greatly. Euler, Gauss, and Wessel (1700s and 1800s) utilized imaginary numbers and led to the creation of complex numbers, which have a vital importance in math/science today.

Complex Numbers:

Instead of describing numbers and algebraic equations as points on a line, complex numbers and equations become points on a plane. Numbers are two dimensional – just like the integer “1″ is the unit distance on the axis of the “real” numbers, “” is the unit distance on the axis of the “imaginary” numbers. This results (in general) in complex numbers: They consist of two components, defining their position relative to those two axes. We generally write them as “a + bi ” where “a” is the real component, and “b” is the imaginary component.4

imaginary_Real_Graph

A basic graph showing real and imaginary points making up a complex line. Image: Public Domain.

Let me simplify this for you – What this means is that every polynomial equation has roots. Specifically, a polynomial equation in “x” with maximum exponent “n” will always have exactly “n” complex roots.

Me, myself, and i :

Imaginary numbers are more prevalent in the world than you’d think. Without the electronic circuit theories conceived from imaginary numbers, I wouldn’t be typing this blog post, and more importantly, you wouldn’t be reading it. When we plug something into an electrical outlet, we just expect our electronic devices to receive power. In fact, I bet you plugged in your laptop charger today and didn’t even think twice about it. What does exactly does this AC power have to do with imaginary numbers? Everything.

Voltage can be viewed as the amount of force pushing the current through your laptop charger and ultimately into your laptop’s battery. Voltage is a complex number. In fact, if you have a voltage of 110 volts AC at 60 hz (US Standard), that means is that the voltage is a number of magnitude 110. If you were to plot the “real” voltage on a graph with time on the X axis and voltage of the Y, you’d see a basic sine wave. Take the graph below for example:

sin_electricity

Basic sine wave showing only real voltage. Image: Public Domain.

If you decided to put your key in the outlet when the voltage was supposedly zero on the real portion of that graph, you’d still get electrocuted. That’s right, even though real voltage is zero here, “imaginary” electricity can give you quite a shock.3 Take the moment marked t1 on the above graph for example. The voltage at time t1 on the complex plane is a point at 110 on the real axis. At time t2, the voltage on the “real” axis is zero – but on the imaginary axis it’s 110. In fact, the magnitude of the voltage is always constant at 110 volts, and this is an important fact to know.5  All our modern day electronics account for these weird voltage patterns, and strangely enough this imaginary unit is represented with a  “j ” rather than an i (“i ” is used to represent current)!3

All in all, you can thank Bombelli and Euler for introducing imaginary numbers. Not only do they make math more confusing, but they also have many crucial applications in the world around us today.

Sources:

  1. http://press.princeton.edu/chapters/i9259.pdf 
  2. http://www.mathsisfun.com/numbers/imaginary-numbers.html
  3. http://en.wikipedia.org/wiki/Electrical_impedance
  4. http://en.wikipedia.org/wiki/Imaginary_number
  5. http://scienceblogs.com/goodmath/2006/08/01/i/