Monday, September 30, 2013

Factoid #5: math operations

This factoid will talk about operations on numbers.

Operations are things you can do with numbers. Operations can be divided based on how many numbers they operate on.

Unary operators are operators that act on one number. For example, the negative (-) operator returns the negative of a number. Negative of 1 is -1 and negative of -1 is 1.

Binary operators operate on two numbers - addition, subtraction, multiplication and division are all binary operators because they operate on two numbers. For example, 1+2 = 3 and 2 x 4 = 8.

Question: Which of these are unary operations and which are binary operations?


  1. 5 + 6 = 7
  2. abs (-72) = 72 
  3. 4 / 2 = 2
  4. 5 x 6 = 30
  5. 12 - 5 = 7

Addition is when we combine two numbers - if we have 3 apples and get 5 more apples, we have 3 + 5 = 8 apples. Subtraction is the operation of taking away a number from another. If we have 5 bananas, and eat 2 of them, we are left with 5 - 2 = 3 bananas. Multiplication is the operation of repeatedly adding the same number a specific number of times. So if there are 3 people, and we give each 2 balls, they have 3 x 2 = 6 balls in total. Division is the operation of dividing a number of objects into another number. If we have 6 candies, and have to divide them between 2 people how many will each get? 6/2 = 3.

Absolute value is an operation where the absolute value of a number is the positive number that it contains. It is represented by abs() or by two bars | |. For example,
abs(5) = | 5 | =  5
abs(-5) = | -5 | = 5

Here are examples that show the rules of these operations with positive and negative numbers:

