Talk:Casting out nines: Difference between revisions

more fussing
No edit summary
(more fussing)
Line 32:
 
::::: The new task description seems overly ambigous. For example, in J, I could define the check digit as 9&| or I could define it as +/&(10&#.inv)(^:_) and I see nothing in the current task description to prefer one over the other (except that my existing implementation already uses the shorter version, and in general useless extra code is probably a bad thing -- if nothing else it's usually slower and harder to read). Meanwhile, the application of this mechanism seems completely ambiguous. ... from your above paragraph I was expecting new requirements, but I can't really figure out what they are. I suppose I could replace 9&| with (co9=: 9&|) but that name would be misleading in the general case... anyways, I'll do the naming thing on one of my examples. --[[User:Rdm|Rdm]] 13:13, 29 June 2012 (UTC)
 
::: Casting out nines is always presented as a magic trick you can do with pencil and paper, but instructions for the trick vary from site, to site. Wikipedia says to look over the whole number and cross out pairs of numbers that add to 9, Dr. Math just works with adjacent digits, Wolfram doesn't even bother to reduce numbers to a single digit. Then there's the magic trick of adding or multiplying the reduced numbers as check for correct arithmetic with the full numbers. An explanation of this really needs two parts, one to show that casting out nines produces a residue (or at least a smaller number) congruent mod 9, and another part to explain the congruence relation of modular arithmetic to the ring of integers. The references touch on various parts of this but none of them paint the complete picture.
 
::: Part 3 of the current task makes these unexplained leaps. "co9(x) is the residual of x mod 9." Reference? It's hard to find! Dr. Math does say toward the end that "the check digit is essentially the remainder after you divide by 9", but Wikipedia has no mention of it, and Wolfram makes you conclude it from their typically terse explanation.
 
::: "the procedure can be extended to bases other than 9." First, which procedure? The procedure of digit sums and casting out nines to reduce a number to a smaller one? Extending that to other bases is not even mentioned anywhere, much less shown. Or the produre of checking arithmetic results? This is where I think the congruence relation of modular arithmetic to the ring of integers needs to be pointed out, but it hasn't been done. Or the procedure of optimizing Kaprekar number search with <tt>k%(Base-1) == (k*k)%(Base-1)</tt>? It follows as a check of arithmetic results, but I'm not sure how obvious it is.
 
::: The task is kind of going in different directions. I would simplify it by picking one. For a task about the magic trick of casting out nines, I would require some digit sum and casting out of nines, I would point out the magic trick for sums and products, and sure, co9(k) == co9(k*k) for Kaprekar numbers is a fine application. I would not try to explain how it is equivalent to modular arithmetic beyond disallowing %9 as an implementation of co9. I also would not generalize anything to other bases. That's hard to do by hand, and so pointless, I think. Check the base 10 Kaprekar numbers and let people have their minds stimulated. Actually, for the purposes of chrestomathy, I would put rules for implementing co9 right in the task description and specify to folow those rules, rather than refer them to the Dr. Math page, for example.
 
::: Another possible direction is to make the leap that co9 implments a modular reduction, and make the task about showing this equivalence. I think this would be enough for a task. No checking of arithmetic, no Kaprekar numbers.
 
::: Another possible direction would demonstrate optimization of Kaprekar number search in arbitrary bases. Point out that modular arithmetic gives congruent results to arithmetic with larger numbers. Reference http://en.wikipedia.org/wiki/Modular_arithmetic. If you like, mention that this is the math behind the techniques of casting out nines. That one little mention is all that is appropriate in this task. No details, no applications, no history, just drop it. Title the task "Modular optimization". Make the observation that for all Kaprekar numbers, k%(base-1) == (k*k)%(base-1), and show some results in bases 10 and 17 that can be compared to results on the Kaprekar number task.
 
::: &mdash;[[User:Sonia|Sonia]] 19:37, 29 June 2012 (UTC)
1,707

edits