Fighter Planes

Fighter planes first caught my interest when I read a book about fictional fighter pilots during the world wars. I will give you a synopsis of the book later.

Fighter Planes

History

Models & Use Throughout Wars

Planes have been an important part of our history ever since the first propeller powered plane, created by the Wright Brothers came into existence in 1903.

As many other scientific discoveries, the airplane too was quickly co-opted for warfare.

Fighter aircraft were first used, in the Italo-Turkish war, in Libya, on October 23rd. The flight was a one-hour long, reconnaissance mission conducted by the Italians. This flight was over enemy posts in Libya. A reconnaissance mission is a mission for gathering information, a spy mission if used to find out about one’s enemy.

Ever since that time more and more advanced fighter planes have been tested all over the world.

One year after the Italo-Turkish war ended in 1913, World War 1 started. During World War 1 the Sopwith Camel F-1 had the most kills to it’s name. It was a British plane. The most famous German plane at the time, was the single-seater Fokker Eindecker.

During World War 2, the most famous British plane was the Supermarine Spitfire. For Germany it was the Messerschmitt Bf 109 and 10. And for America it was the P-51 D-1s.

During the 2nd World War, there were various types of fighters, including the lightweight fighters, the heavy bombers, light bombers which had some bombing capability but were mainly fighters, and the medium bombers which were mainly bombers but had more fighting ability than the heavy bombers. Junkers Jus and the Blackburn Stukas are examples of such bombers.

Heavy bombers were slow and nearly defenseless, so when completing operations they were only sent with a fleet of fighters. These bombers were mainly used for large scale bombing, like the time when the Americans bombed Hiroshima and Nagasaki.

Inspite of their mass production during the World Wars, nowadays the nuclear powered guided missiles that can be equipped on light-weight and speedy fighter jets, have mostly replaced them.

Air Operations

Battle Of Britain

The Battle of Britain was a Nazi bombing campaign against the United Kingdom. The RAF (Royal Air Force), the FAA (Fleet Air Arm) and the Royal Navy fought to prevent the Luftwaffe which is the German Air force, from gaining air superiority. Air superiority implies an advantage over enemies when it comes to air missions.

The Luftwaffewas hoping that after they gained air superiority the United Kingdom would agree to a peace treaty favouring the Axis powers. During the battle, there were many ground, air and navy operations, but we will focus on the air operations only.

During the Battle Of Britain, The Blitz, an operation conducted by the Germans, was their main attempt, to gain air supremacy over the English channel. Air supremacy is the highest degree of air superiority.

This attempt to gain air superiority failed and the Luftwaffe lost a lot of aircraft.

The Blitz mostly damaged London although the bombing was conducted in the whole of the country. It is not clear how long The Blitz lasted but most sources (?) agree that it started on 7th September 1940.

The main reason the Germans wanted air supremacy was to conduct Operation Sea Lion. To gain air superiority the Luftwaffe held major training programs, made new specialized weapons and even modified transport ships.

On 16th July 1940, Adolf Hitler announced the conditions for Operation Sea Lion. They were:

  • The RAF should be ‘beaten down’ so badly that they cannot make an aggressive move.
  • British mines were to be swept away and German mines were to block both sides of the Strait of Dover.
  • The costal zone between occupied France and England must be bombed by heavy artillery.
  • The British squadrons must be damaged or destroyed by torpedoes.

Even though Hitler announced the Battle of Britain after Operation Sea Lion, the operation is still considered a part of the battle, because the battle campaign started before the operation was conducted. However, since the Germans failed to gain air superiority and the operation was postponed by Hitler indefinitely.

Operation Strangle

After Benito Mussolini died in April 1945, the Germans implemented Operation Axis to prevent the Allied forces from getting a foot hold on Italy after Mussolini’s execution.

The Italian Campaign is a series of four strikes conducted by the Allies, to rid the German army from Italy.

Operation Strangle was the fourth airstrike conducted by the allied forces to rid the German army from Italy. The goal of the mission was to bomb and destroy or damage all essential resources en route for the German army, thus forcing them to withdraw from Italy and prevent a ground attack in the U.K.

At first, the Allied powers did not want to send troops into German territory and that was why they executed a pure air operation.

The Allies failed in the overrated objective of the campaign, but they crippled the Germans enough to send troops into the German territory.

The bombing lasted 8 weeks. Throughout that time, supplies for the Germans could not be sent by railways or airplanes and they had to be sent by trucks, further inconveniencing the Germans.

The Commando Series: Battle of Britain Scramble!

The Commando Series is a set of short stories written as comics.

The Battle of Britain: Scramble is collection of these comic short stories set in Europe at the time of The Battle Of Britain, World War 2.

Thrilling dogfights between the ace fighters of the Allied and Axis powers are splattered through the pages of book.

In each story, an R.A.F. pilot, often a beginner or ace, explores the battlefield and learns that being a fighter pilot has more to it than just being good at tactics and technique. Each of the value different aspect of life in the air force.

Although the book has a background theme of Battle of Britain it mostly discusses dogfights, airplanes, engines, and the characters themselves not just as fighters but also as human beings rather than the historical facts and events.

The book points out the pressure on people with ace and veteran family members at the time. Many a time, those who did not follow in their family’s footsteps of being aces and war veterans (especially in those in fields like science and mathematics) felt that they were dull.

In our lives, you may notice fighter aces are acknowledged and respected far more by the general people, than the engineers and scientists who make the flight so smooth and the equipment simpler to operate. One of the stories points out that those who build the equipment, are just as important as those who fly the planes.

Often, a fighter pilot finds himself in a complex ethical or moral dilemma to which he often has to make a just decision in spite of his preconceptions and biases.

Although there is a realistic background, some of the stories explore things like shared thought and spirits.

Fighter Planes Through The Ages

Over the past hundred years fighter planes have not only lost their propellers and replaced them with jet engines, but they also have caught the attention of movie producers and video game creators. I have watched the movie Top Gun many times and my dad bought me a video game in which the player flies an a jet plane called Strike Commander.

John Conway’s Game of Life

John Conway’s Game of Life also know as Life is a zero-player game. Here the link to a site where you can play life on. Life is Turing complete.

Last year, 2020, John Horton Conway, the creator of this game, died at the age of 82 due to COVID – 19.

Alert: Conway’s Game of Life is not to be confused with the Parker brother’s Game of Life.

How to Play Life

The game takes place square 2-D board with infinite area. The board is divided into square cells. Each cell is either dead or alive. Usually dead cells are black, and live cells are white. Each cell has has four diagonal neighbors , two horizontal neighbors and two vertical neighbors. Depending on how many live neighbors a cell has, it either it stays alive or dead, or it is born(from a dead state becomes alive), or it dies. The rules that determine a cell’s future are ˸ˑ-

  1. A cell with less that two neighbors dies as if by under population.
  2. A cell with 4 or more neighbors dies as if by over population.
  3. A cell with two or three neighbors remains the same.

For a cell that is dead:

  1. A cell with three neighbors is born as if by reproduction.

It is important to understand that, cells that are born cannot change the future of neighboring cells in the generation they are born in. Only after that generation, do they help decide weather their neighboring cells live or die.