5 + 3 = 8 (positive number + positive number = the simple sum of the two numbers)
5  + (-3) = 5 - 3 = 2 (adding a negative number to a positive number is the same as subtracting the absolute value of the negative number from the positive number).
-5 + (-3) = -(5 + 3) = -8 (adding two negative numbers gives a negative number that is the sum of the absolute values of the two numbers.

5 - 3 = 2
5 - (-3) = 5 + 3 = 8
-5 - (-3) = -5 + 3 = -2

5 x 3 = 15
5 x (-3) = -15
-5 x (-3) = 15

12/4 = 3
(-12)/4 = -3
(-12)/(-4) = 3
12/(-4) = -3

Question: solve the following problems:


  1. 7 + 4 = ?
  2. 7 + (-4) = ?
  3. (-7) + (-4) = ?
  4. -7 + 4 = ?
  5. 7 x (-4) = ?
  6. (-7) x (-4) = ? 
  7. 9/3 = ?
  8. (-9)/3 = ?
  9. (-9)/(-3) = ?


The next operation to look at is the power operation. This is the operation that involves repeated multiplication of the same number.  3 x 3 = 9. We can also state this as 3 to the power of 3 = 9 or 3 ^ 2 = 9 or 32 = 9. Similarly, 43= 4 x 4 x 4 = 64. A special case of power is that any number (other than 0) to the power of 0 is 1. So 3^0 = 1 and 4567^0 = 1.

Questions:

  1. 3 ^ 2 = ?
  2. 3 x 2 = ?
  3. 5 ^ 3 = ?


The next operation is called the logarithm operation, which is written as log. In one way, it is the opposite of a power operation.

So, if 10^3 = 1000, then 3 = log101000 (which we read as the logarithm of 1000 to base 10 is 3). Now, the logarithm is also a binary operator, since it operates on two numbers (in the above example, 1000 and the base : 10).

Questions:

  1. log28 = ?
  2. log327 = ?


Another operation related to the power is the root operation - since 3^2 = 9, we say that the second root or the square root of 9 is 3. This is written as √9 = 3. Since 4^3 = 64, we can say that the third root or cube root of 64 is 4. This is written as 3√64 = 4. For the square root, we use the √ symbol by itself. For higher roots like 3rd, 4th and higher, we use symbols like 3√, 4√, etc.

Questions:

  1. √25 = ?
  2. 3√125 = ?
  3. √16 = ?


We will learn many more operations in our future math factoids.

This ends factoid #5 on math operations.




Saturday, September 28, 2013

Factoid #4 : Science and engineering

There was perhaps nothing at the beginning. Around 14 billion years ago, there was suddenly stuff - matter and energy - what we call the universe. Matter and energy responds to external factors like temperature, force and such, but cannot do things by itself. Changes in the universe caused stuff to constantly change - from solid to liquid and gas on heating, and from gas to liquid and solid on cooling. Matter also changed in another way, which involves atoms and elements.

Matter, we now know, is stuff that has mass (or weight). Matter is made of atoms, small particles that were thought to be the smallest particles ever - people thought they could not be divided further, hence the name (atom in greek means 'cannot be further broken into smaller pieces'). Then people found that atoms are themselves made of smaller things.

These smaller things that make up atoms had a property which was named charge, which could be positive, negative or zero. Based on these, there were three kinds of smaller things - protons, which have a positive charge of 1 unit, electrons, which have a negative charge of 1 unit and neutrons which have a charge of zero. All these three particles have weight, with protons and neutrons being about the same weight, and both are much heavier than electrons.

Each atom is made of a very small central heavy thing called the nucleus which contains the protons and neutrons. Around this small nucleus, electrons are moving around. Most of an atom is empty. Also, an atom has the same number of electrons and protons, so the total charge of an atom is always zero. Now, all of matter is made of just 118 types of atoms, called the elements. The thing that distinguishes one element from another is the number of protons (which is the same as the number of electrons). So, the simplest element has one proton and one electron. This is what we know as hydrogen. The next element has two protons and two electrons and is called Helium. This number of protons or electrons in the atom of an element is called that element's atomic number. So, the atomic number of hydrogen is 1. Each element may have zero, one or more neutrons in its nucleus. Other common elements are Carbon (which is found in coal, diamonds and in all living organisms) with an atomic number of 6, Oxygen, with an atomic number of 8, and so on. Each element has a symbol (like a nickname). Hydrogen is H, Helium is He, Carbon is C and Oxygen is O.

Atoms combined to form molecules. For example, two hydrogen atoms combine to form a hydrogen molecule. One atom of carbon combined with two atoms of Oxygen is called Carbon dioxide, two atoms of hydrogen and one atom of oxygen combine to form water, sugar is made of 12 carbon atoms, 22 hydrogen atoms and 11 oxygen atoms combined in a specific way.

While some of the elements can have atoms existing by themselves, most of the stuff we see around us is made of molecules of more than one atom combined. A molecule could be simple like hydrogen or carbon dioxide, with just a few atoms in it, or it could be a combination of several atoms, even thousands of atoms!

As we saw before, in the early universe, matter was changing physically (between solids, liquids and gases). Also, simpler elements like hydrogen and helium gave birth to more complex elements like carbon and oxygen. Since this involved changing the number of protons and neutrons in the nucleus, these were called nuclear reactions. Matter was also changing chemically - where molecules would combine to form other molecules or a larger molecule would break down into smaller molecules - these were called chemical reactions.

With all these changes, more and more complex elements were formed by nuclear reactions and more and more complex molecules were being formed by chemical reactions.

Sometime around 3.5 billion years ago,  something fantastic happened - the molecules combined to form something new - stuff that could do things by itself - this was the beginning of life.

As living organisms grew, they could combine with each other to form more living organisms. Slowly, over millions of years, more and more complex living organisms emerged - and perhaps one of the most complex living organisms are human beings.

Humans are different in many ways, but one of the most important differences about humans is the complex way that they can think. They were able to figure out all these things above (from how the universe began to how life began to how things change - physically, nuclearly and chemically). They were able to use the things they learnt to create new things - while nature has provided us with so many different elements, molecules, energy and forms of life,  humans have been able to create fantastic things based on the power of their mind - from cars to chess to computers to the internet to petrol to tablet computers to medicines to new kinds of living organisms, to all the wonderful inventions we see and use every day.

All this was made possible by the study of how things work around us - and applying what we learned to create new things. This study of how things work is called science - science is divided into physics which is the study of matter and energy, chemistry which is the study of chemical reactions (how molecules combine and break down) and biology which is the study of living organisms. One of the goals of science is to simplify all knowledge into simple principles - called laws of science. The most important tool to learn science and apply it is mathematics.

The study of how we use science to make new things is called engineering or technology. Civil engineering refers to creating structures, like buildings and bridges and roads and railway lines. Mechanical Engineering deals with creating machines like cars and fridges. Electrical engineering deals with creating things like fans, lights and other things that run on electricity. Electronics engineering deals with creating digital machines like computers, phones and tablets. Computer engineering deals with creating programs like games and applications on computers. Medicine is a field of engineering used to study living things and learning how to fix things when they go wrong.

Just as we learnt that all the topics in math are actually related to each other, we will also find that all the topics in science are related to each other. Physics is used in biology. Some areas are common between physics and chemistry. For example, chemistry deals with how heat can be used to change one type of molecule into another type. Physics deals with how moving atoms faster and faster creates heat energy. Biology uses these things to create medicines (which are also molecules) to cure diseases.

This ends factoid #4 on science and engineering.




Wednesday, September 25, 2013

Factoid #3 : Abstraction

You see a red ball - we may say that it is a ball - we know that there are many balls in the world, and this particular ball is one of them. In this example, ball is an abstraction that represents usually round objects, usually used for playing. The particular ball we saw is called an instance of that abstraction.

Abstraction is something humans can understand that most animals don't. There are several levels of abstraction. In the example of the red ball, that specific red ball is a real or concrete thing. A red ball is an abstraction of that specific red ball. The concept of a ball is a further abstraction that includes red balls like that one, but also balls of other colors like green balls, blue balls, etc. The ball itself can be further abstracted into a sphere. There are many spheres in the world - for example, a globe is an instance of a sphere, but it is not a ball. A sphere is itself an instance of a volume. A volume is an instance of a shape. A shape is an instance of geometric concepts. A geometric concept is an instance of a mathematical concept. Each of the above stages was an abstraction of a more concrete concept.

Abstraction is used in several subjects - in language, all words are abstractions of real world things. In math, numbers are abstractions - 2 is an abstraction that applies to instances like 2 apples, 2 books, etc. In computers classes or types are abstractions of things - for example, a card game program may have types like cards, people, scores, and so on.

Question: List ten abstractions related to each of the following:
a) Your car
b) You
c) Bangalore
d) Your favorite toy
e) Your favorite book

