Apparently it's only in a "chapter study guide" that goes along with the algebra book: http://nseuntj.weebly.com/uploads/1/8/2/0/18201983/2.1relations_and_function... page 10 On Tue, Sep 8, 2015 at 2:02 PM, Ed Pegg Jr <ed@mathpuzzle.com> wrote:
Over at Reddit, http://i.imgur.com/tDSX24E.jpg is getting a lot of attention.
https://www.reddit.com/r/math/comments/3k1qe6/this_is_in_a_high_school_math_...
In short, the textbook Glencoe Algebra II claims that there is no relation between the integers and the rationals. Georg Cantor showed it in the 1870's.
There is also Calkin-Wilf and Stern-Brocat
CalkinWilfPosition[r_] := With[{cf = ContinuedFraction[r]}, First@FromDigits[ Flatten@MapIndexed[Table[Mod[#2[[1]], 2], {#1}] &, Reverse@#], {2}] &@ If[EvenQ[Length[cf]], MapAt[Sequence @@ {# - 1, 1} &, cf, -1], cf]];
CalkinWilfRational[n_Integer] := Module[{s0, s1}, s0 = IntegerDigits[n, 2]; s1 = If[EvenQ[Length[#]], MapAt[(Sequence @@ {#, {}}) &, #, -1], #] &@Split[s0]; FromContinuedFraction[Reverse[Length /@ s1]]];
AlmostBitReverse[n_] := FromDigits[ Prepend[Reverse[Drop[IntegerDigits[n, 2], 1]], 1], 2];
SternBrocatPosition[fraction_] := AlmostBitReverse[CalkinWilfPosition[fraction]];
SternBrocatRational[n_Integer] := CalkinWilfRational[AlmostBitReverse[n]];
I figured that the relationship between these would be in OEIS -- and they are. https://oeis.org/A059893 -- but this doesn't mention the relation. But it's how I came up with the Stern-Brocat code. If you order either set of fractions, the position in the other set is given by A059893
--Ed Pegg Jr. _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- Mike Stay - metaweta@gmail.com http://www.cs.auckland.ac.nz/~mike http://reperiendi.wordpress.com