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

  From Six Operations
  From Various Places
  From More About Symmetry

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.

L0PIIIRIIS3ZN
  1C.concatenate (L)
concatenate (R)xx
  2.reversexx
  3F.get firstxv
  3H.xvv
  4F.get lastxvvv
  4H.xvv
  5A.remove lastx
  6A.remove firstx
 
11.rational valuex
12.irrational value (L)
irrational value (R)xxx
 
21.addx
22.take reciprocalv
23.negatexvv
24.proper-improperx
    conversion
25.same-denominatorxvv
    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.

L0Length 0, i.e., the identity matrix.
PIProper integer.
IIImproper integer.
NEThe 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].
S3The 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.

PIII
[a0][a0,1]
a0     1      a0+1a0
1011
 
RIIS3
[1,a1][a0,1,a2]
a1+11?a0+1
a11a2+11

The second classification is based on the first coefficient of the expansion.

L0 Length 0, i.e., the identity matrix.
PFirst coefficient positive, never a problem.
ZFirst coefficient zero.
NFirst 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.

L0This case carries over to the second classification.
PIThe first coefficient is in the upper left corner.
IIThe first coefficient is in the upper right corner.
NE1.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)