### Order of operations

Parenthesis, Exponents/Power, Multiplication, Division/Modulus, Addition, Subtraction

Notation example

(a^{2} * b) + c – d

1. a^{2}

2. * b

3. + c

4. – d

### Proportions

`a / A = x / X`

a | b | |

— | = | — |

A | B |

You’re trying to solve x. You have to cross-multiply. Be mindful of order of operations.

`x * A = a * X x = a * X / A`

Because I’m so nice, I coded up a very basic proportions calculator for you. Give it a try now!

If you do any 2D/3D graphics programming, oh man, you’ll be using this a lot. It’s useful to figure out how things relate to each other.

### Basic of Basic numbers

0 1 2 3 4 5 6 7 8 9

### Even numbers

0 2 4 6 8 10 12 14 16 18 …

### Odd numbers

1 3 5 7 9 11 13 15 17 19 …

### Prime numbers

These are special kinds of numbers that cannot be divisible by any numbers smaller than itself. It can only be multiplied by itself and 1. These numbers can get very big and “rare” and are usually used in encryption.

1 3 5 7 11 13 17 19 23 31 …

### Multiplication Table

You gone have to memorize this basic ass table to heart like your life depends on it.

x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |

1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

2 | 0 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 |

3 | 0 | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 |

4 | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 |

5 | 0 | 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 |

6 | 0 | 6 | 12 | 18 | 24 | 30 | 36 | 42 | 48 | 54 |

7 | 0 | 7 | 14 | 21 | 28 | 35 | 42 | 49 | 56 | 63 |

8 | 0 | 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72 |

9 | 0 | 9 | 18 | 27 | 36 | 45 | 54 | 63 | 72 | 81 |

### Convenient Binary Powers of 2 Table

If you deal a lot with computer numbers, it might be good to memorize these numbers. Most commonly you’ll see these numbers as file sizes, hard drive sizes, memory size in bytes.

x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

2 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 |

### US Dollars and cents

US Dollar notes come in 1s, 2s (rare), 5s, 10s, 20s, 50s, 100s, 1000s (rare), 10000 (rare)

Coins come in

100 cents/pennies = 1 dollar

50 cents = 1 half-dollar

25 cents = 1 quarter

10 cents = 1 dime

5 cents = 1 nickel

**PAY ATTENTION: US Dollars round UP and only keep two decimal places for cents**

### How to solve percentage of a cost

So now everything comes into play, just like the math books and assignments from school! Say you went grocery shopping or online shopping. You have to pay taxes on that shit. Try this:

$15 item + 5.5% tax

Figure out what the tax costs on your $15 item. Now you can use the proportions formula to solve it!

5.5 / 100 = x / $15

We use 100 to represent 100% of an abstract amount. In this case, we’re trying to find a percentage of $15.

5.5 * $15 = x * 100

x = $15 * 5.5 / 100

x = $0.825 => $0.83

So your sales tax will cost an additional $0.83.

That brings your total cost to

$15 + $0.83 = $15.83

A shortcut could be done like this:

$15 * 1.055 = $15.83

Explained like this:

($15 * 1) + ($15 * 0.055) = $15.83

You’re accounting for the base cost itself and the percentage of the base cost. It seems redundant to have to multiple something by 1, but in math, you must do that to prove you know what you’re doing. Shows intent.

### How to make change from dollars to cents

Since $1 = 100 cents, you will only ever be dealing with change between 0 and 99 cents. You cannot have more than 2 decimal places for change less than $1.

Item costs $1.25

You pay with $2

You can expect your change to be:

$2.00 – 1.25

Take a dollar from $2 to make .00 into a whole dollar so that we can deal with the cents, the two digits to the right of the decimal

1. Line up the subtraction of the two decimals

$2 | . | 0 | 0 |

-$1 | . | 2 | 5 |

2. Take one from the dollar amount to the left of the decimal point and carry it over to the first decimal place in the cents. You do this because the decimal place is zero. Each decimal place to the right of the point represents a fraction of a hundred.

$1 | . | 10 | 0 |

-$1 | . | 2 | 5 |

3. Have to borrow again from this decimal place to the last place because it is zero again. Now that each decimal place has sufficient amount to subtract from, we go through every place and subtract.

$1 | . | 9 | 10 |

-$1 | . | 2 | 5 |

$0 | . | 7 | 5 |

So your change will be $0.75, which can be in the form of three quarter coins or seven dimes and a nickel.

Tags: binary, computer, formula, math, multiplication, programming, simple