These are powers of 10:

- 1,000 is 10 to the power 3,
- 1,000,000 is 10 to the power 6
- and 1,000,000,000 is 10 to the power 9.

Also, 1,000,000 = 1,000 x 1,000 and 1,000,000,000 = 1,000 x 1,000,000, so that a mega is 1,000 kilo and a giga is 1,000 mega.

But in usual computer science, it is not so: a kilobyte is 1,024 bytes rather than 1,000 bytes.

This is because in computer science, the numeration is done in 2 basis ('0' and '1' are the only digits) rather than the 10 basis, so that the powers of 2 are preferred to the powers of 10.

And 1,024 is a power of 2, it is 2 to the power 10. More precisely, it happens to be a power of 2 that is close to 10 to the power 3: that's why it is used for the definition of a kilobyte.

The convention is the same for the megabyte, that is 1,024 kilobytes, or 1,024 x 1,024 = 1,048,576 bytes. The multiplier is also a power of 2, it is 2 to the power 20, that is close to 10 to the power 6, or 1 million.

And the gigabyte is 1,024 megabytes, that is 1,024 x 1,024 x 1,024 = 1,073,741,824 bytes. The number of bytes in a gigabyte is a power of 2, it is 2 to the power 30, that is close to 10 to the power 9, or 1 billion.

Note that the official standard definition of a kilobyte is indeed 1,000 bytes, the usual definition as 1,024 bytes is standardized as a "kibibyte".

But this is the official definition only, not the usual one… except for sellers of memory devices, for whom the official definition gives a bigger amount of memory: an "official" gigabyte is 7.37% more than a "regular" one…

]]>Let's study it with an example.

If it lasts 15 minutes to bake 500 g of rastbeef, how much time shalll I bake my 950 g rastbeef?

Let's call * x* the time in minutes that we are looking for.

Then the time per gram is either 15 min over 500 g, or x min over 950 g:

* x* 15

------ = ------ (1)

950 500

If we multiply both sides of (1) by the product 950 x 500 and simplify the left side by 500 and the right side by 950, we obtain the cross product law:

500 * x* = 950 x 15 (2)

where the numerator of a side is multiplied by the denominator of the other side.

(2) is a linear equation of the type * a x *=

Thus the solution of our problem is the 'rule of 3' formula:

950 x 15** x **= --------------- = 28.5 min = 28 min 30 s

500

The rule of 3 can be obtain directly from the proportionality equation (1), multiplying both sides of (1) by 950 and simplifying the left side by 950.

Thus, the rule of 3 solves a proportionality equation, that is in fact a linear equation as well, with coefficients inverses of integers…

]]>For instance, adding 20% to a tax free price, to obtain the VAT included price, is multiplying by (1+20/100)=1.20=1.2.

But what I would like you to know today, is that subtracting a percentage is NOT a division, but a multiplication as well!

For instance, a coupon of 30% on a price of $100 is subtracting 30% of $100, that is (30/10)*$100=$30. The reduced price is $100-$30=$70, that is 0.70 times $100.

Another way to see it is that to subtract 30%, we have to multiply by 30/100=0.3 and then to subtract the result os the multiplication by 0.3 to the intial amount. Thus, we multiply the intial amount by (1-30/100)=0.70=0.7.

Now, let's combine the 2 operations.

Suppose that you have invested an amount of $1,000 and are rewarded by 10%: you get $1,100 back, and you earned $100.

Suppose now you leave the $1,100 to wait a better earning, but you loose the same 10%: you loose $1,100*(10/100)=$110, so that you get $1,100-$110=$990.

Thus the result of a gain of 10% and then a loss of 10% (add and subtract 10%) is a loss of $10, that is 1% of $1,000.

You may see then that add and subtract a given percentage are NOT reciprocal operations. This is because they are both multiplications, as the reciprocal operation of a multiplication is a division.

In any case, this is a confirmation that when you invest on the financial market, you haven't earned anything until you get your money back!

]]>It deals with problems of sharing quantities of objects that can not be individually shared.

