# Multiplying Even and Odd Numbers

Today I’m going to be showing you what would happen if you were to multiply:

a) An even number by an even number;

b) An odd number by an odd number;

c) An even number by an odd number.

Firstly, let us define what an even number is:

An even number can be described using the expression $2n$, whereby (n) would be a whole number ranging from 0 upwards.

Next, let us define what an odd number is:

An odd number can be described using the expression $2n+1$, and similarly (as is the case with even numbers), (n) would be a whole number ranging from 0 upwards.

Now, since we’ve defined how both even numbers and odd numbers can be described in terms of mathematical expressions, let’s focus our attention on multiplying even numbers by even numbers, odd numbers by odd numbers and even numbers by odd numbers…

Multiplying even numbers by even numbers:

Let’s produce two whole numbers which could be equal to one another or not equal to one another… Let’s call these numbers ${ n }_{ 1 }$ and ${ n }_{ 2 }$.

Using these two whole numbers we can multiply two unknown even numbers by each other in such a manner:

$2{ n }_{ 1 }\cdot 2{ n }_{ 2 }$

This would invariably give us the result $4{ n }_{ 1 }{ n }_{ 2 }=2\cdot 2{ n }_{ 1 }{ n }_{ 2 }$. Now, the product of ${ n }_{ 1 }{ \cdot n }_{ 2 }$ would be a whole number and since this is the case, you would have to say that an even number multiplied by an even number would produce an even number. Let’s not forget that even numbers are multiples of 2.

Multiplying odd numbers by odd numbers:

Once again, let’s come up with two whole numbers which could be equal to one another or not equal to one another… These whole numbers will be ${ n }_{ 3 }$ and ${ n }_{ 4 }$.

This would mean that two odd numbers being multiplied by one another would produce an expression as such:

$\left( 2{ n }_{ 3 }+1 \right) \left( 2{ n }_{ 4 }+1 \right)$

And if we expand the expression above, we’ll get:

$4{ n }_{ 3 }{ n }_{ 4 }+2{ n }_{ 3 }+2{ n }_{ 4 }+1$

Now if we re-arrange the expression above, we can get:

$2\left( 2{ n }_{ 3 }{ n }_{ 4 }+{ n }_{ 3 }+{ n }_{ 4 } \right) +1$

Since the expression $2{ n }_{ 3 }{ n }_{ 4 }+{ n }_{ 3 }+{ n }_{ 4 }$ must be a whole number, you would be forced to conclude that an odd number multiplied by an odd number would produce an odd number.

Multiplying even numbers by odd numbers:

We will for the last time come up with two whole numbers ${ n }_{ 5 }$ and ${ n }_{ 6 }$.

An even number and an odd number being multiplied by one another could be shown using the mathematical expression below:

$2{ n }_{ 5 }\cdot \left( 2{ n }_{ 6 }+1 \right)$

Lazily, we could conclude that an even number multiplied by an odd number would produce an even number. This is because even numbers are all multiples of 2.

Ok… So, let’s summarise what we’ve discovered:

i) An even number multiplied by an even number would produce an even number;

ii) An odd number multiplied by an odd number would produce an odd number;

iii) An even number multiplied by an odd number would produce an even number.

Knowing this we can further strengthen our mathematical reasoning. 🙂

# Binomial Expansions on Python

The other day I was asked to solve a complex probability problem. This probability problem was related to a vocabulary quiz which was being circulated around the web. It is a vocabulary quiz which contains 15 questions with 2 two possible answers to each question. My goal was to simply state the chances of someone (with a terrible vocabulary) answering at least 7/15 questions in this quiz correctly without referring to Google or any other search engine… Their answers to these questions were going to be completely random.

Now, in order solve this probability problem I first had to acknowledge seven essential facts:

1) The person taking this quiz has a terrible vocabulary and just wouldn’t be able to answer any of the questions in this quiz with confidence;

2) The person answering these questions would be providing random answers to them;

3) The person taking this quiz isn’t allowed to use any tools/resources which would help him/her answer these questions correctly;

4) There were only two possible answers to each question (right (R) or wrong (W) answers);

5) Each answer to these questions were mutually exclusive, in other words, selecting the right answer to one question wouldn’t increase your chances of answering any other question correctly ;

6) There were 15 questions in total;

7) A binomial distribution  would be required to solve the problem as there were two mutually exclusive outcomes to each question being answered.

With these facts in mind I knew exactly what I had to do to solve this problem, however, expanding the expression (R+W)^15 was going to be a very tedious task indeed and would require plenty of manual labour.

Was there another way to solve this problem?? Could a computer program help me solve the problem more easily??

Well it turned out that I would be able to solve the problem more easily, but that I’d have to use Python (a high level general purpose programming language) including an “add on” called Sympy to achieve such a feat. So what I essentially did was install both Python(x, y) and Sympy on my Windows laptop.

*You can find out how to download both Python and Sympy by watching the video below:

I then searched “Python IDLE” on my laptop and opened up Python’s shell application. This is what I typed into the application:

If you look at the image above carefully you will see that this Python shell application (thanks to the help of the “add on” Sympy, including some handy code) was able to expand (R+W)^15 for me… In fact, it did it in a split second.

From the moment (R+W)^15 had been expanded, to solve the problem I had been asked to solve, all I had to do was:

i) Sum up the coefficients of the variables (R, W) included in the expansion;

ii) Place this sum (a) under the value of the sum of coefficients sitting beside R variables with exponentials greater or equal to 7 (b) – in a fraction b/a.

This fraction (b/a) would give me the probability / chances of someone randomly being able to answer at least 7/15 questions correctly in the vocabulary test under the conditions which had been set.

a = 2(1 + 15 + 105 + 455 + 1365 + 3003 + 5005 + 6435) = 32,768

b = 1 + 15 + 105 + 455 + 1365 + 3003 + 5005 + 2(6435) = 22,819

b/a = 22,819/32,768 = 0.70 (to 2 decimal places)

Solution to problem: 70% chance

Now the irony of the story is this… I gave myself this problem to solve because my “posh” vocabulary is horrendous. It turned out that I managed to get 9/15 questions in the vocabulary test correct and all my answers were guesses. 🙂