The player generates the initial pattern of cells called the seed. This is the only input given by the player. After that, the rules of the game decide what happens to each cell. That is why, Life is a zero-player game.

The original seed is generation 0. Following the rules, adjust all the cells. Now you are at generation 1. Repeat the process, and you will see how your initial pattern grows, fades away (shrinks or dies) or stabilises in multiple generations.

A stable pattern, can oscillate between two or more forms, or remain in a single form. A stable not oscillating form is a formation of cells that does not need to be changed by these rules unless mixed up with another formation of cells.

An example of a simple stable form is a block of four alive cells. It dos not oscillate between any number of forms.

A basic oscillator is a straight line(original orientation does not matter) made of 3 cells. If the original line is vertical then it switches between a vertical line and a horizontal line. Otherwise it is the reverse. Here is an example of what a line made of three cells does.

Beehive

A beehive is a stable form, but it does not oscillate between any number of forms. It is the second most common still life, the most common being a 2×2 block of alive cells.

A honey farm is made up of four beehives in fixed positions. Here is an image of a honey farm. It is a variety of still life like the 2X2 block and the beehive.

Honeycomb

A honeycomb is also known as a super beehive. If you look at the dead cells inside the honeycomb you will see the shape of a beehive.

R-petromino

The R-petromino is a famous initial cell configuration. It takes 1103 generations to reach a stable formation.

Some other interesting cell structures are super mango, eleven loop, sidewalk, loaf and pond.

History

After starting his work on cellular automaton rules in 1968, it took a year and a half for Conway to make sure the population of cells can reach a stable form and do not die out too fast.

Life first got some publicity when Martian Gardner published an article about it in the Scientific American magazine, in October 1970. Here is the link to Martian Gardner’s publication.

When Conway was making his game, his main goal was to make the game Turing complete and to make a realistic simulation of over population, under population and birth. He also wanted to make the game totally unpredictable.

Conway found in necessary not to allow explosive growth, but he wanted small patterns to slowly become big. While he wanted the rules to have these constraints, he wanted them to be as simple as possible. Hence, after experimenting with various possibilities, he decided upon the current rules.

The game coming into existence at around the same time as inexpensive computers, increased its publicity, as people could run this game for hours and so the computers would be used at night as well as in the day.

Before Conway made the game with these rules he had made another game with rules for sexual reproduction.

Before being published by Martian Gardner, Conway had created cell structures called spaceships. He had discovered three such structures.

Spaceships

The glider is one of the many, many spaceships. A spaceship is a configuration of cells which move forever, in a certain direction, unless they collide with another configuration of cells. The glider is one of the four discovered spaceships that move diagonally. It was discovered by John Conway and his friend Richard K. Guy. This is an example of a glider.

Each time a glide completes one cycle it moves one cell, diagonally.

The glider is a light weight spaceship. That means that it has very few cells. The glider is the most simple spaceship.

My Analysis

I wrote a program which is a simpler version of the Life. It is played on a fixed sized grid so, eventually, spaceships will come out of the grid.

The code does not use user input to generate the original configuration. Instead it uses a random integer generator that has to choose between 0 and 1. If it chooses 0 the cell is dead and shows up black and if it chooses, 1 the cell is alive and shows up white. Although the code generates the initial pattern of dead and alive cells the user chooses the size of the grid, how many generation they want to run the program for and the time delay between two generation. To explain time delay, suppose we chose the time delay as 1 second. Then after 1 second the first generation configuration gets switched to the second generation configuration. Then again after 1 second the second generation configuration will be switched to the third generation configuration and so on.

Then so that all the cells from the original seed have the same number of nearest neighbors the program adds a string of dead cells on each of the 4 sides of the square.

Here is the code

import random
import math
import os
import time
i = 0
j = 0
one = '\u2588'
i = int(i)
j = int(j)
size = input("How big do you want the seed to be? ")
gens = input(" How many generations do you want to run the Game of Life for? ")
speed = input("How much time delay do you want between two generations  ")
speed = float(speed)
gens = int(gens)
size = int(size)
seed = [[0 for i in range(size)] for j in range(size)]
b = [[0 for i in range(size + 2)] for j in range(size + 2)]
sn = [[0 for i in range(size)] for j in range(size)]
nn = [[[0 for k in range(8)] for i in range(size)] for j in range(size)]
for i in range(size):
    for j in range(size):
        seed[i][j] = random.randint(0,1)
for i in range(size):
    for j in range(size):
        print((one + one) if seed[i][j] else '  ', end='')
    print()
print()

def update(seed):

    for j in range(size + 2):
        b[0][j] = 0
        b[size + 1][j] = 0
    for i in range(size + 2):
        b[i][0] = 0
        b[i][size + 1] = 0

    for i in range(size):
        for j in range(size):
            b[i + 1][j + 1] = seed[i][j]

    for i in range(1, size + 1):
        for j in range(1, size + 1):
            nn[i-1][j-1] = [b[i - 1][j - 1], b[i - 1][j], b[i - 1][j + 1], b[i][j - 1], b[i][j + 1], b[i + 1][j - 1], b[i + 1][j], b[i + 1][j + 1]]

    for i in range(size):
        for j in range(size):
            sn[i][j] = sum(nn[i][j])

def game(seed):

I ran the code a few times. In the simulations below, I have chosen the number of generations as 50 and the time delay as 0.2 in seconds.

First I ran it for a small sized grid. It was 20X20 cells big. In the simulations below, I have recorded my terminal screen.

Note: In the program I chose the cell size to be double the size of the cursor, so that it would be a square. However when I recorded it, the cells were split into half by faint coloured lines you might notice if you look very closely. Please ignore the faint coloured lines if you can see them.

Later I did it for a larger sized grid. It was 40X40.

After doing some more research, I found out about a game which is similar to Life, but you can choose the number of rows and columns of nearest neighbors that effect each cell’s evolution. Suppose we choose the number of nearest neighbors as 3. Here is the program.

import random
import math
import os
import time
i = 0
j = 0
one = '\u2588'
i = int(i)
j = int(j)
size = input("The size of the seed has to be at least a few squares more that the amount of nieghbors you want each cell to have. How big do you want the seed to be?   ")
gens = input(" How many generations do you want to run the Game of Life for?   ")
speed = input("How much time delay do you want between two generations in seconds?   ")
n = input("How neighbors do you want each cell to interact with? The number has to be a positive integer between 2 and 10.    ")
n = int(n)
print(f"{math.floor(((2*n+1)*(2*n+1))/4)}")
c = 0
d = 0
e = 0
f = 0
c = int(c)
newn = 0-n
speed = float(speed)
gens = int(gens)
size = int(size)
seed = [[0 for i in range(size)] for j in range(size)]
b = [[0 for i in range(size + 2*n)] for j in range(size + 2*n)]
sn = [[0 for i in range(size)] for j in range(size)]

for i in range(size):
    for j in range(size):
        seed[i][j] = random.randint(0,1)
for i in range(size):
    for j in range(size):
        print((one) if seed[i][j] else '  ', end='')
    print()
print()