This ends factoid #3 about abstractions.

Tuesday, September 24, 2013

Factoid #2: Math

In the last factoid, we talked about languages - most languages that we speak (or write) are vague, which means that we don't have to say things very exactly, and still others will understand what we mean.  Programming languages on the other hand are precise and things have to be written very exactly. The most exact language that we use is called maths, which is the subject of today's factoid.

Numbers are the first thing we learn in maths.

We all use numbers in our daily lives. The first thing we learn is 1, 2, 3, 4, ... -  these numbers are called natural numbers. When we use numbers to count things, like 3 apples or 5 books, we call the numbers as cardinal numbers. When we use numbers to talk about an order - like the second (2nd) book on the shelf or the fifth (5th) student from the left in a row of students, they are called ordinal numbers.

Note that we write numbers starting with the smallest number and increasing from left to right.

In the following list, which sentences use cardinal numbers and which use ordinal numbers?

Question 1:

a) I had two apples for breakfast.
b) Can you please get me the fifth book on the top shelf?
c) I want you to write six sentences about spices.
d) I want three students to step forward.
e) Fourth is the fourth word in this sentence. It was also the first.

After several years of using natural numbers, people realized the need for one additional number to represent nothing - zero. So, we now have 0, 1, 2, 3, 4, ... which are called whole numbers.

