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}')

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.

The Teeny-Tiny Atom

Atoms are the smallest bit of an element that have its chemical proprieties. They are made of 3 smaller particles which are called protons, neutrons and electrons.

The protons have a positive charge and weigh 1 amu, while the electrons have negative charge and are approximately 2000 times lighter than a proton. Also the neutrons have no charge and also weigh 1 amu.

The protons and the neutrons bind forming the nucleus located in the center of the atom. At atom is about a 100,00 times bigger than its nucleus. Atoms are mostly empty space.

Each of the electrons orbit the nucleus. The number of electrons orbiting the nucleus is the atomic number. Every element has a different atomic number.

Number of protons and the number of electrons must be the same, or atoms would be charged particles.

Atoms may have many isotopes. Isotopes differ in the number of neutrons but have the same number of protons and electrons. That means the atomic number is the same for all isotopes. Stable isotopes are not radioactive.

Malory Towers Series Books 1 – 6

Book Deatails:

Author: Enid Blyton

Price: There are 2 omnibuses of 3 stories each that are priced at approximately Rs 395

Buy here: Omnibus 1, Omnibus 2

About The Books.

The Malory Towers series by Enid Blyton is about a young 12 year-old girl named Darrel Rivers, who grows up in an all girls boarding school called Malory towers.

Darrel has a younger sister named Felicity. Darrel tells her sister all about her school. After a few years, Felicity joins Malory Towers too.

Darrel’s school days are filled with tricks, adventures, and games.

The children’s time together is full of fights, fun and friends.

Her new school changes her in many different ways for example she gets better at controlling her temper and becomes more helpful. The other girls too change and grow in many ways as they learn not only french verbs and arithmetic, but numerous life lessons.

Malory Towers had 4 towers located at the 4 corners of the school. The towers house the classrooms and dormitories and enjoy a splendid view of the sea.

Darrel liked all the people in her form except for Gwendoline Mary. Gwendoline was badly spoiled by her parents. She had no friends. Does her experiences and interactions in Malory Towers succeed in improving her? Read on to find out.

Why I liked the books:

I enjoyed all of the books but my favorites were the last two.

The tricks played by the children were very funny the children kept giggling in the time of a particular class helplessly. The children played the most funny tricks on Mam’zelle. The tricks played by Felicity’s form were just as funny too.

I got excited when the when they had midnight feasts.

I enjoyed the few dangerous adventures. They were very engrossing.

Harry Potter And The Prisoner Of Azkaban

Book Details

Author: J.K Rowling

Pages: 320

Ages: 8+ years

Price: Rs. 139 for kindle edition and Rs. 320 for paperback

About The Book:

Harry Potter And The Prisoner Of Azkaban by J.K Rowling is the third book in the Harry Potter series.

A very dangerous criminal from high-security wizard jail called Azkaban escaped and is nowhere to be seen. No-one has ever escaped from Azkaban before. Where could he have gone? What could he be up to? Everyone thinks he is after Harry.

Harry’s broom gets dismembered, and he really needs a new broom. But to his astonishment he gets a Firebolt, the most coveted model among brooms. The packing does not have any name on it. Is it safe? Could it be from the prisoner of Azkaban?

Harry, Ron and Hermione find a map called the Marauder’s map. The map shows where everyone in Hogwarts is. All the secret passages are marked.

Why I Liked The Book:

  • I liked Lupin because his teaching method was different and his classes were more interesting. Every class was a practical which was fun. His classes were scary but with him staying very clam the class could do it that made it quite exciting.
  • I liked the adventures that Harry had at the Leaky Cauldron, because he got to explore the wizarding world without any restrictions. Harry being in grave danger added to the excitement.
  • Every-time Harry went for an adventure with the marauder’s map, I was eager to learn what he would discover.
  • I was amused by the bizarre flavors and varieties of sweets sold at Honey Duke’s sweet shop in Hogsmead.

Harry Potter And The Chamber Of Secrets

Book Details

Author: J.K Rowling

Pages: 256

Ages: 8+ years

Price: Rs. 190 for kindle edition and Rs. 269 for paperback

About the book

Harry Potter and The Chamber Of Secrets is the 2nd book in the Harry Potter series.

Harry meets a creature from the magical world who gets him in trouble with his aunt and uncle, until Harry’s friend Ron Weasley saves the day!

At Hogwarts, there is a new teacher for defense against dark arts who annoys Harry a lot!

A monster is hiding in a secret chamber and it is killing muggle-borns. There’s only one person who can control the monster. A lot of people think it’s Harry but who’s really doing it? Read the book to find out!

Why I Liked The Book

  • I liked the magical creature that Harry met because it was acting very funny.
  • The way Ron rescued Harry was cool.
  • The new defence against the dark arts teacher had a really funny way of speaking and would greet Harry saying “Harry, Harry, Harry.”
  • I was very anxious when the Bludger was chasing Harry and it added to the excitement of the Quidditch match.
  • I liked that at many points in the book I was tricked into thinking I had figured out who is controlling the monster. But I never guessed the real person. It was a big surprise!

Harry Potter And the Philosopher’s Stone

Book Details

Author: J.K Rowling

Price: Rs. 269 for kindle edition and Rs. 299 for paperback

Pages: 352

About the book

Harry Potter And Philosopher’s Stone by J.K Rowling is about a 11 year old boy named Harry Potter who discovers he is a wizard. He learns that the dangerous dark wizard Voldemort attacked him when he was a one year old baby. Although Harry survived the attack, Voldemort killed his parents.

Harry then grew up with aunt, uncle and cousin, who were muggles (non magic people). They hated magic and by extension Harry too. On his 11th birthday Harry was accepted to Hogwarts School Of Witchcraft And Wizardry, where he learnt more about the wizarding world and faced many fascinating challenges. Read the book to find out more!

What I Liked

J.K Rowling creates a fascinating world full of imaginative creatures, spells and magical contraptions. My favorite were the changing staircases which led Harry and his friends to secret new parts of Hogwarts that they could explore.

Harry and his friends got in and out of trouble exploring the intriguing Hogwarts castle and the vast grounds that housed many surprising and even dangerous creatures.

The headmaster of Hogwarts Dumbledore could be funny and still command the respect of his students.

I liked Quidditch. Flying on brooms and tackling multiple balls made it a fun and chaotic sport. The match had some exciting and amusing twists and turns.

A world where school really is a magical adventure!