For instance, if we want to share 13 marbles between 3 children equally, then each child will receive 4 marbles, and it will remain 1 marble unshared.

This is written 13 ÷ 3 = 4, remains 1, that is equivalent to 13 = 4 x 3 + 1.

The definition of the Euclidian division is so: a ÷ b, with a and b (relative) integers, b≠0, is the 2 integers q and r so that a = q x b + r and 0 ≤ r < |b| the absolute value of b.

q is called the quotient and r the remainder, and they are uniquely defined by the fact that

a = q x b + r and 0 ≤ r < |b|.

The division of positive integers may be done manually or… with a calculator or a computer!

To do a ÷ b (say 354 ÷ 35) with a calculator, do the following way:

- display a divided by b ('result' = 354/35 ~ 10.114)
- the integer part is the quotient q of the Euclidian division (q=10)
- subtract q to the result ('result1' = 'result' - 10 ~ 0.114)
- multiply the last result by b to obtain the rest r (r = 'result1' x 35 = 4)

The last result is an integer, because it is r = (a/b-q) x b = (a/b)xb - q x b = a - q x b (distribute x on - and simplify the fraction by b).

An application of that is the convert minutes in hours and minutes, days in years and days.

For instance, 1,000 minutes is: 1,000 ÷ 60 = 16 (the integer part of 1,000/60), remains 40

((1,000/60 - 16) x 60), so that 1,000 minutes is 16 hours and 40 minutes.

And 1,000 days is (neglecting the leap years): 1,000 ÷ 365 = 2 (the integer part of 1,000/365), remains 240 ((1,000/365 -2) x 365), so that 1,000 days is 2 years and 240 days (8 months of about 30 days).

So, we have a complement to our first post and second post about the time mesurement!

To know which number is the greatest between 2 natural integers a≥0 and b≥0, we first compare the number of digits of a and b. If a has more digits than b, then a>b, and reversely. For instance 96<456 and 16>0.

If a and b have the same number of digits, then we compare the digits that are the most to the left. If they are different, then the greatest number is the one that has the highest left digit. For instance 456>196 and 73<88.

If the left digits are the same, we compare the next digits to the right, with the same rule as for the left digits. For instance, 456<465.

If the two first digits to the left are the same, then we compare the third digits, wit the same rule. For instance, 456<458.

We continue that way until we arrive to distinct digits, which happens because the numbers are supposed to be different…

Now, to compare decimal numbers, with at least one with a decimal point, we first compare the numbers before the decimal point, the integer parts. If they are different, the biggest number is the one with the greatest integer part. For instance, 4.5>2.

If two decimal numbers have the same integer part, we compare the first digits after the decimal points, that may be 0. For instance, 4.5>4.4 and 2.1>2.

We continue to compare the digits after the decimal points until we find 2 of them being differents, that digit possibly non-existent thus being 0. For instance, 3.45<3.46 and 3.45<3.451.

If all the digits are the same, then the numbers are equal. It is the same if there are às at the end of a number completing the digits of the other number. For instance, 0.50=0.5.

That's why taking 50% of an amount, that is multiplying by 0.50, is also multiplying by 0.5=1/2 or dividing by 2!

]]>For instance, if you find a number that divides both the numerator and the denominator of a fraction, for instnace 2 for the fraction 6/4, then you may simplify the fraction: 6/4=3/2, because

6=2x3 and 4=2x2.

The integers that divide both the integer p and the integer q are called the 'common divisors' of p and q.

The positive common divisors of 2 integers p and q are all lower than both the absolute values of p and q, so that they are in finite number and have a maximum, the 'greatest common divisor' of p and q gcd(p,q).

For instance, the divisors of 8 are 1, 2, 4 and 8, and the divisors of 12 are 1, 2, 3, 4, 6 and 12, so that the common divisors of 8 and 12 are 1, 2 and 4, and the gcd is the greatest of these, i.e. 4.

If two numbers share only the positive divisor 1, that is that their greastest common divisor is 1, they are said to be 'relatively prime'.

