Skip to content

Commit 4392f0f

Browse files
committed
removed kotlin from algebra and arithmetic
1 parent 026b8a8 commit 4392f0f

File tree

2 files changed

+123
-51
lines changed

2 files changed

+123
-51
lines changed

notebooks/algebra.ipynb

100644100755
Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,38 @@
1212
"[Substitution rule](#Substitution-rule) \n",
1313
"[Expressions](#Expressions) \n",
1414
"[Equations](#Equations) \n",
15-
"[Fractions](#Fractions) \n",
1615
"\n",
1716
"<a id=\"Variables\"></a>\n",
1817
"## Variables\n",
19-
"Variables are symbols a descriptive name that represent unknown values.\n",
18+
"Variables are symbols for unknown values.\n",
19+
"We can say the variable a has the value 1.\n",
2020
"\n",
2121
"<a id=\"Substitution-rule\"></a>\n",
2222
"## Substitution rule\n",
23-
"A variable's value can be substituted for that variable anywhere that variable appears.\n",
24-
"The value can be numeric, text, labels, logical, or arbitrary types created for the program.\n",
25-
"For example, if the variable `a` has the value 1, `a + 2` is the same as `1 + 2` or `3`.\n",
23+
"Variables have the rule that they can be substituted by their value in any expresion.\n",
24+
"If the value of a is 1, we can say the expression\n",
25+
"\n",
26+
"a + 2\n",
27+
"\n",
28+
"is the same as\n",
29+
"\n",
30+
"1 + 2\n",
2631
"\n",
2732
"<a id=\"Expressions\"></a>\n",
2833
"## Expressions\n",
29-
"Expressions are combinations of variables, values, and operators that have another value. \n",
30-
"Some mathematical operators are used in [numeric expressions](arithmetic.ipynb).\n",
31-
"An example of a numeric expression is\n",
32-
"\n",
33-
"$a + (b \\cdot 4 - 1)$\n",
34+
"Expressions are combinations of variables, values, and operators that give other values. \n",
35+
"An example of an expression is\n",
3436
"\n",
35-
"Other operators work with different data types such as text or logical values.\n",
37+
"a + (b $\\cdot$ 4 - 1)\n",
3638
"\n",
3739
"<a id=\"Equations\"></a>\n",
3840
"## Equations\n",
3941
"Equations say that two expressions separated by an equals sign = have the same value.\n",
40-
"For example, `a = 1` implies that `a` has the value `1`. There are a number of rules for equations.\n",
42+
"We can say that the variable a has the value 1 with the equation\n",
43+
"\n",
44+
"a = 1\n",
45+
"\n",
46+
"There are a number of rules for equations.\n",
4147
"\n",
4248
"Rule |Example|Note\n",
4349
":- |:- |:-\n",
@@ -55,7 +61,7 @@
5561
"\n",
5662
"Note that the Commutative and Association rules do not apply for substraction and division.\n",
5763
"\n",
58-
"These are rules for changing equations to a form more easily solved.\n",
64+
"These are rules for changing equations.\n",
5965
"\n",
6066
"Rule| If |Then\n",
6167
":- |:- |:-\n",
@@ -68,7 +74,7 @@
6874
"Inverse of multiplying|a = b$~\\cdot~$c|a$~\\div~$c = b|\n",
6975
"Inverse of dividing|a = b$~\\div~$c|a$~\\cdot~$c = b|\n",
7076
"\n",
71-
"We can use these rules to find the value of the variable in this equation.\n",
77+
"We can use these rules to find the value of a variable in an equation.\n",
7278
"In the equation\n",
7379
"\n",
7480
"a - 2 = 1\n",
@@ -105,49 +111,39 @@
105111
"b + 0 = 3|Identity for subtraction\n",
106112
"b = 3|Identity for addition\n",
107113
"\n",
108-
"<a id=\"Fractions\"></a>\n",
109-
"## Fractions\n",
110-
"Fractions are a way to express a number in terms of divisions of another number.\n",
111-
"The fraction $9 / 3$ evaluates to 3 groups of 3 which is 3.\n",
112-
"Fractions that do not evaluate to a whole number have a remainder. \n",
113-
"`7 / 2` evaluates to 3 remainder 1.\n",
114-
"There are a number of rules to combine fractions.\n",
115-
"\n",
116-
"Rule |Example|\n",
117-
":- |:-\n",
118-
"Addition|$\\frac{a}{c}~$+$~\\frac{b}{c}~$=$~\\frac{a~+~b}{c}$|\n",
119-
"Subtraction|$\\frac{a}{c}~$-$~\\frac{b}{c}~$=$~\\frac{a~-~b}{c}$|\n",
120-
"Multiplication|$\\frac{a}{c}~$$\\cdot$$~\\frac{b}{c}~$=$\\frac{a~\\cdot~b}{c}$|\n",
121-
"Division|$\\frac{a}{b}~$$\\div$$~\\frac{c}{d}~$=$\\frac{a}{b}~$$\\cdot$$~\\frac{d}{c}~$|\n",
122114
"\n",
123115
"\n"
124116
]
125117
},
126118
{
127119
"cell_type": "code",
128120
"execution_count": null,
129-
"id": "76ca80a5",
121+
"id": "dfdc5100",
130122
"metadata": {},
131123
"outputs": [],
132124
"source": []
133125
}
134126
],
135127
"metadata": {
136128
"kernelspec": {
137-
"display_name": "Kotlin",
138-
"language": "kotlin",
139-
"name": "kotlin"
129+
"display_name": "Python 3 (ipykernel)",
130+
"language": "python",
131+
"name": "python3"
140132
},
141133
"language_info": {
142-
"codemirror_mode": "text/x-kotlin",
143-
"file_extension": ".kt",
144-
"mimetype": "text/x-kotlin",
145-
"name": "kotlin",
146-
"nbconvert_exporter": "",
147-
"pygments_lexer": "kotlin",
148-
"version": "1.8.20"
134+
"codemirror_mode": {
135+
"name": "ipython",
136+
"version": 3
137+
},
138+
"file_extension": ".py",
139+
"mimetype": "text/x-python",
140+
"name": "python",
141+
"nbconvert_exporter": "python",
142+
"pygments_lexer": "ipython3",
143+
"version": "3.11.5"
149144
}
150145
},
146+
151147
"nbformat": 4,
152148
"nbformat_minor": 5
153149
}