def update(seed):

    for i in range(size):
        for j in range(size):
            b[i + n][j + n] = seed[i][j]

    for i in range(n, size + n):
        for j in range(n, size + n):
            for c in range(newn, n+1):
                for d in range(newn, n+1):
                    if c == 0 and d == 0:
                        sn[i-n][j-n] = sn[i-n][j-n]
                    else:
                        sn[i-n][j-n] = sn[i-n][j-n] + b[i+c][j+d]

def game(seed):
    time.sleep(speed)
    os.system('clear')
    for i in range(size):
        for j in range(size):
            if sn[i][j] < math.floor(((2*n+1)*(2*n+1))/8):
                seed[i][j] = 0
            elif 2*math.floor(((2*n+1)*(2*n+1))/8) < sn[i][j] <= 3*math.floor(((2*n+1)*(2*n+1))/8):
                seed[i][j] = 1
            elif sn[i][j] > 3*math.floor(((2*n+1)*(2*n+1))/8):
               seed[i][j] = 0
    for i in range(size):
        for j in range(size):
            print((one + one) if seed[i][j] else '  ', end='')
        print()
    for i in range(size):
        for j in range(size):
            sn[i][j]  = 0
    update(seed)

i = 0
update(seed)
i=1
while i < gens + 1:
    print(f"{i}")
    game(seed)
    i = i + 1

When you run the program, suppose you choose the number of layers of nearest neighbors as 3. Then each cell will have 48 nearest neighbors. They will be arranged like this, three rows of seven cell above the cell in question, three rows of seven cells below the cell in question, three columns of seven cells at the right of the cell in question and three rows of seven cells to the left of the cell in question as shown in the image below.

All the cells outside the square of nearest neighbors are irrelevant while trying to calculate the life or death or birth of the green cell in the figure above.

After the program generates the grid of live and dead cells, it needs to use reasonable rules to decide the future of the cell. In the rules n is the number of layers of neighbors and sn[i][j] is the number of live neighbors in those layers. These are the rules:

  1. If sn[i][j] <= Floor(((2*n+1)*(2*n+1))/8)the cell will die as if by under population. For n = 1, this evaluates to,cells with less than 2 live neighbors, die. Check this against the previous set of rules. For n=3, this evaluates to, cells with less than 7 live neighbors, die.
  2. If Floor(((2*n+1)*(2*n+1))/8) < sn[i][j] <= 2* Floor(((2*n+1)*(2*n+1))/8) the cell will remain the same. For n = 1, this evaluates to, cells with 2 or 3 live neighbors that will remain the same. Check this against the previous set of rules. For n=3, this evaluates to, cells with more than 6 but less than 13 neighbors that remain the same.
  3. if sn[i][j] > 3*Floor(((2*n+1)*(2*n+1))/8) the cell will die as if by over population. For n = 1, this evaluates to, cells with more than 3 live neighbors that will die. Check this against the previous set of rules. For n=3, this evaluates to, cells with more than 18 live neighbors die.

For a cell that is dead:

  1. If 2* Floor(((2*n+1)*(2*n+1))/8) < sn[i][j] <= 3* Floor(((2*n+1)*(2*n+1))/8) will be born as if by reproduction. For n = 1, this evaluates to,cells with 3 live neighbors that will be born. Check this against the previous set of rules. For n=3, this evaluates to,cells with the number of live neighbors between 12 and 18 that survive.

So, now we will see a video example of the program running with 3 layers of nearest neighbors. In this video, I have chosen the matrix size as 50X50, the number of generations as 100 and the time delay as 0.2 seconds. Here is the video.

If you compare the second video and the third video then you will see they are very different. So, just changing the range of interaction (I. e., the number of cells each cell interacts with) we can generate quite a different type of complex pattern.

These simple rules of the Life allow such complex patterns to emerge. That is the most fascinating thing about it.

Golden Ratio and Fibonacci Number Series

Images from Unsplash

Golden Ratio

History

The Golden Ratio is used in the construction of the pyramids of Giza and many other buildings. It is also used in many artist’s work and designs. The Golden Ratio is used much in art and architecture, because it pleases the human eye. This is because the human eye can interpret pictures and structures which use the Golden Ratio much faster than ones which do not use the the Golden Ratio in their structure or artwork. For example take the Mona Lisa. If you’ve seen it you’ll know how pretty it looks. You think it is pretty because it uses the Golden Ratio in it at multiple levels. So it is easy for your eye to interpret it, which makes you think it is pretty.

But if you are thinking that only humans use the Golden Ratio you are completely wrong. The Golden Ratio can be found in nature just as much as it is found man-made structure and art.

Many mathematicians have published work on it geometrically even before mathematician Pythagoras’s time. Some have gone as far as saying that the Golden Ratio is the world’s most astonishing number.

A Greek mathematician named Hippasus (530 to 450 B.C.E) proved that the Golden Ratio was not a whole number nor a fraction but an irrational number.

Algorithm

Here is how you get the Golden ratio.

Draw a square shown by the red lines in the figure above. Suppose the length of each side is 1. Now draw the symmetrical line that cuts the square in half horizontally. Since the length of one side of the square is one, half of that side must be ½. Now you get two rectangles of length 1 and width ½.

Draw the diagonal of the upper rectangle, as shown by the arrow in the above figure. The length of the diagonal is the √5/2. Place the point of the compass on the bottom end of the diagonal and draw an arc of radius equal to the length of the diagonal. So, every point on the arc is at a distance of √5/2 from the bottom of the diagonal.

You then draw a rectangle with the longer side size 1 on top of the original square, sharing the square’s upper side. The shorter side of the rectangle is drawn by extending the line until it intersects with the arc as shown in the above figure. The red square and the blue rectangle together make up the golden rectangle. The shorter side of this rectangle is 1 and its longer side is √5/2 + ½, so the ratio of the longer side to the shorter side is √5/2 + ½. Now I will explain why.

Consider a rectangle with shorter side a and shorter side a+b. This would be the golden rectangle if, (a+b)/a = a/b. For such a rectangle, if ɸ = a/b, then:

ɸ2 – ɸ – 1 = 0.

There are 2 ways to find ɸ. One of them is solving the quadratic equation ɸ2ɸ – 1 = 0. Solving the quadratic equation yields one positive and one negative value for ɸ. The positive value is the Golden Ratio which is √5/2 + ½. And so, as you discussed at the begging of the section, the ratio of the longer and shorter side is indeed √5/2 + ½.

The other way, is to solve it graphically. Let us see how to do that.

My Analysis

To solve it graphically, I wrote a program. Here is the code.

print("Welcome to the Golden Ratio program. I am going to show you the resuts I get after doing quadratic equation that ives us the golden ratio with a certain number using varios numbers until we find the one that gives us the golden ratio")

def gold():

    upper_limit = input("Give me the upper limit.")
    lower_limit = input("Give me the lower limit.")
    acc = input("Choose the number of data points between 2 consecutive integers.")
    upper_limit = int(upper_limit)
    lower_limit = int(lower_limit)
    acc = int(acc)
    f = open(f"ggraph{acc}.txt" , "w")

    for x in range(lower_limit * acc, upper_limit * acc, 1):

        f.write(f"{x/acc}   {(x ** 2)/acc**2 - x/acc -1}")
        f.write("\n")
    f.close()