Beware, 2 different prime numbers are relatively prime, but the some pairs of non-prime numbers are relatively prime. For instance, 2 and 3 are relatively prime, but also 4 and 9, that are not prime numbers.

For a fraction, it may not be simplified if and only if the numerator and the denominator are relatively prime. It is said to be 'irreducible'

But if we simplify a fraction by the greatest common divisor of the numerator and the denominator, the result may not be simplified further, otherwise the gcd multiplied by the common divisor of the new numerator and denominator should be a common divisor of the previous numerator and denominator that should be grater than their gcd, that is contradictory.

Thus, if we simplify a fraction by the gcd of the numerator and denominator, we obtain an equivalent fraction with relatively prime numerator and denominator.

That fraction that can not be simplified is called the 'canonical form' of the rational number. More precisely, the canonical form of a rational number is the unique irreducible fraction with positive denominator that represents the fraction.

For instance, as gcd(8,12)=4, the fraction 8/12 may be simplified by 4 to obtain its canonical form 8/12=2/3.

We may of course do it stepwise, simplifying by 2 two times: 8/12=4/6=2/3, that is an irreducible fraction because 2 and 3 are relatively prime.

These are the two main ways to obtain the canonical form of a fraction…

]]>

They follow a mathematical curve called "helix".

But what is the equation of an helix?

Let's suppose that the vertical axis "z" is the central axis around wich the helix turns, oriented to the top, and that the first horizontal axis "x" is along the basis of the stairs.

Let the parameter **a** be the horizontal angle of a dot on the curve with the "x" axis. Then the horizontal projection of the dot has coordinates x=Rcos(**a**) and y=-Rsin(**a**) if its turns clockwise or Rsin(**a**) otherwise, where R is the distance of the spiral with the vertical axis "z".

Note that **a** may be in degrees or radians, so that the cosine and sinus functions are adapted to the unit of **a**.

Let us now calculate the "z" coordinate.

As the helix goes up when turning, z is an increasing function of the angle **a**.

As a matter of fact, it is a linear function of **a**: z=C**a**, where Z=C/360° (or C divided by 2 pi if **a** in Radians) is the height during which the stairs make a complete turnaround.

Thus the equation of the helix as a function of the height z by which the dot goes up is

x=Rcos(z/C) and y=(-)Rsin(z/C), z/C modulo 360° or 2pi being the horizontal angle of the radius with the "x" axis.

Now, to calculate the positions of the individual steps, let us suppose that:

- The stairs make a complete turnaround for an elevation of Z=2.50 meters (a floor)
- There are N=20 steps per floor

Then the height by which the stairs go up for 1 step is Z/N=2.50/20=0.125 m=125 mm.

The angle in degrees by which the stairs turn around the central axis for 1 step is

da=360°/N=360°/20=18°, so that the coordinates of the successive steps on "x" and "y" axis are, for k=0 to the total number of steps -1:

- xk = cos(k x 18°)
- yk = (-)sin(k x 18°) (with "-" for clockwise turning stairs)

More precisely, the xk and yk are the coordinates of the beginning of the steps and we should take into account the wifth of each step. But these are the beginnig of the next step for each step, so it is already computed.

Now, you are ready to design spiral or helical stairs like a guenuine architect!

]]>

For instance, 3 to the power 2 is 3x3=9, 10 to the power 3 is 10x10x10=1,000.

A sequence starting wit u(0)=C and continuing with the iterative formula u(n+1)=a x u(n) has for value u(n) equal to C multiplied by **a** to the power n.

Such a sequence is called a geometrical sequence of initial point C and "reason" a>0.

There are 3 cases for the behavior of the sequence:

- if a>1, the sequence goes to infinity in a very rapid manner, called "exponential increasing: the time by which it doubles is the same at each moment.
- if a<1 (and a>0), the sequence goes to zeros in a quite slow manner, called "exponential decreasing": it takes the same time to divide the number by 2 and then to divide it by 2 again.
- if a=1, the sequence is constant equal to u(0)=C.