notebooks/arithmetic.ipynb

Lines changed: 88 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"\n",
1111
"[Types of numbers](#Types-of-numbers) \n",
1212
"[Operations on numbers](#Operations-on-numbers) \n",
13+
"[Fractions](#Fractions) \n",
14+
"[Factoring](#Factoring) \n",
15+
"[Prime numbers](#Prime-numbers) \n",
16+
"[Factorials](#Factorials) \n",
1317
"[Exponents](#Exponents) \n",
1418
"\n",
1519
"<a id=\"number-types\"></a><a id=\"Types-of-numbers\"></a>\n",
@@ -58,58 +62,130 @@
5862
"Operations of the same priority are applied left to right, so the order of operations for `3 + 6 - 2` is `(3 + 6) - 2`.\n",
5963
"For operations of different priorities, in programs it might sometimes be clearer and less error prone to use parentheses even if they not necessary, so `5 + 8 / 4 - 2` might be written as `5 + (8 / 4) - 2`. \n",
6064
"\n",
65+
"<a id=\"Fractions\"></a>\n",
66+
"## Fractions\n",
67+
"Fractions are a way to show a number as divisions of another number.\n",
68+
"The fraction $9 / 3$ shows the number of times 9 can be divided into groups of 3, which is 3.\n",
69+
"Fractions may not represent a whole number, such as $7 / 2$, where 2 does not divide into 7 evenly.\n",
70+
"\n",
71+
"There are a number of rules to combine fractions.\n",
72+
"\n",
73+
"Rule |Example|\n",
74+
":- |:-\n",
75+
"Addition|$\\frac{a}{c}~$+$~\\frac{b}{c}~$=$~\\frac{a~+~b}{c}$|\n",
76+
"Subtraction|$\\frac{a}{c}~$-$~\\frac{b}{c}~$=$~\\frac{a~-~b}{c}$|\n",
77+
"Multiplication|$\\frac{a}{c}~$$\\cdot$$~\\frac{b}{c}~$=$\\frac{a~\\cdot~b}{c}$|\n",
78+
"Division|$\\frac{a}{b}~$$\\div$$~\\frac{c}{d}~$=$\\frac{a}{b}~$$\\cdot$$~\\frac{d}{c}~$|\n",
79+
"\n",
80+
"<a id=\"Factoring\"></a>\n",
81+
"## Factoring\n",
82+
"A number `N` may be a multiple of whole numbers `a`, `b`, `c`, etc. \n",
83+
"\n",
84+
"$N = a\\>\\cdot\\>b\\>\\cdot\\>c\\>\\cdot\\>\\cdots$ \n",
85+
"\n",
86+
"The numbers `a`, `b`, `c`, etc. are the *factors* of `N`.\n",
87+
"We say `N` is *evenly divisible* by `a`, `b`, `c`, etc.\n",
88+
"\n",
89+
"<a id=\"Prime-numbers\"></a>\n",
90+
"## Prime numbers\n",
91+
"A number always at least has two factors, 1 and itself. \n",
92+
"\n",
93+
"$N = 1\\>\\cdot\\>N$ \n",
94+
"\n",
95+
"A number that is only evenly divisible by 1 and itself is a *prime number*.\n",
96+
"\n",
97+
"We say that when the factorization of `N` is\n",
98+
"\n",
99+
"$N = a\\>\\cdot\\>b\\>\\cdot\\>c\\>\\cdot\\>\\cdots$ \n",
100+
"\n",
101+
"if all of `a`, `b`, `c`, etc. are prime, that is the *prime factorization* of `N`.\n",
102+
"\n",
103+
"<a id=\"Factorials\"></a>\n",
104+
"## Factorials\n",
105+
"A special case of factoring is when the factors of a number are all positive whole numbers less than or equal to `n`.\n",
106+
"This number is the *factorial* of `n` or $n!$.\n",
107+
"\n",
108+
"$n! = n \\cdot (n - 1) \\cdot (n - 2) \\cdot\\>\\cdots\\> \\cdot 1$\n",
109+
"\n",
61110
"<a id=\"Exponents\"></a>\n",
62111
"## Exponents\n",
63112
"Exponents are a way to represent repeated multiplication of the same number with fewer symbols. \n",
64113
"If a number is multiplied several times, the number of times it is multiplied can be represented with an *exponent*.\n",
65114
"For example, multiplying 2 three times can be represented using an exponent of 3:\n",
66115
"\n",
67-
"$2 \\cdot 2 \\cdot 2 = 2^3 = 8 $\n",
116+
"$\\qquad 2 \\cdot 2 \\cdot 2 = 2^3 = 8 $\n",
68117
"\n",
69118
"We say that $2^3$ is \"two raised to the power 3\".\n",
70119
"The value 2 is the *base* of the exponent.\n",
71120
"We can then do arithmetic on numbers with exponents.\n",
72121
"We notice that is the same as \n",
73122
"\n",
74-
"$(2 \\cdot 2) \\cdot 2 = 2^2 \\cdot 2^1 = 2^3$ \n",
123+
"$\\qquad (2 \\cdot 2) \\cdot 2 = 2^2 \\cdot 2^1 = 2^3$ \n",
75124
"\n",
76125
"where $2^1$ is 2 \"multiplied once\". \n",
77126
"\n",
78127
"We notice a pattern that\n",
79128
"\n",
80-
"$2^2 \\cdot 2^1 = 2^3 = 2^{2 + 1}$\n",
129+
"$\\qquad 2^2 \\cdot 2^1 = 2^3 = 2^{2 + 1}$\n",
81130
"\n",
82131
"so that when numbers with exponents are multiplied together, the exponents add.\n",
83132
"There is one interesting result from this.\n",
84133
"We can create a number with an exponent of 0, $2^0$, or \"two multiplied 0 times\", where it is not obvious what that means.\n",
85134
"When we multiply that number by another number with an exponent we get\n",
86135
"\n",
87-
"$2^1 \\cdot 2^0 = 2^{1 + 0} = 2$\n",
136+
"$\\qquad 2^1 \\cdot 2^0 = 2^{1 + 0} = 2$\n",
88137
"\n",
89138
"What value is $2^0$? The only way to get that result is\n",
90139
"\n",
91-
"$2^1 \\cdot 1 = 2$\n",
140+
"$\\qquad 2^1 \\cdot 1 = 2$\n",
92141
"\n",
93142
"Therefore $2^0$ must be 1.\n",
94-
"That fact will be used in the Hindu number system below.\n",
95-
"\n",
96-
"There is a reverse of exponents called *logarithms*. \n",
97-
"If we say a number *N* has the value of a base *B* with an exponent *m*\n",
143+
"That fact will be used in the [Hindu number system](./Number-systems.ipynb#Positional-number-systems).\n",
144+
"\n",
145+
"### Exponent rules\n",
146+
"This is a list of all exponent rules.\n",
147+
"Rule|Formula\n",
148+
"|:- |:-\n",
149+
"Product |$ a^m \\cdot a^n~$=$~a^{m + n}$ \n",
150+
"Quotient |$a^m$$\\div$$a^n~$=$~a^{m - n}$ \n",
151+
"Power of a Power |$(a^m)^n~$=$~a^{mn}$ \n",
152+
"Power of a Product |$(ab)^m~$=$~a^m$$\\cdot$$b^m$ \n",
153+
"Power of a Quotient |$(\\frac{a}{b})^m~$=$~\\frac{a^m}{b^m}$ \n",
154+
"Zero Exponent |$a^0~$=$~1$ \n",
155+
"Negative Exponent |$a^{-1}~$=$~\\frac{1}{a^m}$ \n",
156+
"Fractional Exponent |$a^{\\frac{m}{n}}~$=$~\\sqrt[n]{a^m}$ \n",
157+
"\n",
158+
"### Roots\n",
159+
"The square *root* of a number `n` is the number which if multplied by itself will be `n`. \n",
160+
"$\\qquad \\sqrt{n} \\cdot \\sqrt{n} = (\\sqrt{n})^2 = n$ \n",
161+
"The cube root is the third root of `n`. \n",
162+
"$\\qquad \\sqrt[3]{n} \\cdot \\sqrt[3]{n} \\cdot \\sqrt[3]{n} = (\\sqrt[3]{n})^3 = n$ \n",
163+
"\n",
164+
"The fourth root is $\\sqrt[4]{n}$, and so on.\n",
165+
"We say this following the Fractional exponent rule. \n",
166+
"$\\qquad \\sqrt[n]{a}\\>=\\sqrt[n]{a^1}\\>=\\>a^{\\frac{1}{n}}$ \n",
167+
"\n",
168+
"### Logarithms\n",
169+
"\n",
170+
"*Logarithms* are the reverse of exponents. \n",
171+
"If we say a number `N` has the value of a base `B` to the power `m`.\n",
98172
" \n",
99173
"$N = B^m$\n",
100174
"\n",
101-
"we say that exponent m is the logarithm of N, base B\n",
175+
"The logarithm of `N`, base `B`, is `m`. \n",
102176
"\n",
103177
"${log N}_B = m$\n",
104178
"\n",
105-
"Logarithms are another convenient way to represent large numbers.\n",
179+
"Logarithms are another convenient way to represent large numbers. For `N` = 1000000\n",
180+
"\n",
181+
"$log_{10} N = log_{10} 1000000 = log_{10}\\> 10^6 = 6$\n",
106182
"\n"
107183
]
108184
},
109185
{
110186
"cell_type": "code",
111187
"execution_count": null,
112-
"id": "bf578583",
188+
"id": "58994d42",
113189
"metadata": {},
114190
"outputs": [],
115191
"source": []

0 commit comments

Comments
 (0)