When we deal with numbers and operations between numbers, we are studying arithmetic.

When we go beyond actual numbers and start dealing with letters to represent numbers and start performing operations on those symbols, we are now studying a topic in maths called algebra.

Another thing we learn in math is about objects in space - this includes things like points, lines, curves, squares, rectangles, circles, and even volumes like a sphere or a cube. These are studied in the subject of geometry.

Geometry deals with lengths - such as the length of a line, or the side of a square or the radius of a circle.

Geometry also deals with angles - if we take a line and turn it around one point, we get an angle. A special kind of angle that is formed between two perpendicular lines is called a right angle. A triangle that has one of its angle as a right angle is called a right angled triangle or a right triangle.

Angles have special properties, especially when studies as an angle in a right angled triangle. This study of the properties of angles is called trigonometry.

We then study what happens when numbers change - how does one number change when another number changes - for example, if a car is going down a road, how does the position of the car change with time? We study such matters in a math topic called calculus or analysis.

As we learn these subjects, we will see that all these topics are actually 'cheating' us! We will see algebra in geometry, we will see geometry in trigonometry. We will see calculus using geometry, algebra and trigonometry. At the end, all of these are just math - different forms of the same thing. We will learn about each of these things in future factoids.

That ends factoid #2 that introduces the different subjects in math.








Sunday, September 22, 2013

Factoid #1: Languages

This is a new blog which will explore a single fact every day. I have started this blog to impart information to my 6 year old son. This format seems (based on past experiments balancing depth versus breadth) to be a good cadence to share thoughts with my son.

This first factoid is about languages.

There are estimated to be 6000 - 7000 human languages in the world (source). These languages are used for humans to communicate with other humans either in spoken form or through signs. There are also several programming languages - languages used to talk to computers and mobile phones and tablets. One estimate counts about 8500 programming languages (source - zoom in if you cannot see each language name).

It is fascinating that there are more programming languages than human languages, considering human languages have been around since the beginning of human civilization, whereas programming languages began only in the 1930s.

All languages have rules - however, programming languages have more precise rules than human languages. In a human language, the situation in which the language is used plays a key role to understand what is being said, whereas in a programming language, you have to be very specific about what you are saying.  

Most common languages that we use have a spoken form and a written form called script. For example, this page is written in the English written form, and when you read it aloud, you are using its spoken form. Some languages have more than one written form - like Japanese that has three written forms, called hiragana, katakana and kanji.

Written forms of human languages (called scripts) are of two main kinds - sound based written forms, called phonetic scripts, such as in English, and pictorial written forms where each symbol is a picture that depicts a concept, like in Kanji. Sound based scripts are themselves of two kinds - the first is precise phonetic scripts, such as in Hindi and Sanskrit where the written form translates to exact sound as read out. The second is the more complex form found in English, where the spelling itself doesn't translate to a specific sound, unless you know the language - for instance, the word 'the' is pronounced in a way that is not exactly the sounds made by t, h and e. The word 'psychology' has the letter 'p' silent. An interesting consequence of this difference between precise sound based scripts  and more complex ones is that the precise ones can be read out aloud by anyone, whereas the complex ones require you to learn the words and their pronunciations. This is why there are spelling competitions in English where you have to be able to spell words by hearing their sound, whereas a spelling competition in Hindi would be much easier, since the sound would (in most cases) tell you exactly how to write the word.

Programming languages are fun to learn, as the computer does exactly what you say - if you say something wrong, the computer will respond with an error or a wrong response. If you say something correct, the computer will behave as you expect. Some examples of programming languages are C, C++, Java, C#, Basic, Ruby, Python, Perl, Objective C and Lua. We will talk more about programming languages in future factoids.

This ends our first factoid about languages.