tryit = "y"
while tryit == "y":
    gold()
    tryit = input("Type y to try again.")

This code asks the user to input a range of numbers. It then asks the user how many data points they want between two consecutive integers. The code tries to solve quadratic equation ɸ2 – ɸ – 1 = 0.

The code evaluates the left side of the equation for the values of ɸ in the given range. To calculate the Golden Ratio you need to find the value of ɸ for which the left side of the equation is 0, so that the equation is satisfied.

After I wrote the program, I played around with the numbers a bit. Here is the first plot I made. The X axis in the plot represents the value of ɸ which the program plugs into the left side of the equation. The Y axis represents the number that you get from plugging the value of ɸ into the left side of the equation ɸ2 – ɸ – 1= 0 and evaluating it. In green you can see 0. And in purple you can see the results you get from running the program.

Plot of ɸ2 – ɸ – 1 as a function of ɸ

As you can see in the plot above, it is not very clear which point it reaches 0 at, as there are two thousand points along the line shown. So, I zoom relevant part of the plot. You can view the plot in the image below.

Plot of ɸ2 – ɸ – 1 as a function of ɸ

Even now you can seen many, many of points and they are hardly distinguishable from each other. So to find the Golden Ratio I zoomed in to the set of ɸ values for which the left side of the equation evaluates close to 0.

As shown in the plot above, for ɸ = 1.61803 the number you calculate by evaluating the left side of the equation, is a negative number closest to 0. For ɸ = 1.61804 the number you calculate by evaluating the left side of the equation, is a positive number closest to 0. Since the first of these two consecutive ɸ values yields a negative value for the expression ɸ2 – ɸ – 1 and the other one yields a positive value, the ɸ value for which ɸ2 – ɸ – 1 = 0 must lie between them, i.e. 1.61803 < ɸ < 1.61804. Therefore ɸ = 1.6180 up to an accuracy of 4 decimal places.

We can use this method to calculate ɸ up to a higher accuracy by increasing the number of data points calculated by the code, between two consecutive integers.

Now I am going to tell you about the Fibonacci number series.

Fibonacci Number Series

The Fibonacci number series is an addition number series.

History of the Fibonacci

The Fibonacci number series has been found in Indian history especially when people used to speak in Sanskrit. According to Wikipedia some letters in Sanskrit are written is such a way that the Fibonacci series is embedded into them. Although the sequence was not used in Indian mathematics intentionally, Indians was the first in world to use the series. Mostly, the Fibonacci numbers were found in poetry with two syllables of different lengths. Some recorded work on the Fibonacci number series date back to even before 200 B.C.E. This was discovered because an Indian historian named Pingala was trying to read Sanskrit poetry.

Outside India, the sequence first appeared in a book by Fibonacci and that is how the sequence got its name. In the book, it is used to calculate the growth of the population of rabbits in year 1202 A.D..

Nature

The Fibonacci sequence is found in nature. Some examples are the core of a yellow chamomile, the spikes of a pine apple, the arrangement of leaves on the stems of some plants and many other things.

Algorithm

Start with values 0 and 1. The Fibonacci number sequence says that you have to add the previous two integers in the sequence to generate the next one. For example take the first three numbers of the Fibonacci number series. The first one is 0, the second is 1 and the third you need to calculate. To get the third number you add 0 and 1. 0 + 1 = 1. To get the fourth number you add 1 and 1 as they are the 2nd and 3rd terms of the sequence, the two before the fourth term. 1 + 1 = 2 so the 4th term is 2. In this way you can keep going forever.

My Analysis

I wrote a program, that outputs all the numbers of the Fibonacci numbers, up till a limit given by the user.

print("Welcome to the Fibonacci sequence program")

def loop():

    num1 = 0
    num2 = 1
    num3 = 0
    steps = 0
    series = [0, 1]
    i = 0

    limit = input("Give the number you want me to print the Fibonacci sequence till.")
    f = open(f"fb{limit}.txt" , "w")

    limit = int(limit)

    while num3 < limit:

        steps = steps + 1
        num3 = num1 + num2
        print(f"{steps} {num1} {num2} {num3}")
        num1 = num2
        num2 = num3
        series.append(num3)

    for i in range(0,steps + 2):
        f.write(f"{i + 1}   {series[i]}")
        f.write(f"\n")
    print(f" The number of steps less the limit is: {steps - 1}")
    f.close()
tryit = "Y"
while tryit == "Y":
    loop()
    tryit = input("Type Y to explore another Fibonacci series")

This program allowed me to plot the Fibonacci number series up till any number and see how it rises. I played with it. Here are some of the plots I made. In these plots, the y axis corresponds to the numbers in the Fibonacci series while x axis denotes their position in the series. 0 is the first number in Fibonacci series, so on an x-y plane it is x = 1, y = 0. Similarly number 49 is the 8th number in the sequence so on the x-y plane it is x = 8, y = 49. In the plot below I have shown the Fibonacci sequence for numbers till 12,345, which includes 20 terms.

Fibonacci numbers till 12,345

The shape that you can see in the plot is an exponential curve. Did you know that whatever range of numbers you use, you will always get this same shape, meaning, the curve will always look similar. Here are some plots to demonstrate this point. This one shows the Fibonacci numbers from 0 to 3,000,000. This plot includes 32 terms.

4th till 32nd term of the Fibonacci series

Now we will see it in parts. The first part includes numbers from the 4th to the 18th terms of the series.

Fourth till the eighteen term of the Fibonacci series

Here is the next part of the plot which includes all the terms from the 18th term to 32nd term.

18th till 32nd term of the Fibonacci series

In both the parts of the plot and the whole plot you can see that the shapes of the curves are very similar.

Fibonacci Squares

Here we will see how we can layout the Fibonacci number series in squares.

To start we need graph paper. Define the length of the side of a single square cell as length 1. Next draw a square with sides of length 1. Assume the value of length of each side of the square is the Fibonacci number represented by that square. So we get 1. We do not draw 0 as length 0 is length nothing, so it is not shown in the graph.

Box with side length 1

Now on the right side of the square draw another square, the same size as the previous one. From the figure below you can see they share a common side. Since the 1st square has sides of length 1, and both squares are the same size, each side of the second square will also be length 1. So the next number in the series is again 1.

Boxes with side length 1

But after that, if you combine the two squares, you get a rectangle with longer side 1 + 1 and shorter side 1. At first you only had a square with the length of it’s sides 1. So the largest square you could make, which shared a common side with the previous one was a square that was length 1. But now that is not the case. Instead of dealing with a square you are dealing with a rectangle. To make the largest possible square, sharing a side with the rectangle, you need to make from the longer side of the rectangle which is length 1+ 1. 1 + 1 = 2, so the next Fibonacci number is 2.

Rectangle with shorter side length 1 and longer side length 1 + 1 and square with side length 2

Similarly, now you have a rectangle with longer side 2+1 and shorter side length 1+1. Now to get the largest square possible you need to use length 2 + 1 as that is longer than 1 + 1. 2 + 1 = 3. So the next number in the sequence is 3.

