Deep Learning · MT2 · section

Fractions decimals and percentages

Mathematics revision

1. A fraction tells us to divide

The upper number is the numerator. The lower number is the denominator. In one-quarter, split one whole into four equal parts and take one part. The fraction bar means division.

\frac14=1\div4=0.25LaTeX: \frac14=1\div4=0.25
One shaded part out of four is the same amount as 0.25 or 25 percent. Tap the diagram to enlarge.

A decimal and a fraction can name the same amount. One-half is 0.5, one-tenth is 0.1, and one-hundredth is 0.01. The denominator cannot be zero: division by zero is undefined.

\begin{aligned}\frac12&=0.5\\\frac1{10}&=0.1\\\frac1{100}&=0.01\end{aligned}LaTeX: \begin{aligned}\frac12&=0.5\\\frac1{10}&=0.1\\\frac1{100}&=0.01\end{aligned}

2. Why small decimals become smaller when multiplied

Multiplying by 0.1 means taking one-tenth. Multiplying by 0.2 means taking two-tenths. For 0.2 × 0.3, express both numbers as fractions. Multiply the numerators and multiply the denominators.

\begin{aligned}0.2\times0.3&=\frac2{10}\times\frac3{10}\\&=\frac6{100}\\&=0.06\end{aligned}LaTeX: \begin{aligned}0.2\times0.3&=\frac2{10}\times\frac3{10}\\&=\frac6{100}\\&=0.06\end{aligned}

This also explains a calculation used later: 0.1 × (−0.6) is one-tenth of negative 0.6, which is −0.06. The negative sign is kept because the factors have different signs.

3. Dividing by one-half asks how many halves fit

Two halves fit inside 1. Four halves fit inside 2. Therefore dividing 2 by one-half gives 4, even though division by a number greater than 1 would make 2 smaller.

\begin{aligned}2\div0.5&=2\div\frac12\\&=2\times2\\&=4\end{aligned}LaTeX: \begin{aligned}2\div0.5&=2\div\frac12\\&=2\times2\\&=4\end{aligned}

The reciprocal flips a nonzero fraction: the reciprocal of 1/2 is 2/1. Dividing by a fraction means multiplying by its reciprocal. For decimals, multiplying both the numerator and denominator by the same nonzero number preserves their ratio.

\begin{aligned}\frac{0.8}{0.5}&=\frac{0.8\times10}{0.5\times10}\\&=\frac85\\&=1.6\end{aligned}LaTeX: \begin{aligned}\frac{0.8}{0.5}&=\frac{0.8\times10}{0.5\times10}\\&=\frac85\\&=1.6\end{aligned}

4. Percent means out of one hundred

To turn a percentage into a decimal, divide by 100. To turn a decimal into a percentage, multiply by 100.

\begin{aligned}20\%&=\frac{20}{100}=0.2\\50\%&=\frac{50}{100}=0.5\end{aligned}LaTeX: \begin{aligned}20\%&=\frac{20}{100}=0.2\\50\%&=\frac{50}{100}=0.5\end{aligned}

If 20% is removed, 80% remains. As decimals: 1 − 0.2 = 0.8. The number 1 represents the whole amount, or 100%. This same arithmetic will be used for dropout later.

5. A mean is a fair-share amount

For 2, 4 and 9, first add all three numbers: 2 + 4 + 9 = 15. Divide by the number of values, which is 3. The mean is 5. Do not divide by 9 just because it is the largest value.

\text{mean}=\frac{\text{sum}}{\text{count}}LaTeX: \text{mean}=\frac{\text{sum}}{\text{count}}

Here the sum is 15 and the count is 3. Apply those two quantities to the formula.

\begin{aligned}\text{mean}&=\frac{2+4+9}{3}\\&=\frac{15}{3}\\&=5\end{aligned}LaTeX: \begin{aligned}\text{mean}&=\frac{2+4+9}{3}\\&=\frac{15}{3}\\&=5\end{aligned}

A weighted mean gives different shares of importance to the values. With shares 0.9 and 0.1, the first value receives 90% of the importance and the second receives 10%. The shares add to 1.

Question. Find the weighted mean of 10 and 20 using weights 0.9 and 0.1 respectively.

Answer — step by step.

Given

Find the weighted mean of 10 and 20 using weights 0.9 and 0.1 respectively.

To find

Find the weighted mean.

Formula — which one and why

Weighted sum. Multiply each value by its own coefficient and then add. For a weighted mean, divide by the sum of the weights unless that sum is already 1.

xᵢ = value i; aᵢ = its weight. Each input keeps its own matching coefficient.

\bar x_w=\frac{\sum_i a_ix_i}{\sum_i a_i}LaTeX: \bar x_w=\frac{\sum_i a_ix_i}{\sum_i a_i}

Yaad rakhne ka cue: Har number apne weight ke saath multiply; phir sab add.

Solution — step by step

Step 1: multiply the first value by its weight: 0.9 × 10 = 9.

Step 2: multiply the second value by its weight: 0.1 × 20 = 2.

Step 3: add the contributions: 9 + 2 = 11. The weighted mean is 11. It is closer to 10 because 10 received most of the importance.

\begin{aligned}0.9(10)+0.1(20)&=9+2\\&=11\end{aligned}LaTeX: \begin{aligned}0.9(10)+0.1(20)&=9+2\\&=11\end{aligned}

If importance weights do not sum to 1, divide their weighted sum by the sum of the weights to obtain the weighted mean. A neuron's general weighted sum does not require weights to sum to 1 and is not automatically a mean.