Friday, 25 February 2011

Maths help online - introduction

Before we start I'd like to make it clear that all the posts which follow are designed mainly to help school pupils of average ability. They are not really meant for the small percentage who are high-fliers or have a truly gifted mathematical mind. These pupils will do extremely well anyway and may see the posts as very basic or even trivial by their standards.
The other thing which needs to be pointed out at this stage is that the study of maths is a cumulative process i.e. at each stage it assumes a good command of earlier topics. For example, in arithmetic, you need to understand percentages before you can study problems of compound interest, and trigonometry requires an understanding of graphs and the geometry of triangles. Similarly, in algebra, you have to be able to solve simple linear equations and have an understanding of formulae before moving on to tackle quadratics, and at a higher level the study of calculus presumes a command of a whole range of mathematical skills, including indices, algebraic simplifying, trig. ratios, logarithms, graphs, etc.


There are plenty of analogies and examples of this cumulative process in other fields of activity - e.g. a pianist has to learn things such as musical notation, scales, correct fingering, and posture before becoming a competent performer; to learn a foreign language you have to start with the basics and build up slowly; even in rugby, the game usually goes through several phases before the opponent's line is crossed.  So a steady, progressive and patient build-up is the key to ultimate success.

Wednesday, 16 February 2011

In the beginning

Some algebra basics:

Mathematics has a reputation for being a difficult subject, which tends to put people off studying it beyond school level, but it is in fact a very straightforward and logical subject once you get used to things like using abstract letters (such as x, y, z, a, b, c) to represent numbers, functions, unknowns in algebra,etc. Moreover, its a very versatile subject, and one in which its very useful to have a qualification when the time comes to look for a job.

So lets begin right here by explaining how these letters of the alphabet may be used in algebra.

Letters from the beginning of the alphabet (a, b, c, d, etc) are the ones normally used in algebra as unknowns in simple equations, as letters to be manipulated in 'simplify'-type questions, and as coefficients in harder equations. Letters from the end of the alphabet (x, y, z) usually represent unknown quantities to be solved for. (These are often referred to as 'variables', as opposed to the coefficients, which are constants..)

Here are some examples of each type:-

1. Solve the equation 3x + 2 = 17.

Clearly, the 'x' here represents the number 5, because 3x = 17 - 2 = 15.

[If you don't quite see how to solve this equation, here is the explanation:-

Think of the equation as a pair of scales. We can add the same amount to, or subtract the same amount from,  both sides without upsetting the 'balance', We could also, if necessary, multiply or divide both sides by the same number without upsetting things. So, given  the equation  3x + 2 = 17, you can subtract 2 from both sides without upsetting the 'balance'.  This leads to  3x + 2 - 2 = 17 - 2, which simplifies to 3x = 15. Now divide both sides by 3,  and this gives x = 5.]

2. Simplify the expression 12 a² b³
                                           4ab

In this expression the letters a and b don't stand for anything in particular. They are just entities to be cancelled out to show you understand how to deal with powers (indices) in algebra.

After cancelling out between the top (numerator) and bottom (denominator) of the fraction we end up with 3ab² as the answer. (12/4 = 3 ; a²/a = a ; b³/b = b². Note that you have to deal with each bit separately.)

A word here about 'powers' of numbers or letters. The power of a letter is the number of times that letter is multiplied by itself. So b x b x b x b  would be written as b^4 (read as 'b to the power 4').
Similarly, 7 x 7 x 7 could be written as 7^3 (read as '7 to the power 3') or 7³ (read as '7 cubed')

Powers of the same letter (or number) can be simplified as follows:-
b² x b³  =  b^5, because if you multiply two b's by another three b's you are effectively multiplying five b's together. Hence the final power will be 5.

[Note that the symbol  ^  stands for  'raised to the power'  in this work.]