Rectangle with shorter side length 2 and longer side length 2 + 1 and square with side length 2 + 1

If you the rules of the process, and you will keep generating Fibonacci numbers . At each step, you make a square, with the longer side of the largest rectangle. Here is a graph that shows the squares for numbers till 21.

Fibonacci numbers represented as squares
Image source Wikipedia

Relation Between the Fibonacci Number Series and the Golden Ratio

Remember how I mentioned two ways to find the value of the Golden Ratio, which are, solving the quadratic equation ɸ2ɸ – 1 = 0 and the other way is to solve it graphically. Let us find the connection between Fibonacci number series and the Golden Ratio.

When you divide each term of the Fibonacci series by the previous term of the sequence, the result will oscillate around the value of Golden Ratio.

I wrote a program that outputs the number you get by dividing a Fibonacci term by the previous one.

import math

def loop():

    num1 = 0.0
    num2 = 1.0
    num3 = 0.0
    steps = 0
    gold = 1.0
    golden = []
    ratio = math.sqrt(5.0)/2.0 + 1.0/2.0
    i = 0
    print(f" The golden ratio is {ratio}")
    limit = input("Give the number you want me to print the Fibonachhi sequence till.")
    f = open(f"goldif{limit}.txt" , "w")

    limit = float(limit)
    num1 = float(num1)
    num2 = float(num2)
    num3 = float(num3)
    gold = float(gold)

    while num3 < limit:

        steps = steps + 1
        num3 = num1 + num2
        gold = num3/num2
        print(f"{gold}")
        golden.append(gold)

        if gold > ratio:
            f.write(f"{steps}   {gold - ratio}")
            f.write("\n")
        else:
            f.write(f"{steps}   {ratio - gold}")
            f.write("\n")
        num1 = num2
        num2 = num3

    print(f" The number of steps less the limit is: {steps - 1}")
    f.close()
tryit = "Y"
while tryit == "Y":
    loop()
    tryit = input("Type Y to explore another Fibonacci series")

The plots below show the output of the code for the first 8 terms, compared to the Golden Ratio.

In green, is the value of the Golden Ratio and in purple is the output of the code.

Comparison of the results of the code and the Golden Ratio

As the series progresses the ratio of two consecutive Fibonacci numbers (larger number divided by smaller number) will get closer to the value of the Golden Ratio. So we are going to zoom in to the last 3 points of the plot, as they will be closest to the Golden Ratio.

Comparison of the results of the code and the Golden Ratio

You can see that none of the points actually touch the line which shows the Golden Ratio, but they come really close to touching it. In this plot, the Fibonacci term that comes closest to the Golden Ratio, is 8th term as only 8 terms have been shown.

Golden Spiral

If you draw the squares whose side length represent the Fibonacci numbers, following the procedure explained in the section titled Fibonacci Squares, and you draw the arc that is tangential to 2 adjacent sides as shown in the figure below, then the shape you get is called the Golden Spiral.

Image of the Golden Spiral

Golden Spiral in Nature

The Golden Spiral can be found in nature. Some examples of such an occurrence are, the arrangement of leaves on trees, the seed arrangement in the pollen of some flowers, and more.

We have shown a connection between two fascinating ideas in mathematics, the Golden Ratio and the Fibonacci number series. I was amazed when I found out that math and art had something in common even though it is not often not considered connected.

Analysis of the Collatz Conjecture

The Collatz Conjecture was proposed by Lothar Collatz in year 1937. The Collatz Conjecture is a very easy to define, and implement for a specific case, but so far no one has been able to prove or disprove it in general.

Algorithm

Defining the conjecture is simple. Take any positive integer. If it is odd, multiply it by 3 and add 1. If it is even, divide it by 2. Keep repeating this until you reach 1. The conjecture says that no matter which number you start with, if you follow the steps, you will always eventually reach 1.

History

In year 1985, J.C.Lagarias proved that the conjecture was applicable to all numbers less that 275,000.

Now many mathematicians think that Math is not ready for such a problem. Though the implementation for a specific number is easy, it is not easy to prove for numbers in general. Such a problem just needs one exception to be false. Yet those who try to solve it cannot stop because it is so engrossing. You just have to find the answer. That is why many people call it the “dangerous problem”.

The reason the Collatz Conjecture is so hard to prove or disprove is that when you are working out the series for a number and you have done millions of steps and it showing no signs of reaching 1, that does not mean in a trillion steps it will not reach one. The Collatz conjecture does not cap the number of steps required for the series of a number to reach one.

But one way to make it easier is, if are working on the Collatz series of a number and at some point in the series you reach a number you have checked before, then you don’t need to go on. Let’s call the number you are implementing the Collatz algorithm on: number A. After some steps you arrive at number B. If you have already proven that number B satisfies the Collatz conjecture, then it follows that number A also satisfies the Collatz conjecture, since after this step the algorithm will follow the same path as it did for number B. For example, suppose you are checking if the Collatz conjecture holds for number 24. Since 24 is even you have to divide it by 2. Half of 24 is 12. But if you have already proven the conjecture holds for 12, you know what the path for 12 is. So then you know that the series for 24 reaches one because in implementing the series for 24 you encounter 12 and you know, the series for 12 reaches 1.

Mathematician Terence Tao has proved the Collatz Conjecture can be applied to almost all numbers. He used partial differential equations as tool in his proof. He split all numbers in three different sets. The first set was was multiples of 3. The second set was numbers, which when divided by 3 had 1 as the remainder. The third set was numbers, which when divided by 3 had 2 as the remainder. He found it easy to prove the conjecture for multiples of 3 but the other sets posed tougher challenges. To find out more here is the link to Tao’s paper.

My Analysis

I started by trying to check the Collatz Conjecture for numbers at random by hand when I first heard of it. I tried to check it for number 27. This one was not easy. After about 20 steps I gave up. The numbers were getting huge and it seemed to go on forever. My mom suggested that I should write a program to do it for me. So I did.

import math

print("We want to examine the Collatz conjecture, and see how the series converges for various numbers")
print("This program generates the list for numbers up to infinity")

def collatz():
    number = input("Enter a positive integer less than 1000:  ")
    number = int(number)
    steps = 0
    highest_number = 0
    odd_steps = 0
    print(f"The number being calculated is {number}")
    f = open(f"collatz{number}.txt" , "w")
    while number >1:
        steps = steps + 1
        if number > highest_number:
            highest_number = number
        else:
            highest_number = highest_number
        is_even = number % 2 == 0
        if is_even:
            number = number/2
            f.write(f"{steps}   {number}")
            f.write("\n")
        else:
            number = 3 * number + 1
            odd_steps = odd_steps + 1
            f.write(f"{steps}  {number}")
            f.write("\n")
    f.close()
    print("This is the Collatz series for the number you have entered")
    print(f"the number of odd steps taken to reach one is: {odd_steps}")
    print(f" the number of steps taken to reach one is: {steps}")
    print(f" the highest number reached is: {highest_number}")

