Continued fraction/Arithmetic: Difference between revisions

→‎Matrix NG: Make everything look prettier
No edit summary
(→‎Matrix NG: Make everything look prettier)
Line 30:
\end{bmatrix}
</math>
and a function <math>G(\mathrm{matrix}</math> <math>\mathit{NG}, \mathrm{Number N}<sub/math>1 </submath>N_1, \mathrm{Number}</math> N<submath>2N_2)</submath>)
which returns:
: <math>\frac{a_{12}*\times N_1*\times N_2 + a_1*\times N_1 + a_2*\times N_2 + a}{b_{12}*\times N_1*\times N_2 + b_1*\times N_1 + a_2*\times N_2 + b}</math>
 
: Convince yourself that NG = :
===Basic identities===
: <math>\mathit{NG} = \begin{bmatrix}
0 & 1 & 1 & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}</math> adds N<sub>1</sub> to N<sub>2</sub>
computes <math>N_1 + N_2</math>
:<math>\mathit{NG} = \begin{bmatrix}
0 & 1 & -1 & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}</math> subtracts N<sub>2</sub> from N<sub>1</sub>
:computes <math>\begin{bmatrix}N_1 - N_2</math>
: <math>\mathit{NG} = \begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}</math> multiplies N<sub>1</sub> by N<sub>2</sub>
:computes <math>N_1 \begin{bmatrix}times N_2</math>
: <math>\mathit{NG} = \begin{bmatrix}
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0
\end{bmatrix}</math> divides N<sub>1</sub> by N<sub>2</sub>
:computes <math>\begin{bmatrix}N_1 / N_2</math>
 
===Compound operations===
: <math>\mathit{NG} = \begin{bmatrix}
21 & -15 & 28 & -20 \\
0 & 0 & 0 & 1
\end{bmatrix}</math> calculates (3*N<sub>1</sub> + 4) * (7*N<sub>2</sub> - 5)
calculates (<math>3\times N_1 + 4) \times (7\times N_2 - 5)</math>
:Note that with N<sub>1</sub> = 22, N<sub>2</sub> = 7, and NG = :
 
: <math>\begin{bmatrix}
:Note that with N<sub>1</submath>N_1 = 22</math>, N<sub>2</submath>N_2 = 7</math>, and NG = :
: <math>\mathit{NG} = \begin{bmatrix}
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0
\end{bmatrix}</math>
:I could define the solution to be N<submath>N_1 = 1</submath> = 1, N<sub>2</submath>N_2 = 1</math> and NG = :
: <math>\mathit{NG} = \begin{bmatrix}
0 & 0 & 0 & 22 \\
0 & 0 & 0 & 7
\end{bmatrix}</math>
:So I can define arithmetic as operations on this matrix which make a<submath>a_{12}</submath>, a<submath>1a_1</submath>, a<submath>2a_2</submath>, b<submath>b_{12}</submath>, b<submath>1b_1</submath>, b<submath>2b_2</submath> zero and read the answer from <math>a</math> and <math>b</math>. This is more interesting when N<submath>1N_1</submath> and N<submath>2N_2</submath> are continued fractions, which is the subject of the following tasks.
 
==[[Continued fraction arithmetic/G(matrix NG, Contined Fraction N) | G(matrix NG, Contined Fraction N)]]==
Anonymous user