Similarly in division. b^5 ÷ b^3 = b^(5-3)  =  b^2  or b². 
[because (b x b x b x b x b) ÷ (b x b x b) = b x b  = b², the three b's underneath cancelling out three of the b's of the five b's above]

Indices are thus added when powers of the same letter are multiplied, and subtracted when they are divided. In cases where we are dividing a smaller power by a greater one, we have to introduce a negative index.

E.g. b^3 ÷ b^5  =  b^(3 - 5)  = b^ -2, read as 'b to the power minus two' .

Note that you can't combine powers of different letters. An expression such as a²b³ can't be reduced to anything simpler.

Fractional indices:-

The fractional index ½ stands for 'square root', so that b^½   means 'the square root of b'.

This follows from the rule of adding indices, as b^½  x  b^½  = b^ (½ + ½)  =  b^1  = b.

Similarly, b^ ¼  would mean 'the fourth root of b', as you'd need to multiply b^¼ by itself FOUR times to get just b^1, or b. [b^(¼ + ¼ + ¼ + ¼)  =  b^1]

 As an example of this, 81^¼  =  3, because 3^4  = 3 x 3 x 3 x 3 =  81.

A harder example is 81^¾ , which is a combination of roots and powers. The power ¾ means the fourth root raised to the power 3 (or 'cubed'), so that 81^¾  =  3³  =  27. 

( N.B. 3³  is the same as 3^3)

Powers of letters and their manipulation are an important part of  maths at all levels.


3. The coefficients of an equation are the numbers in front of the unknown letters x, y, etc.

Thus in the equation 5x + 3y = 9, the coefficients will be the numbers 5 and 3.

(Those of you who've done graphs may spot this as the equation of a straight line. Where does it cut the x-axis? Well, put y = 0 for this and you get x = 9/5, or 1.8. Similarly, it cuts the y-axis where x = 0, leading to 3y = 9, so y = 3)

More about equations:-

The simplest kind of equation contains just one unknown in it, as in 3x + 2 = 17 above, where x is the unknown and has to be found.

In the equation 5x + 3y = 9 there are two unknowns, the letters x and y. There's no single solution to this equation, because whatever value you give to x you'll always be able to find a corresponding value of y to fit this equation. 

[E.g. suppose we give x the value 1, then 5x = 5, so in the equation we get 5 + 3y = 9. Subtracting 5 from both sides leads to 3y = 4, and now dividing both sides by 3 gives y = 4/3, or 1.33 (to 2 dec.pl.)]

Graphs:-

Graphs are drawn by first marking out two lines, one horizontally and one vertically, on the paper.
The horizontal one is called the x-axis, the vertical one is the y-axis. Each axis is then marked with  a numbered scale, and to draw the graph of any given equation we mark a series of points corresponding to pairs of numbers, x and y, which fit the equation. This process is called 'plotting'.

[How to plot points:- Suppose we take the pair of numbers x = 1 and y = 1.33 which we found above to fit the equation 5x + 3y = 9. To plot these, go 1 unit along the horizontal (x) axis, then up 1.33 units parallel to the vertical (y) axis, and mark a small cross at the point reached. Do the same for the other pairs of numbers which fit the equation, which are best arranged in a 'table' of corresponding values.]

For simple equations where the graph is a straight line, just 3 points are enough (in fact, two would do, but the third one acts as a check). Such equations are called 'linear'.
But for harder equations such as y = x² - 5x + 6  (an example of a quadratic equation) the graph will be curved in shape, so many more points will need to be plotted for an accurate graph to be drawn.

Simultaneous equations:-

This term is used when we are given TWO linear equations to solve as a pair. In this case there will be just one answer  -   a unique pair of values for x and y which 'fit' BOTH equations (i.e. 'simultaneously').

Here's an example:-

Solve the simultaneous equations   2x  +  y  =  3
                                                            3x  -   y  =  7

Solution:-  Add the two equations together. The +y and the -y will cancel out, leaving 5x = 10, or x = 2.
                Now, to find y, substitute 2 for x in either equation.
                So, if we choose the top one, 2x + y = 3, and put x = 2, we get 4 + y = 3, and subtracting 4    
                from both sides gives y = -1.
                The answer is therefore x = 2, y = -1.

This example was deliberately made easier by having +y in one equation and -y in the other , so they cancelled out when added. But if one equation contained 2y and the other one -y, all terms in the second one would need to be multiplied by 2 so that the -2y would cancel the +2y when added.

Note that it needn't be the y terms which cancel. The x terms can be cancelled as well.

Here's another example to illustrate the method:-

Solve the simultaneous equations      3x  +  2y  =  3
                                                            2x  +  3y  =  7

Neither the x nor the y terms will cancel out as they stand, as they both have different coefficients.
Lets make the x-terms cancel this time.
So a way must first be found to make the number of x's the same in both equations. Then, if we subtract the equations, those letters will cancel out and we can solve for the remaining y's.

This is done by multiplying all terms of the first equation by 2 and all terms of the second by 3.

The equations now become  6x  +  4y  =  6
                                 and         6x  +  9y  = 21

Now both equations contain the term 6x, and these will cancel out if subtracted. Taking the top equation from the bottom one then leads to 5y = 15, so y = 3. The answer for x is then found to be -1 (by substitution in either equation.)

(Note here that subtraction of an equation can be done by multiplying all its terms by -1 and then adding)


Solution by graphs:-

The same problem could also have been solved by drawing the graphs of the two given equations and noticing where they meet, or intersect. Each graph will be a straight line, and they should cross at  the point where x = 2 and y = -1.


An example from Higher maths.


In an equation such as ax + by + cz = d the letters a, b, and c will be the coefficients.

Equations of this kind, with 3 unknowns, may actually represent the equation of a plane in 3-dimensions.
A numerical example would be 2x + 3y + 5z = 30.

I don't want to jump too far ahead here, as this topic is more likely to be found in the syllabus for A-level maths, yet its not too hard to see that by putting x = 0 and y = 0 you get 5z = 30, so z = 6. This means that, if you imagine 3 mutually-perpendicular axes in space, like the 3 edges at the corner of a box, with the z-axis vertical and the other two axes horizontal, the infinite plane represented by our equation will cut the z-axis at z = 6.

In the same way, you can find where this plane would cut the x- and y-axes as well. (Answer given below)


[Answer ; x = 15; y = 10 ]


Well, that completes this introductory section. Just for interest, though, letters from the Greek alphabet are much used in Mathematics, especially at the more advanced levels. What most people don't realise is that you can get the whole Greek alphabet on your computer if you go to Fonts, scroll down, and click on the one called 'Symbol'. Then, as you type out the English alphabet, you'll see the Greek letters appearing instead. You can also get these, and many other special mathematical letters and symbols, on your computer by going to START/All programs/accessories/system tools/character map.

Monday, 14 February 2011

Trigonometry

Trigonometry:-
[The word itself literally means "Three-sided figure measurements". In fact, "trigon" is an archaic name for a triangle.]

At school level trigonometry begins with the study of right-angled triangles, and in particular the ratios (i.e. division) of pairs of its sides for a particular angle in the corner. As the corner angle varies, so will the ratios of the sides.

The actual size of the triangle doesn't matter, so to explain the basic idea of trigonometry we can think of a bicycle wheel spoke of unit length which rotates as the wheel turns anticlockwise, starting with the spoke horizontal and to the right of the axle.. If you then stop the wheel in any position, and measure the angle turned through between the spoke and the horizontal, then the vertical height of the end of the spoke will give a measure called the SINE of this angle, while the horizontal 'shadow' or projection of the spoke gives the value of the COSINE of the angle turned through.

More generally, the three sides of a right-angled triangle are named according to where they are in relation to the corner angle being considered at the time.
The side opposite the angle is called just that, and denoted by the letter O;
The side alongside, or next to, the angle is called the adjacent side, denoted by A;
The side opposite the right-angle is called the hypotenuse, denoted by H.

[You should have met the word 'hypotenuse' when doing the Theorem of Pythagoras, which stated that "the square of the hypotenuse is equal to the sum of the squares of the other two sides". Therefore, for the letters above, H² = A² + O² .]

The ratio (Length of O) ÷ (Length of H) is called the SINE of the angle;
The ratio (Length of A) ÷ (Length of H) is called the COSINE of the angle;
The ratio (Length of O) ÷ (Length of A) is called the TANGENT of the angle.

[Note here that the word 'tangent' doesn't now mean a line touching a circle or curve, which is what you've probably met before.]
If we call the angle ß, (Greek letter BETAthese ratios can be written as:-

Sin ß = O/H ; Cos ß = A/H ; Tan ß = O/A
  
(Don't forget that Greek letters are used a lot in maths, and also in science, and you can get the whole alphabet from your list of fonts if you scroll down to the one called 'symbol'. Some of them, such as ß and µ, can also be found in the list of alternative characters, using the ALT key.)


Now for a numerical example:-

Imagine a right-angled triangle with an angle of 60º in the bottom left-hand corner ( and therefore 30º in the other corner, since the three angles of a triangle have to add up to 180º).
[This can be thought of as an equilateral triangle cut in half down the middle.]

In this triangle, if the length of the long side is 2 units, the short side will be 1 unit (being half the base of the equilateral triangle), and by Pythagoras's Theorem the third side will be of length 'sq.root of 3', or 1.732 units (to 3 decimal places).

So for the 60º angle in the bottom left-hand corner, the adjacent side will have a length of 1 unit, the hypotenuse will be 2 units, and the opposite side will be 1.732 units.

We are now in a position to talk about the three ratios (sin, cos and tan) for the angle 60º using actual lengths.

Here are those three ratios for the angle 60º:-

sin60º = O/H = 1.732 ÷ 2 = 0.866
cos60º = A/H = 1 ÷ 2 = 0.5
tan60º = O/A = 1.732 ÷ 1 = 1.732
 Using the same triangle, if we now turn our attention to the 30º angle, the side adjacent to the angle will now be the one of length 1.732, and the opposite side will have length 1.
(The hypotenuse, being the side opposite the right-angle, remains unchanged at 2 units long.)

So sin 30º  , which =  O/H, will now be 1 ÷ 2  , which  =  0.5 , because the side opposite the 30º angle has now changed to the 1 unit length.

Similarly, the side of length 1.732, which was opposite the 60º angle, is now adjacent to the 30º angle, so in the formula for cos 30º we put A = 1.732 and H = 2.

Then we get cos 30º = A/H  =  1.732 ÷ 2  = 0.866

Exercise:-

Draw a right-angled triangle with a hypotenuse of length 5cm and any size angle in the lower corner.
Now measure this lower corner angle with a protractor, and also the lengths of the other 2 sides of the triangle.

Divide the length of the side opposite the lower corner angle by 5 and compare your answer with the value of the sine of the angle as given by your sine tables or calculator.

For example, if you found the corner angle of the triangle you'd drawn was 23º, you should find that dividing the opposite side by the hypotenuse gives an answer of about 0.4  (or 0.39, to be more accurate).

You can practice this for different shapes of triangle provided they all have a right-angle in one corner, in each case measuring the lengths of the sides and dividing them as above, then comparing your answers with the values given by tables or calculator for the sine (or cosine or tangent) ratios of the angles of your triangle.
 
 
 
 

Saturday, 12 February 2011

How to Master Maths - Calculus

 Calculus is essentially the study of rates of change. We're all familiar with rates of change in everyday life, even if we don't always realise it. E.g. speed is a rate of change - its the rate of change of distance with time.
Gradient (or slope) is another example of a rate of change - its the rate of change of height(y) with distance travelled horizontally(x).

The mechanics of obtaining a rate-of-change function from the function itself is not inherently difficult. There are simple rules which apply. Here are some examples for functions which are powers of x :-

1. If a curve has equation y = x², its gradient at any point will be 2x. [e.g. if x = 3, then y = 9 and the gradient will be 6]

2. If the curve equation is y = x³, its gradient at any point will be 3x².[e.g., if x = 2, then y = 8 and the gradient will be 12]

3. If y = 5x³ + 7x² - 2x + 19, then the gradient = 15x² + 14x - 2.
(Note here that x changes to 1 and pure constants, such as 19, change to 0. So -2x + 19 became just -2]


4. For an equation y = x^7, the gradient is given by 7x^6, and so on.

In general, for a function x^n, the gradient will be given by nx^(n-1)
[ Note - x^n is read as x to the power n, or simply x to the n.
Similarly, nx^(n - 1) is read as nx to the (n - 1), but remember that here its only the x which is raised to the power, as the n in front is just a multiplying number.

The rule for powers of x is simply to bring the power down in front of the x and reduce the power of x itself by 1.

For the sake of mathematical correctness at this stage I should point out that this process of deriving a rate-of -change function is called 'differentiation'. You may see books referring to it as 'finding the derivative' or 'finding the derived function'.
There is more than one way of expressing problems of diffferentiation.
Take the equation y = x³, for which we saw dy/dx = 3x².
A problem based on this could be worded in any of the following ways:-
 

a. If y = x³, find dy/dx.
b. If f(x) = x³ , find f '(x)
c. Find the derived function of y = x³.
d. Differentiate y = x³

In example b the derived function is written f '(x), read as 'f dashed x'.

In the same way, if we were dealing with some other function such as g(x), its derived function could be written as g'(x), read as 'g dashed x'.

The notation dy/dx is read as 'dee-y by dee x' (which I suggest you think of as a 'diminutive bit of y' divided by a 'diminutive bit of x')

So differentiation of powers of x decreases the powers.

Some other kinds of function:-

The derived function of sinx is cosx ;
" " " " "        "        cosx is - sinx;
" " " "          "        tanx  is -sec²x
" " "            "        lnx  is 1/x
" " " "         "       e^x  is e^x (no change)

(The reverse process, which we'll come to later, is called 'integration', and this process increases the powers.)

In the first paragraph above we began by mentioning speed as an example of a rate of change. If it is speed we are dealing with, the letters s and t are used to denote distance and time, and the sort of equation to be differentiated might look like this :- s = 2t + t³.
The answer required is ds/dt = 2 + 3t².


A personal view :- Just about every explanation of calculus I've seen in books begins with text and diagrams which involve 'strange' notation, such as ðx and ðy, and talk about 'increments shrinking to zero'. This is, of course, perfectly correct, but the wisdom of introducing such mathematical rigour at the very start of a new topic has to be questionable.

So my approach would be to get the mechanics of differentiation established first. The theoretical explanation of where the rules come from and why it works can come a bit later, after the students have gained some confidence in handling these hitherto unfamiliar processes.

Now for a brief word about the process known as 'integration', which is the reverse of differentiation. It is in fact the process of finding 'what has been differentiated' to result in the given function.

So if differentiation changes x² into 2x, integration will say that the integral of 2x is x².
Actually the full answer is x² + c, where c is a numerical constant.
This would be written as ∫2x.dx = x² + c.
Why do we have to write the '+ c' part?  Well, because there could have been a number added on to the x² before it was differentiated, as this number would have disappeared under differentiation, because a number doesn't have a gradient. (The graph of y = 4, for example, is a horizontal line, which, like a flat road, has no gradient. The same goes for y = any other number. This other number is the c we've tagged on to the x².)

Whenever so-called indefinite integration is done you automatically add a c in this way. In particular cases you may be given some extra information to enable the actual value of c to be calculated, but otherwise just leave it as c.
Integration is called definite when numerical limit values are given, attached as small numbers at the bottom and top of the integration sign. What happens in such cases is that you first of all do the integration process, then evaluate your answer for each of the two given numbers, and subtract one valuation from the other (lower from upper).

Integration is even more powerful than differentiation, as it can be used to find areas, volumes, centres of gravity, and in many other ways..
 
 
 
 

Monday, 7 February 2011

 
The Maths of Codes
 
In this section I'll explain how to code messages using prime numbers
combined with modulo (clock-face) arithmetic and powers of numbers.
 
 
In school we all learn about prime numbers, factors and indices but are rarely shown how they can be useful in real life. The same can be said of clock-face arithmetic. I've chosen coding as an example of how these can all be relevant in the modern world.
Let's start with some simple basics. If you already understand a fair bit about these topics, you can skip the next few paragraphs and go straight to their application in coding messages.
..............................................................................................................................................
Prime Numbers:-
These are numbers which have no other factors except themselves and one. E.g. 2, 3, 5, 7, 11, 13, 17, etc.
(In contrast, a number like 12 isn't a prime number because several smaller numbers, such as 2, 3, 4, and 6 will divide into it an exact number of times.)
The prime numbers above 2 must all be odd numbers, as all even numbers can be divided by 2.
Factors:-
As stated above, 12 is not a prime number. Broken down into its prime factors it can be written as 2 x 2 x 3, or 2² x 3.
The HCF (highest common factor) of two numbers is the largest number which will divide into both of them. For example, the HCF of the numbers 24 and 30 is 6, because 6 is the largest number which goes into both 24 (exactly 4 times) and 30 (exactly 5 times.)
(Method:- 24 has prime factors 2 x 2 x 2 x 3 and 30 has prime factors 2 x 3 x 5; the factors in common are 2 x 3, which make 6.)

Note that 2 x 2 x 2 x 3 is more usually written as 2³ x 3. Powers and indices are dealt with in the next sections.
 
Powers of a number:-
When you multiply the same number by itself several times, such as in 2 x 2 x 2 x 2, the number 2 is said to be 'raised to power 4' because that's how many 2's are being multiplied. This can be written as 2^4
Similarly, 7 x 7 will be 7 to the power of 2, or 7^2, or7², more usually called '7 squared', and 7 x 7 x 7 would be 7 to power 3, written as 7^3, 7³, or '7 cubed'.

Rule of Indices:-
When you have the same number raised to two different powers and you then multiply them, the powers are added. E.g. 2² x 2³ = 2 to the power 5, because 2 + 3 = 5. Why is this? Well, 2² means 2 x 2 and 2³ means 2 x 2 x 2. If you multiply two 2's together and then multiply the answer by another three 2's that's like multiplying five 2's altogether, hence the power of 5.

If raising a power of a number to another power, you have to multiply the indices. Here's an example to show how it works:-

(2²)³ means 2² x 2² x 2², which is 2 x 2 x 2 x 2 x 2 x 2  if written out fully. There are six 2's being multiplied, so the power of 2 in this case will be 6.


Fractional and negative indices:-

2 ^ ½  means 2 (read as 'the square root of 2', or simply 'root 2') .
This is because 2^ ½  x 2^½ = 2^ (½ + ½), which = 2^1, or just 2.

Similarly, 2^ 1/3 means the cube root of 2, since (2^1/3)³ also = 2^1, or just 2.

Negative powers of a number stand for reciprocals of positive powers of that number i.e. 'one over'.
So a power such as 5^-2 means 1/5², or 1/25.


[You can find more about indices in a previous section, headed 'In the Beginning'.]

Change of Base; Clock-face arithmetic; Modulo arithmetic.:-

The term clock-face arithmetic is a good one to use because we're all familiar with telling the time. The difference here is that we can forget the minute hand and use just the hour hand.
A normal clock face is divided into 12 hours, so if we wanted to show something like 29 hours on it we'd have to go around twice (for 2 x 12 = 24 hours) and then see how much was left over. In this case it would be 5 hours, since 29 - 24 = 5. So 29 hours is equivalent to two complete turns of 12 hours, with 5 hours left over.


In modulo  arithmetic we can write this as  29 5(mod12). [Note that this special 'equals' sign has THREE lines in it, not two as in a normal = sign].

This is read as "29 is congruent to 5, mod 12".

Similarly, something like 115 hours would show as 7 after subtracting nine rotations of 12. ( 115 - 108 = 7).
So 115 is equivalent to 7 on the clockface, and is written as 115  7(mod 12).

[Again, this is read as "115 is congruent to 7, mod 12".]

Multiplication in modulo arithmetic is much easier because we then only have to deal with multiplying the small numbers. E.g. for the numbers 29 and 115 used above, 29 x 115 would give the same answer in mod 12 arithmetic as multiplying their smaller equivalent numbers 5 x 7 .

Let's show this.
29 x 115 = 3335. Dividing by 12 we get 277, with remainder 11. So 29 x 115  11 (mod12).

But this same answer could be obtained by just multiplying the 5 x 7 (the numbers equivalent to 29 and 115 in mod12 arithmetic), since 5 x 7 = 35, and this  leaves a remainder of 11 when divided by 12. (i.e. 5 x 7
≡ 11, (mod 12))
All the above calculations have been based on mod 12 arithmetic, but the important thing about modulo arithmetic is that it works for any base, not just 12. In everyday life, for example, we work in weeks and days. This is a kind of mod 7 arithmetic. E.g., ignoring the number of full weeks, 38 days would be equivalent to 3 (because 35 days = 5 weeks, leaving 3 days over from the original 38.)

This can also be stated as  "38 is congruent to 3, mod 7" , written as  38   ≡   3(mod 7).


Counting to different bases:-

This is very similar to modulo arithmetic, except that the number of rotations around the clock face is written down as well, not just the number left over (the 'remainder').

E.g. we saw above that 38 is the same as (or congruent to) 3 in arithmetic, mod 7. 

The equivalent statement in base 7 would be  38 = 53 in base 7. (N.B. 53 here is read as five-three, showing that 38 is equivalent to 5 sevens plus 3, or 5 complete rotations around the clock-face  (which = 35) plus 3 left over).

Another example of this:-

What is 17 in base 3? To do this, we note that 3 goes into 17 five times, with 2 left over (remainder).
So 17 in base 3 will be 52 (read as five-two. not fifty-two, and standing for 5 threes plus 2 left over.).

In our normal base 10 arithmetic (also known as denary), 17 (seventeen) really means 'one ten plus 7 units'.
Similarly, 38 (thirty-eight) in denary stands for 3 tens and 8 units, whereas 38 (three-eight) in, say,  base 9 would stand for 3 nines and 8 units, equivalent to 27 + 8  =  35 in denary.


Computers often use the hexadecimal system, which entails counting to base 16. (Why 16? Because its a power of 2.  2 to the power 4, in fact, and computers rely on binary, or two-state, systems because they utilise two-state switches, which can be either on or off.)  In the hexadecimal system, a problem arises when we come to numbers between 9 and 16. E.g. ten can't be written 10, as this would mean one sixteen and no units, or just 16. So what we do is use the letter A to represent ten, then B for eleven, C for twelve, etc.

A typical number in hexadecimal (or 'hex') would be 2D7F. What is this in decimal? Well, F means fifteen, the 7 means 7 sixteens, the D means thirteen times two hundred and fifty six (256 being 16 x 16, or 16²), and the 2 in third position to the left stands for 2 x 16³. So we have a grand total of 15 + 112 + 3328 + 8192, or  11,647.
  
Note - the sections above give only a brief outline of the topics dealt with, as the main purpose of this article is to explain how messages may be encoded. If you need more practice in the basic maths, please refer to a good textbook or online lessons.
............................................................................................................................................................
APPLICATION.
Codes in practice:-
One of the procedures used for encoding messages between governments or military establishments is now explained. Although the prime numbers used in real life are very large, I've added calculations at each stage below which are based on smaller, more manageable,  numbers.


The method which follows makes use of something known as Fermat's Little Theorem. This states that  if you take any prime number p, any other number such as a, when raised to the power (p-1) in arithmetic mod p, will always end up as 1. (N.B. the power must be one less than the modulus value).

So if we take 4 as the number and 7 as the modulus, when you work out 4 ^ 6 in mod 7 you'll get the answer 1.

To show this, 4 ^ 6 = 4096, Divide this by 7 (the modulus) and you get 585 times, with remainder 1.

i.e. 4 ^ 6 is congruent to 1 (mod7).
 Similar results will be obtained for any other values for p and a,  provided that  p is a prime number.

Now to the method of encoding a message. This method is an example of what is known as public key encryption.

1. Choose 2 very large prime numbers, p and q. (In practice, these can be over 100 digits long, but for the purposesof illustration I'll use 19 and 23)

2. Multiply them to give a new number. Call it N. (19 x 23 = 437)

3. Subtract 1 from each prime number to give two non-prime numbers p-1 and q-1. Multiply these numbers. This gives a new, very large number which will have factors. Call it M. (Here, 18 x 22 = 396)

4. Choose another number, B, which when divided into M or a multiple of M leaves a remainder of exactly 1.[This step needs a bit more explanation. We are really looking for 2 numbers, B and C, such that their product B x C = 1 (mod M).
In our case, we can use 13 for B and 61 for C, because M = 396, and 13 x 61 = 793, which is twice 396, plus 1. So 13 x 61 = 1 in mod396 arithmetic.]

This is the key to the method being used. Any number raised to the power 13(mod437) and sent to someone who then raises this larger number to the power 61(in mod 437) will end up as the original number.
E.g. a number such as 7 can be raised to power 13, and if this larger number is raised to the power 61 that's equivalent to raising 7 to the power of 13 x 61. But 13 x 61 = 1(mod396), by Fermat's Little Theorem.. So 7 to the power of 13 x 61 is equivalent to 7 to the power of 1, which is just 7.

 To encode a message, begin by converting the letters to numbers (A = 1, B = 2, etc. would be the simplest, but in practice a much less obvious system would be used), then raise these numbers, or groups of numbers, to the power B (mod N), transmit the encrypted message to the receiver, who then raises the numbers to the power C (mod N) to decipher the original message.
So, coming back to our numerical example, we chose two primes whose product was 437 (= N).
We also found two numbers, 61 and 13, which had a product of exactly 1 when multiplied in mod 396.
Suppose we want to encrypt the number 2 (which could represent the letter B in the message.)
The sender raises 2 to the power 61 ( = 2305843009213693952) and divides by 437. The remainder will be 14. So 2 has been changed into 14 in mod 437 arithmetic. (14 is called the 'cybertext')
14 is sent to the receiver, who then raises it to the power 13 in mod 437 arithmetic, resulting in the number 2 reappearing, so the 'message' has been successfully decoded.

Incidentally, although I've given the full expansion of 2^61 in the working above, it isn't necessary to deal with such huge numbers when doing the calculations as the intermediate stages can be reduced by using mod 437 arithmetic as we proceed. E.g. 2^10 = 1024, which is just 150 in mod 437.

Then 2^20 would be (150)², or 22500, which again can be reduced to 313 ( mod 437), etc.

The numbers 437 and 61 are known as the 'public keys' and can be revealed to anyone, but 396 and 13 are 'private keys'. Without knowing them even the most powerful computers would never be able to break the code. (Remember that the prime numbers used in actual practice are extremely large. Once multiplied together its virtually impossible for any computer to 'undo' the multiplying and find what two numbers were used to begin with.) The method of encryption shown above is referred to as 'asymmetric public-key encryption' using the RSA method, RSA being the initial letters of the names of the three people who invented this method in 1977 and 'asymmetric' referring to the different values, 61 and 13, used by sender and receiver.

Of course, there are many other ways to encode messages. The simplest one is called a 'Caesar' code, in which the letters used in the words of the message are changed by moving them along a few places. For example, if all the letters of the alphabet are moved forwards 3 places, A becomes D, B becomes E, and so on. A word like 'BIKE' would then be encoded as 'ELNH'. (So what happens about letters from the end of the alphabet in this method? Well, think of the letters as being arranged in a circle. Then, after moving letters forward 3 places, W would change into Z, X into A, Y into B and Z into C, so a word like 'YAWN' would become 'BDZQ'.)

As a variation of this method the letters of the alphabet can be given numbers. The most obvious way to do this is to replace A by 1 (or 01), B by 2 (or 02) , C by 3(or 03), etc., (i.e. replacing each letter by its position in the alphabet), so that a word like 'BOOK' would be replaced by 02 15 15 11. But once again this can be improved upon by moving the letters along a few places. If this number of places is 4, so that A is now represented by 05, B by 06, etc., the same word 'BOOK' would be encoded as 06 19 19 15.
A more detailed discussion of codes will be done in a different blog, but for now why not try encoding these rather lengthy, but real, 'fun' words - 'antidisestablishmentarianism' and 'honorificabilitudinarianism', or the name of that place in Anglesey called 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantisiliogogogoch'?!!


Euler's Totient function;-

For any number n, the totient function is defined as the number of integers, starting from 1 and going up to (n-1), which have no factors in common with n. (i.e. are co-prime to n). It is denoted by ø(n) [read as phi(n)]. By convention, the number 1 itself is always included.

Here are a few examples:-

If n = 4, there are just 2 numbers in ø(n), 1 and 3;
If n = 8,    ..       ..       4     ..               .. , 1,3,5, and 7.
If n = 10,   ..      ..       4  ..          ..        .. 1,3,7, and 9
If n = 12,   ..      ..       4   ..         ..        .. 1,5,7, and 11

But if n = 11 (a prime number) all ten numbers from 1 to 10 will count, as by definition none of them can have any factors in common with a prime number. So ø(n) will be 10 in this case.

In the section on codes above, only prime numbers p were being used, so the totient function will be (p - 1) in every case, and this is what is stated as Fermat's 'Little' theorem where it says a^(p - 1) = 1 (mod p).

Sunday, 6 February 2011

How to improve in Maths - some tips and advice

 
Making Maths Relevant  
 
All too often pupils get bored with maths lessons because the subject is presented in a way which disregards how it can be used in real life situations.
Admittedly there have been useful advances in this area of teaching over recent years, but still the kinds of problem set for discussion or coursework can be artificial and invented specifically to chime with the syllabus rather than the modern world.
In my opinion, one of the most important qualities we need to inculcate in our schools is enthusiasm for the subject, and this applies whether its maths or anything else.
The very small percentage of our pupils who are mathematically gifted and may well go on to study the subject at University and possibly become noted in their field one day will not have a problem in this respect. They will quickly see the shape and meaning of abstract concepts. I am more concerned with helping the vast majority who find maths strange, difficult, or even disagreeable. Given the correct encouragement I'm sure that many of these could become competent if not brilliant mathematicians.
So how do we do this?
In a nutshell, by two principal strategies:-
1. By harnessing their interest, showing how maths is relevant to some important activity in today's world (e.g. computing; encryption and security; driving a car; finance)
2. By encouraging them to master a topic or procedure beyond what the syllabus requires, so that they feel they 're 'good at maths'.
Any teaching scheme incorporating these two elements has to be enormously beneficial to the student.




Some suggestions for encouraging mid-ability pupils to excel in maths.


Here are two suggestions:-
1. Try to specialise in and master some topic in maths which interests you but is a bit beyond your present syllabus level. (E.g. solving simultaneous equations, even if you are only solving simpler single ones in class at the moment).
2. Use books or the internet to find out some of the maths behind modern technology. (E.g. how bar codes work when you are shopping; how online payments are made securely; how governments use encryption of messages to keep things secret.)
(You can find out more on these subjects if you look at my other blogs on the internet).



Now for a few words about the qualities needed to be a really good mathematician. It goes without saying that you need to have all the basic processes of school maths at your fingertips. Moreover, if you specialise in Pure Maths you will need to feel at home with abstract concepts chosen from topics such as Group Theory, Number Systems, symmetries, matrices, non-Euclidean geometries, topology, analysis, etc., and become familiar with the work of great mathematicians from the past, such as Newton, Lagrange, Leibnitz,  Euler, Fourier, Descartes, Galois, etc. (Its well worth looking up their achievements on the internet).

Relevance is less important here, as many great advances in mathematics have been made in the past for purely academic reasons, with their usefulness only being discovered generations later. (Boolean algebra, invented by George Boole in the 1850's, had no practical use until it was found to be a basis for logic systems in computers).

In Applied Maths you are more concerned with the usefulness of the subject in explaining or solving situations which arise in the fields of mechanics, probability, statistics, and the related studies of physics, engineering, and science generally, often using differential equations, mathematical modelling, the calculus of variations, etc., and studying the work of e.g. Newton, Dirac, Lorenz, Maxwell, and Hamilton.
How to Study:-The following notes give some hints about how to do better at school studies in general, and at maths in particular.

1. SUCCESS BREEDS SUCCESS.

Finding that you can do something well is one of the best incentives to wanting to do even better.

2. A USEFUL TIP

Try to understand and master something beyond your normal, expected level. E.g.in maths, finding out how to solve quadratic or other equations in algebra when they don't come into your syllabus until the following year. This will make you feel good, a step ahead of others, and encourage you to work harder.


3. GET YOUR PRIORITIES RIGHT

Master the process first. You can analyse why it works later. This is especially true for a subject like Calculus. Most textbooks on this begin with the theory of how calculus was developed and talk about  'small increments shrinking to zero',  which can be pretty confusing and off-putting to a beginner. Its also completely unnecessary at the initial stages of the subject.  The mechanics of  differentiation and integration isn't all that hard. All the why's and wherefor's can come later.

4. BUILD UP THE MUSCLE OF YOUR MIND

When you buy a new laptop, or a battery for your car, you are told to charge it and discharge it deliberately several times in order to build up the plates of the cells. This is called a 'conditioning process' and results in a strong battery ready to give many years of service. Athletes also know the importance of doing exercises to build up muscular strength. The same principle applies in preparing the brain. Exercise the brain with a variety of mental challenges to build up its strength and you'll find you'll be able to think more powerfully about anything on which you later focus your attention. And remember, these mental challenges can be fun activities or puzzles, such as Sudoku, or Chess, or Crosswords, as well as mental arithmetic, all of which strengthen the'muscle of the mind'.

5. MAKE SENSIBLE USE OF THE INTERNET

The internet is a most wonderful resource. Its like having the world's best library and encyclopedia at your fingertips, and all for free. Of course your computer can be used for light-hearted pleasures, contacting friends via social networking sites, finding good music to enjoy, playing games, etc., but always remember it can also be a most powerful aid to learning and finding out things. Just doing a search in Google or Youtube can often yield the answer to just about any query you have.

6. DIVIDE UP LARGE PROJECTS

When faced with a large-scale written project, such as an essay or a report, begin by drawing up a draft plan with sub-divisions, then deal with each sub-section in turn. By breaking the project up in this way and doing one stage at a time it will seem easier. As an analogy, think of how in cricket a batsman compiles a high score by steadily accumulating runs, or the stages necessary in preparing a meal, or even how those climbing Everest have to use camps at various stages. They can't just rush for the summit in one go. So learn to pace yourself and take things bit by bit, in stages.

[By way of analogy, imagine how hard life would be if you had to understand the workings of an internal combustion engine or synchromesh geaarbox before being able to have driving lessons!]


 7. REPETITION

Although you may think you understand some new topic or mathematical process after just one brief explanation, the information learnt is unlikely to stick until you've practised using it in solving a variety of problems. By repeating a process you learn to establish it firmly in the mind. So aim to test yourself with about twenty problems of each kind until you've 'programmed' your thought processes correctly.
[Once again, a good analogy is the way a pianist has to practice playing scales or may play through a piece many times before being able to perform it from memory. Likewise with an actor learning his lines. Repetition is the key in all these.]

N.B. In many instances you can invent your own problems to test out your understanding of a topic, provided that you have someone around to help check your answers. Otherwise, use a standard textbook or an internet site offering free online test papers with answers. E.g. go to http://www.thatquiz.org or type 'free online maths tests' into Google.


8. EXPLAIN TO OTHERS


There is no better way thoroughly to learn a new topic , once you think you've mastered it, than by trying to explain it to someone else. So try to get a parent or friend to be your 'pupil' while you attempt to explain what you've just learnt. You may be surprised what gaps in your understanding this process can reveal!


[Note: Please see my other blogs (e.g. Cool Calculus; Algebra for All, etc.),for help with specific topics in maths. You can also contact me via email at  dr.pythagoras@gmail.com]