tryit = "Y"
while tryit == "Y":
    collatz()
    tryit = input("Type Y to get the Collatz series of your choice or press any other key to exit:  ")

I tested it for number 12 because that was easy to do by hand. I started running the program for various numbers. Here is the plot for number 37. The Y axis shows the output number, given by the collatz series, for each step, shown by the X axis.

Collatz series plot for number 37

I ran it again and this time for number 55. Here is the plot.

Collatz series plot for number 55

After a little while I decided to do it for 27 because I could not do it by hand. Here’s the plot.

Collatz series for number 27

Then I realized that number 27 had 111 steps. The next time, I ran it for numbers 25, 26, 28 and 29 to see how they converged. In particular, I noted, the highest number reached and the number of steps. Here’s the plot.

Collatz series for numbers 25, 26, 28, 29

As you can see in the plot, even the collatz series for 25, which takes the most steps, only takes 23 steps to reach one. So the highest number reached in the collatz series for 27 is unusually high. The collatz series for 27 also takes unusually long to converge.

Collatz series for numbers 28 and 29

After examining the plots more closely, I realized that the collatz series for 28 and 29 meet at a point, and then the line corresponding to the collatz series for 28 disappears from the plot completely. It puzzled me for a while. But I finally figured out the reason.

This is because once the output of two series coincidentally, reach the same number on the same step, henceforth they both have to follow the path of collatz series of the number they reached. That is why, in the case of 28 and 29’s collatz series by the seventh step, 28 gets hidden under 29, because, their paths overlap.

I continued playing around with more numbers and, to my surprise, found that 12345 took only 50 steps to converge but the numbers around it took approximately 100 steps. But for 12343 it took 262 steps and the highest number is 975,000 which is much higher than the rest.

Colatz series for 12345

Collatz series for numbers 12344, 1236 and 12347
Collatz series for 12343

In the plot above you can see that 12344 and 12346 follow the converge on the same path, after meeting at number below 10,000.

Convergence of the Collatz Series

According to Wikipedia “If one considers only the odd numbers in the sequence generated by the Collatz process, then each odd number is on average ¾ of the previous one.” Here is the link to the Wikipedia page.

To test this theory, I re-wrote the program, to only output the odd numbers of the Collatz series.

import math

print("We want to examine the Collatz conjecture, and see how the series converges for various numbers")
print("This program generates the list for numbers up to infinity")

def collatz():
    number = input("Enter a positive integer less than 1000:  ")
    number = int(number)
    odd_steps = 0
    print(f"The number being calculated is {number}")
    f = open(f"collatz_odd{number}.txt", "w")
    while number >1:
        is_even = number % 2 == 0
        if is_even:
            number = number/2
        else:
            odd_steps = odd_steps + 1
            f.write(f"{odd_steps}   {number}")
            f.write("\n")
            number = 3 * number + 1

    print("This is the Collatz series for the number you have entered")
    print(f"the number of odd steps taken to reach one is: {odd_steps}")
    f.close()

tryit = "Y"
while tryit == "Y":
    collatz()
    tryit = input("Type Y to get the Collatz series of your choice or press any other key to exit:  ")

For comparison, I wrote one more program to generate the geometric series with ratio ¾ for a given start value.

print(" Today we are going to talk about about the 3/4 problem")

def loop():
    number = input("Give me a number:  ")
    number = float(number)
    steps = 1
    f = open(f"CCcompare{number}.txt", "w")
    while number >1:
        f.write(f"{steps}   {number}")
        steps = steps + 1
        number = (number * 3.0) / 4.0
        f.write("\n")
    f.close()
tryit = "Y"
while tryit == "Y":
    loop()
    tryit = input("Type Y to learn the 3/4 series of another number.")

When we multiply something by ¾ we can get floating point values, unlike in the Collatz conjecture in which you only generate positive integers. For example, suppose you choose 16 as the start value. The program will generate ¾ of number 16 which is 12 and then it’ll multiply 12 by ¾ to yield 9 and then it’ll multiply 9 by ¾ and get 6.75 (which is a floating point number) and so on.

Here are some plots I made that compare the collatz series of a number, to the geometric series with ratio ¾ for that number. The picture below shows 2 plots. The green plot shows the geometric series with ratio ¾ for each step and the purple plot shows the Collatz series with only the odd numbers. The images given below show the plots numbers 25, 29 and 37.

Odd numbers from the Collatz series and the geometric series for ratio 3/4 for number 25
Odd numbers from the Collatz series and the geometric series for ratio 3/4 for number 29
Odd numbers from the Collatz series and the geometric series for ratio 3/4 for number 29

The above plots show that the odd numbers generated in the Collatz series more or less, follow the asymptotic trend of a geometric progression with ration 3/4.

Then I repeated the process for number 55 and got a completely different result. It really perplexed me. The Collatz series was going to much higher numbers and taking much longer to coverage than geometric series with ratio ¾.

Odd numbers from the Collatz series and the geometric series for ratio 3/4 for number 37

I realized that the Wikipedia page said that they converged at the same speed on average. So yes there were going to be some exceptions and 55 was on of them. Another is 47.

Odd numbers from the Collatz series and the geometric series for ratio 3/4 for number 55

Even though the Collatz conjecture has not been proved or disproved yet, I enjoyed learning about it because, analyzing the problem, implementing it for different numbers and seeing how the series proceeds was fun.

What You May Not Know About Chocolate

Photo by Charisse Kenion on Unsplash

It began with my mother sending me an email with a video on how chocolate is made. I watched the interesting video, and fascinated, I did some more research and here is what I learned.

History of Chocolate

Cocoa beans were first found in central America 5,000 years ago. It is believed that the Olmecs from Mexico were the first to use cocoa. They used it to make a hot and spicy drink, which is quite similar to hot chocolate.

Then the Olmecs passed chocolate on to the central Americans called the Mayans. The Mayans not only drank the spicy drink of the Olmecs, but also consumed it during religious ceremonies and before making big financial transactions.

Though chocolate was very important to the Mayans, it was available to the rich and poor alike.

Once the Aztecs took over Mexico, they started using chocolate as currency, and it was considered more precious than gold. They believed it was a gift from the gods.

While the Aztecs continued to rule, Christopher Columbus crashed into one of their ships full of cocoa beans and and brought them home to Spain. Once chocolate got to Spain, they started making hot chocolate as we make it now.

In the 1500’s other European countries such as France started exploring central America and also discovered cocoa beans. Soon, chocolate was all over Europe.

In Europe, chocolate was only for the rich and wealthy. It was in 1828 that a new way to use cocoa beans came up. A Dutch chemist named Coenraad Johannes van Houten found that if chocolate was mixed with some alkaline salts and then powdered it would be easier to mix with water. The Europeans called this ‘Dutch Cocoa’. And that is how cocoa powder was invented.

After Dutch cocoa, chocolate was made cheeper and available to almost anyone who wanted it.

Chocolate first came to the thirteen colonies in America when a Spanish trade-ship came to Florida in 1641. Soon after that, in 1682, the first chocolate house was opened there. By 1773 chocolate was all over North America.

