Emulating digits

In gen­eral, given enough \(n\)-digits, you can em­u­late an \(m\)-digit, for any \(m, n \in\) \(\mathbb N\). If \(m < n,\) you can em­u­late an \(m\)-digit us­ing just one \(n\)-digit — in other words, you can use a digit wheel like a \(7\)-digit if you want to, by just ig­nor­ing three of the pos­si­ble ways to set the digit wheel. If \(m > n,\) things are a bit more difficult, but only slightly.

Ba­si­cally, with 2 \(n\)-digits, you can em­u­late a \(n^2\)-digit, as fol­lows. Us­ing your two \(n\)-digits, en­code a num­ber \((x, y)\) where \(0 \le x < n\) and \(0 \le y < n\). In­ter­pret \((x, y)\) as \(xn + y.\) You have now en­coded a num­ber be­tween 0 (if \(x = y = 0\)) and \(n^2 - 1\) (if \(x = y = n-1\)). Con­grat­u­la­tions, you just used two \(n\)-digits to make an \(n^2\) digit!

You can use the same strat­egy to em­u­late \(n^3\)-digits (in­ter­pret \((x, y, z)\) as \(xn^2 + yn + z\)), \(n^4\)-digits (you get the pic­ture), and so on. Now, to em­u­late an \(m\)-digit, just pick an ex­po­nent \(a\) such that \(n^a > m,\) col­lect \(a\) copies of an \(n\)-digit, and you’re done.

This isn’t nec­es­sar­ily the most effi­cient way to use \(n\)-digits to en­code \(m\)-digits. For ex­am­ple, if \(m\) is 1,000,001 and \(n\) is 10, then you need seven 10-digits. Seven 10-digits are enough to em­u­late a 10-mil­lion-digit, whereas \(m\) is a mere mil­lion-and-one-digit — pay­ing for a 10-mil­lion-digit when all you needed was an \(m\)-digit seems a bit ex­ces­sive. For some differ­ent meth­ods you can use to re­cover your losses when en­cod­ing one type of digit us­ing an­other type of digit, see Frac­tional digits and Frac­tional bits. (Th­ese tech­niques are fairly use­ful in prac­tice, given that mod­ern com­put­ers en­code ev­ery­thing us­ing bits, i.e. 2-digits, and so it’s use­ful to know how to effi­ciently en­code \(m\)-mes­sages us­ing bits when \(m\) is pretty far from the near­est power of 2.)

Parents:

  • Mathematics

    Math­e­mat­ics is the study of num­bers and other ideal ob­jects that can be de­scribed by ax­ioms.