### Archive

Posts Tagged ‘addition’

## Log Laws: Adding and Subtracting Logs

It is often useful to combine several different logs, being added or subtracted, into a single log that can then be manipulated more easily.

For example it is easier to find log(6) than log(3)+log(4) – log(2)

In order to combine logs like this you need to use the following rules:
logc(a) + logc(b) = log(ab)
and
logc(a)-logc(b) = log(a/b)
Remember: all logs must be in the same base, you cant use this to add log2(a) + log3b

This rule can be proved quite simply as follows:

Let all logs be to the base c.

if log a = m and log b = n
then a=cm and b = cn
so ab = cmcn= cm+n
by taking logs we obtain
log(ab)=log(cm+n) = m + n
and by substituting in the values of m and n we get the required result
log(ab) = log a + log b

The result for log (a/b) can also be found in this way but I’ll leave that one for you to work out.

By David Woodford

Categories: maths Tags: , , , ,

## Basic Arithmatic in Binary

March 9, 2008 1 comment

This is a simple guide in using binary and performing simple arithmetic like addition and subtraction

What is Binary

Binary is an alternative number system that uses base 2, opposed to our normal system that uses base 1. Binary is used extensively in computers as it allows numbers to be represented by a current being on or off and therefore allowing them to do calculations.

Counting in binary

In base 10, our usual number system, we have 10 characters (0,1,2,…,9), and when we want to add 1 to our last character, 9, we have to move across to the next colloum, ie 9 + 1 = 0 carry 1. In binary we have 2 characters (0 and 1) and when we want to add one to one we move to the next colloum, so 1+1=0 carry 1.

so how do we read the binary number. Well on the far right we have our units (1’s) the same as in bas 10, however the next colloum across we have our 2’s instead of tens. Then we have 4’s instead of 100’s. So each collum is the next power of 2 across.

here are some numbers in binary and decimal(base 10):

decimal:binary
1 = 1
2 = 10 * 21
3 = 11
4 =100 * 22
5 = 101
6=110
7 = 111
8=1000 * 23
9=1001
10=1010 *101
15=1111
16=10000 * 24
20=10100
100=1100100 * 102

Adding in binary

In binary each number is either a 1 or 0, so if we have a 1 and we want to add 1 we have to put 0 and carry 1 to the next colloum.

eg 1+ 1 = 0 carry 1 = 10
eg 11011+10010 = 101101

In binary there are four combinations of digits that can be added

0+0 = 0
1+0=1
0+1=1
1+1=0 carry 1

You can add binary numbers in collums like you do with decimals, only it so much easier cos its only 1 and 0.

Subtraction

Subtraction is just the reverse of addtion so:

1-0=1
1-1=0
0-1= 0 carry 1 (to the left this time)
0-0=0 (obviously)

Categories: compting, maths