In 1876, a chocolatier named Daniel Peter added dried milk powder to chocolate making milk chocolate. After a little help from a friend Hennri Nestle the two of them got milk chocolate into the market. But Daniel’s milk chocolate was very hard. So in year 1879 chocolatier Rudolf Lindt managed to make chocolate so it could melt in your mouth.

Soldiers were paid in chocolate during the Revolutionary Wars. Also, during World War II, soldiers who fought were offered chocolate as rations.

Growing and Fermenting Cocoa in Current Times

Growing

Cocoa cannot grow in farms. It needs the rain-forest climate and trees to be able to grow properly. This is because the pollinators of the cocoa flower are dust-speck size midges that only live and breed in rain-forests. Cocoa flowers can only be pollinated during the day.

The midges aren’t very good at pollinating the cocoa flowers, and total successfully pollinated blossoms are less than one in twenty. To increase the number of pollinated flowers, the farmers use minuscule paintbrushes to pollinate them.

Fermenting

The fruits of the successfully pollinated flowers are opened and the beans are collected. They are wrapped in banana leaves and then kept in boxes. It needs to be dark in the box, so that the bacteria and fungi can thrive.

First in the process, yeast fungi start eating away at the beans. As they do this, the ethanol level rises, until all the bacteria and fungi die out. Only Lactobacillus and Azotobacter which are two types of bacteria, thrive in the new environment. The cocoa is left for 6 days to ferment.

If chocolate is made from under-fermented beans, then it will look gray and taste sour.

Making Chocolate

Chocolate is made at a chocolate factory.

To start the process, the good beans are separated from the stems, broken or open beans. The good beans are taken and roasted for 20mis at 250o. This process kills the bacteria in the beans and makes them easier to break. Once they are roasted, the beans are broken. The shells are thrown away and the nibs are removed. The nibs are put into a machine that separates the cocoa butter from the cocoa solids.

To make dark chocolate and milk chocolate the cocoa solids and a few other ingredients are put together. The difference between dark and milk chocolate is that milk chocolate has more sugar and milk than dark chocolate. But white chocolate is made with the cocoa butter, milk and sugar but not the cocoa solids.

Fun Facts About Chocolate

  • The biggest chocolate in the world weighed about 12,000pounds.
  • Chocolate is made in over 600 different flavors
  • It takes 400 beans to make 1 pound of chocolate.
  • It took 8 years to come up with a recipe for chocolate.
  • Dark chocolate contains heart healthy antioxidants.
  • There is a type of cocoa bean which is red in colour and tastes like wild berries. It is used to make a type of chocolate called Ruby Chocolate.

You can also download the article as book in PDF format by clicking on the download button below.

Maps of the World

It began with my mother and I watching a TV show called The West Wing. In one of the episodes they mention the Mercator and the Gall – Peter map projections which I am going to discuss.

Let’s start with the the Mercator projection.

The Mercator Map Projection


By Strebe from Wikipedia

The Mercator Map Projection was invented by Gerardus Mercator from Germany in the year 1569. Around that time, Europe was trading by sea to many other far away countries by ship. So, The map’s original purpose was for navigation. By having almost no distortion in shape it was perfect for such uses. Nowadays map navigation is uncommon, but softwares such as Google maps, Bing etc, use the Mercator projection. The Mercator Map Projection is a cylindrical projection about 202 by 124 cm.

In the 1500’s this was the only map using magnetic directions, and the first map ever in which the top was North, bottom was South, right was East and left was West.

Though many people thought and still think Mercator’s map is the most realistic and convenient projection, there still are problems with it.

The Mercator Map Projection shrinks territories close to the equator in comparison to those further away from the equator. Most people relate size with importance. Since many countries close to the Equator were less technologically developed than those further away, this representation added to their disadvantage.

For example the map shows Africa and Greenland the same size though in reality Africa is 14 times larger than Greenland.

The Mercator Map Projection cuts off the the last bit of the southern hemisphere to center Europe giving it more importance.

Now let’s discuss the Gall -Peters map projection.

The Gall – Peters Map Projection

By Strebe from Wikipedia

The Gall – Peters Map projection was invented by Arno Peters a German filmmaker, and described by James Gall from, in year 1855, and it was first used in year 1986. The map is a cylindrical projection, about 202 by 124 cm.

Peters’ main goal was for all the territories to get their fair amount of land on the map. This is one of the few successful maps where, the ratio of the areas of all the territories are accurate, while, also being suitable for navigation.

Inspite of The Peters Map Projection showing right proportions of the area of each country it distorts the shape of the land. Peters chosen projection distorts the land near the poles the most.

Even though Peters believed all countries should be ‘area correct’, he chose 45oN/S to have undistorted shape for his map. This choice results in America and Europe being the territories least distorted in shape.

Conclusions

Even if we continue using the Mercator map for navigation and on online maps, we must use Peters’ map for teaching students in schools and collages. Inspite of the Peters map’s shape distortion, it is important that students are taught it, as the importance of size will influence them even more than it would influence an adult. That is why the Peters map is now used to teach students in some parts of the United States America and in the United Kingdom, and it is the goal of the UNESCO to get it to other nations.

The Mercator map should not be the official world map as it distorting of sizes modifies people’s ideas, thoughts and beliefs in the wrong way.

No map is perfect. Mercator gets the perfect shape but badly distorts sizes, while Peter gets the sizes right but the shape and scale are distorted.

US Election and Voting Rules

It started out with me and my mom watching this year’s United States presidential election results. I had never monitored an election before, and I needed a lot of help to understand what was going on. So, my mother had to explain.

Then she suggested that I should write an article on how the election works. So here goes.

Rules to vote

To vote in the US presidential election first, one must have US citizenship and second, one must be 18 or over.

How to vote

The day which the election is held is always the Tuesday after the first Monday in November. The election is held every 4 years.

There are 3 different ways to vote in the election.

  • The first way is in-person voting. In this case, one goes to the polling booth and casts their ballot by putting a mark next to the candidate they want. At some polling stations this is done on a touch screen, but in most it is done with a paper and pen.
  • The next way one can cast ballots is through mail. One has one envelope in which they write their name, address etc. Then they insert a second envelope which has the ballot inside it.
  • The last way is for one to apply for an absentee ballot online, after giving a reason for doing so.
Ballots and polling centres

Vote counting

There are different ways to count the different types of ballots. The in person ballots are scanned and recorded after everyone has voted and left. The process starts when you leave. One’s ballot is scanned and stored on a memory card by a machine.

The memory card is then sent to the people counting the votes. They add your vote to the appropriate candidate.

For mailed ballots the counting process is different. One person scans the information in the first envelope of all the ballots, a second scans the ballots in the second envelope, and finally a third person records the votes for the secret ballot system to work.

When one fills an absentee ballot online one’s vote is directly sent to the counting offices. Here too, first a person records the voter’s information and then someone else records the vote.

Electoral Votes

Whichever candidate gets more votes in a particular state, also gets all the electoral votes of that particular state, except for in Maine and Nebraska, where the electoral votes are split just as they are won. Higher the population of the state, higher the number of electoral votes. Electoral votes rather than popular votes decide the winner. There are total 538 electoral votes in the US presidential election. Whichever candidate gets 270 or more electoral votes, wins the election.

