Home
> urticator.net
Search
About This Site
> Domains
Glue
Stories
Computers
Driving
Games
Humor
Law
> Math
Numbers
Science
Continued Fractions
The Markov Project
> The Markov Project (Epilogue)
Game Theory (Section)
Group Theory
Probability
Miscellaneous
The True Pattern
Mutations
Some Definitions
The True Formula
More About Symmetry
> Details About Operations
|
One Bit of Information
The Irrational Value
A Nice Construction
Bibliography
|
|
Details About Operations
I already talked about operations on matrices a bunch in Six Operations and More About Symmetry. Here I just want to collect some useful details that didn't fit anywhere else.
First, let's define a few terms. Some operations can be implemented in more than one way. Let's call those ways methods. A method may be composite, i.e., built up out of other operations, or it may be atomic, i.e., difficult to separate into smaller pieces.
Next, let's deal with the seven special cases all at once.
| | L0 | PI | II | RII | S3 | Z | N |
| 1C. | concatenate (L) |
| concatenate (R) | | | | | | x | x |
| 2. | reverse | | | | | | x | x |
| 3F. | get first | x | | v |
| 3H. | | x | v | | | v |
| 4F. | get last | x | | | v | | v | v |
| 4H. | | x | v | | | v |
| 5A. | remove last | x |
| 6A. | remove first | x |
| |
| 11. | rational value | x |
| 12. | irrational value (L) |
| irrational value (R) | x | | | | | x | x |
| |
| 21. | add | x |
| 22. | take reciprocal | | | | | | | v |
| 23. | negate | x | v | v |
| 24. | proper-improper | x |
| conversion |
| 25. | same-denominator | x | v | v |
| conversion |
What does it all mean?
- The rows represent atomic methods. I also included a row for operation 25 since it has special cases but no atomic methods.
- The columns represent special cases. I'll explain the system of code names in a moment.
- “v” means the special case requires special handling. I will discuss these cases below.
- “x” means the special case must be excluded because it doesn't even make sense to apply the operation to the special case. Every method, atomic or composite, that implements the operation must check for these cases and fail. I will not discuss these cases below.
- I wrote a nice little program to check my work, so I know I didn't miss any cases.
- For theoretical purposes, it's sometimes convenient to regard the identity matrix as a continued fraction with length 0, but for practical purposes, it's not very useful, as the L0 column shows.
What about composite methods? In general, they're predictable—they fail in excluded cases and succeed in all others. I don't want to clutter up the table with predictable information, so instead I'll just add a couple of notes below about behavior that isn't predictable.
The special cases come from two different classifications. We already saw the first classification at the start of Matrices That Represent Continued Fractions.
| L0 | Length 0, i.e., the identity matrix. |
| PI | Proper integer. |
| II | Improper integer. |
| NE | The non-exception case, never a problem. |
Note that to perform the first classification, we only need to look at the denominators. In Matrices That Represent Continued Fractions we also needed to look at the numerators, but here we should already know that the matrix represents a continued fraction.
The next two cases aren't covered by either of the two classifications, so we need to know how to detect them.
| RII | Reversed improper integer, i.e., expansions of the form [1,a1]. Case RII is a subset of case NE, except for [1,1], which is the intersection of cases II and RII. To detect case RII, check whether the entries in the second column are both 1 and the determinant is 1 (even length). Note that for case II we don't need to check the determinant, but for case RII we do, to exclude expansions of the form [0,1,a2]. |
| S3 | The special case with length 3, defined to be expansions of the form [a0,1,a2]. Case S3 is a subset of case NE. To detect case S3, check whether the entry in the lower right corner is 1 and the determinant is −1 (odd length). |
For reference, here's a little table.
| PI | | II |
| [a0] | | [a0,1] |
| a0 | 1 | | a0+1 | a0 |
| 1 | 0 | | 1 | 1 |
| |
| RII | | S3 |
| [1,a1] | | [a0,1,a2] |
| a1+1 | 1 | | ? | a0+1 |
| a1 | 1 | | a2+1 | 1 |
The second classification is based on the first coefficient of the expansion.
| L0 | Length 0, i.e., the identity matrix. |
| P | First coefficient positive, never a problem. |
| Z | First coefficient zero. |
| N | First coefficient negative. |
Note that for improper integers, the value of the expansion is offset by 1 from the first coefficient. In particular, the value of [−1,1] is 0 and the value of [0,1] is 1.
The obvious way to perform the second classification is to get the first coefficient (an operation) and then check the sign, but that pains me because the operation uses division, and I'm such a dinosaur that I think division is expensive. So, here's a better way based on the result of the first classification.
| L0 | | This case carries over to the second classification. |
| PI | | The first coefficient is in the upper left corner. |
| II | | The first coefficient is in the upper right corner. |
| NE | 1. | If the entry in the upper left corner is negative (less than zero), then the first coefficient is negative. |
| 2. | If the entry in the upper left corner is less than the entry in the lower left corner, then the first coefficient is zero. |
| 3. | Otherwise, the first coefficient is positive. |
It's also possible to detect the positive case first. That might be better.
next
|
|
See Also
First Question, The
More About Symmetry
Nice Correspondence, A
o December (2025)
@ November (2026)
|