Thus the behavior of a geometrical sequence is very unstable when the reason **a** varies in the neighborhood of 1: a little smaller than 1 gives going to 0 in exponential decreasing and a little bigger than 1 gives exponential increasing to infinity!

This is an example where the uncertainty of computation may lead to completely wrong results!

]]>But it is not the smallest duration we may evaluate: our clocks show us the hours and minutes, and even the seconds.

These are obtained from the day duration by successive divisions:

- The hour is the 24th part of the day, that is that 1 day lasts 24 hours of same duration.
- The minute is the 60th part of the hour: an hour lasts 60 minutes
- The second is the 60th part of the minute: a minute lasts 60 seconds, and an hour lasts 60x60=3,600 seconds.

We give the time in hours and minutes after midnight (am) or noon (pm). Indeed, the day of 24 hours is divided into 2 periods of 12 hours each, one from midnight to noon, and the other from noon to next midnight.

We also usually tell the time it is in parts of hours or minutes before or after the full hour:

- a quarter to 9 is 8:45 am in the morning and 8:45 pm in the evening.
- 10 to 8 is 7:50 am in the morning and 7:50 pm in the evening
- half past 3 is 3:30 am in the night and 3:30 pm in the afternoon
- 5 past 6 is 6:05 am in the morning and 6:05 pm in the evening

The international (and French) convention to give a time during the whole day is to give:

- the same time for an "am" time: 7:05 am is 7:05
- the time augmented by 12 hours for a "pm" time: 6:50 pm is 18:50

That's the time since last midnight, midnight being 0:00 and noon being 12:00.

And what about the seconds? It is a way to measure short times, of less than 1 minute or of just a few minutes and some… seconds.

For instance, you may measure your heart beats rythm in counting your beats on your wrist during the time your clock counts 60 seconds (numbers from 1 to 60 or a turnaround of the second hand).

You may do it more rapidly by counting the beats during 15 seconds, that are a quarter of a minute (60/4=15), and then multiply the result by 4.

The seconds are also the unit to measure a sports performance, but with decimal digits: the Men's 100 metres world record is 9.58 seconds which was run by Usain Bolt.

The seconds and hundredth of seconds are measured by the chronometers.

The calendars, the clocks and the chronometers are complementary means of measuring the time, each for a different scale…

]]>First, the basic time units are NOT the hour or the second, but the day, the month and the year:

- The day is the time by which the earth spins on its axis completely.

It used to be measured by the time between 2 instants at which the sun is at its highest position in the sky. - The year is the time by which the earth turns around the sun by a full orbit.

It used to be mearured by the time between 2 "shorter days", 2 Winter Solstices. - The month used to be the time by which the Moon turns around the earth a complete revolution, or the time between 2 "full moons".

The rough conversions between these units are so:

- A year is very close to 365 days, the difference being corrected by the system of leap years.
- A "Lunar month" is about 29 days and a year is roughly 12 Lunar months

Our current calendar contents 12 months of 30 or 31 days each, except February that is 28 days (or 29 for the leap years), the total being 365 days (or 366 the leap years).

Thus, if we wish to convert years in months, we have to multiply the number by 12 (5 years are 5x12=60 months). We may also convert months in days, but only roughly, by a multiplication by 30 (3 months are roughly 90 days).

There is another useful "small" unit of time: the week, that has no astronomic sense, but that is exactly of 7 days. For our schedules, it may be useful to convert months in weeks: one month is roughly 4 weeks.

But here encountered we a common missuse of the conversion laws. We could say that 3 months are 3x4=12 weeks, thus 12x7=84 days, that is quite far from 90 days!

As a matter of fact, a quarter of 3 months is closer from 13 weeks, as 13x7=91.

So that a year of 4 quarters is about of 4x13=52 weeks, that is well known: a year of 365 days is 52 weeks and 1 day, and a leap year of 366 days is of 52 weeks and 2 days. This is because 7x52=364.

So, we can see that the conversion laws are rather whimsical, especially when used with approximated values…

]]>