Contingent Election

If there a tie between two or more candidates, there is a contingent election. Then the congressmen from the house elect the winner from the tied candidates.

Recount

But sometimes when one of the candidates wins by a very small margin there is a recount. That means that they count the votes again to make sure that they counted the votes correctly the first time. There are 2 ways to do the recounts.

The first one is called machine counting. In machine counting, machines are used to count votes that were casted on the election day. There are three types of machines used to count the votes. Details can be found here.

The second way to recount is called manual counting. In manual counting, people count the votes. In manual counting, verification papers for each vote are required.

Term Limits

A person can stay president for a limited amount of time. This is called a term limit. A term ends after 4 years and then presidential elections are conducted. A person can serve as president for at most two terms.

Structure of the Periodic Table

Order of energy levels

In Atomic Levels, it was explained that each of of the each of orbitals have a different amount of energy and the electrons hate energy.

That causes the electrons to have a certain order of filling the orbitals from lowest energy to highest energy. The order in which the orbitals fill up is 1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s, 5f, 6d and lastly 7p.

But there are two exceptions, namely Lanthanum and Actinium which I will explain in detail later.

The periodic table

Schematic representation of the periodic table

So let us understand how the periodic table is constructed. The electrons fill up the energy levels in increasing order. The periodic table is constructed by the ascending order of amount of energy.

Now we will learn about the periodic table row by row.

The first row has elements with n=1 corresponding to the innermost orbit. The maximum value l can take is n-1 so for this orbit l must be 0 and the l=0 orbital is called the s orbital. Since m takes values -l to l with l=0, m can take only a single value which is zero. So the only address available to electrons in the n=1 orbit is |n=1,l=0,m=0>. Since the electrons hate each other each such address can accommodate at most 2 electrons of opposite spin. So the n=1 shell can only hold up to 2 electrons. That is why the first row of the periodic table has only 2 elements, namely hydrogen and helium with 1 and 2 electrons respectively.

The second row has elements with n=2 corresponding to the second orbit. The maximum value of l is 1. So m can take all the values from -1 to 1. There are now 2 orbitals s,p. The value of the p orbital has l=1. This row has 8 elements. The first element of this row lithium and the last element is Neon.

The third row has has elements with n=3 l = 0,1. But n =3 also allows for l to take the value 2. The l=2 elements are transferred to the fourth row (I will explain this later). Coming back to this row, the orbitals are s and p. So the maximum value of l is 1. So, m can take values -1 to 1. Just as in the row above, this row also has 8 elements. The first element of this row is Sodium and the last is Argon.

The fourth row includes, elements with outermost shell n = 3 and outermost shell n =4. Going back to the energy levels graph, we see that the 4s has less energy than the 3d. Since the electrons hate energy they fill the 4s orbital before the 3d orbital so in the periodic table the 3d elements are are placed after the 4s ones and before the 4p ones. Elements of the 4f and 4d do not belong to this row. The first element of this row potassium and the last is Krypton.

It the 5th row 4d elements come after the 5s ones just like 3d elements come after the 4s ones in the 4th row. So this row has 5s, 4d and 5p elements. The first element of this row is Rubidium with 37 electrons and the last one is Xenon with 54 electrons.

In the 6th row, we first have the 2, 6s elements. Then we have the first 5d element Lanthanum . After that come all the 14, 4f lanthanides that are represented by a symbol in the image above. The complete list is given separately at the bottom of the periodic table. After that come the remaining 5d elements followed by the 6p ones. The first element of this row is Cesium with 55 electrons and Radon with 86 electrons.

In the 7th row first come the 7s elements. After that we have the first 6d element which is Actinium. Following Actinium come the 14, 5f actinides represented by two symbols. The list is at the bottom of the periodic table. Next come the rest of the 6d elements followed by the by the 7p ones. The first element of this row is Francium with 87 electrons and the last one is Oganesson with 118 electrons.

The π Project

Image by Gerd Altmann from Pixabay

It all started with me doing long division, and Mama asked me to calculate 22/7, which is the commonly used approximation for π. So I did, and here is what I got:

Calculating π using long division

Then I looked up the known value of π on google and found that it was 3.14159265359, and I wasn’t happy with the approximation. So I asked Mama how to calculate π more accurately.

I was learning programming in python with Papa. So she suggested I write a program that calculates π.

π is a number that can be calculated using the Monte Carlo method. Now I will demonstrate.

  1. We will begin with drawing a circle.
  2. Then we have to take this circle and draw a square around it.
  3. Now find the area of the circle of radius.
  4. It is π r2.
  5. Now find the area of the square.
  6. It should be 4 r2.
  7. Now imagine that you randomly drop a few quadrillion grains of sand on the circle and the square.
  8. What are the chances that the sand particles fell in the circle.
  9. Give each grain an address.
  10. Now make two columns one with grains in the circle and one with grains that are not in the circle.
  11. Next divide the grains inside by the total number of grains.
  12. Then the answer is π/4.
  13. Lastly, to get π, we multiply the fraction, four times.

Now I will explain how to check if a point lies inside or outside the circle.

We draw a unit circle on an x y plane so that the center of the circle is at the origin of the plane. Next, we draw a square around the circle as shown in the figure below.

Unit circle in a square

Every point plane can be marked exactly with the two known coordinates of the xy plane. For example, the square’s corners each are at the points:

Top right:(1,1)

Top left:(-1,1)

Bottom right:(1, -1)

Bottom left:(-1,-1)

The unit circle touches the square at 4 points namely: (-1,1), (1,0), (0,1), (-1,-1)

We find the radius of the circle. We figure the answer out by x2 + y2 = r. And since r is is one r2 is also one.

The area of the unit circle is π cm2.

Next we have to find the area of the square. So we have to multiply 2 cm2 by 2 cm2 . So when these two numbers are multiplied they equal 4cm2.

After that, we consider dropping particles in the square. Then we find where in the square the particles are by noting the coordinates. For them to be in the square the x and y coordinates of the points have to anywhere between -1 and 1.

But for the circle there is yet another condition, x2 + y2 <=1.

Going back to points 11,12 and 13 we calculate π.

With the help of my father and mother, I wrote a short program in python 3 that calculates π using this method. Here is the code.

from random import uniform
import sys
for x in range (10, 90, 5):
    circle = 0
    j = int(10 ** (x / 10))
    for i in range(j):
        x = uniform(-1, 1)
        y = uniform(-1,1)
        if x*x + y*y <= 1:
            circle += 1

    print(f'{j} {4*circle/i}')
    sys.stdout.flush()

I ran the program with increasing total number of points in powers of ten. And I saw the greater total number of points the more accurate your answer is when compared to the known value of π.

Now I will show you a plot chart on how close the program I wrote got to the actual value of π in each power of ten with numbers in between from 1000 to 10000000.

Pi value calculated by Monte Carlo method. X axis corresponds to number of points used in Monte Carlo calculation and Y axis shows value of pi obtained. Green line is known value of pi.

This is a fun video, where pi is calculated using the Monte Carlo method but instead of using a computer program to figure out where the random points go, Physics Girl uses darts.