It Terns Out

Not all computers store values in binary, otherwise known as base-2. Some actually store values in ternary, otherwise known as base-3, it terns (er, turns) out! Rather than use 0, 1, and 2 as their digits, as you might expect, though, those ternary computers tend to use -1, 0, and +1, otherwise known as "balanced" ternary, ordinarily written more succinctly as , 0, and +, respectively.

Just as the digits in a binary number, otherwise known as bits, represent multiples of powers of 2, so do the digits in a ternary number, otherwise known as trits, represent multiples of powers of 3. In ternary, the rightmost trit can be said to be in the 1s place (i.e., 30); the second-from-right trit can be said to be in the 3s place (i.e., 31); the third-from-right trit can be said to be in the 9s place (i.e., 32); and so forth.

And so a ternary computer would represent, say, -8 through 8, in decimal, as follows in balanced ternary.

decimal balanced ternary because

-8

−0+

- × 9 + 0 × 3 + + × 1 = -8

-7

−+−

- × 9 + + × 3 + - × 1 = -7

-6

−+0

- × 9 + + × 3 + 0 × 1 = -6

-5

−++

- × 9 + + × 3 + + × 1 = -5

-4

−−

- × 3 + - × 1 = -4

-3

−0

- × 3 + 0 × 1 = -3

-2

−+

- × 3 + + × 1 = -2

-1

- × 1 = -1

0

0

0 × 1 = 0

1

+

+ × 1 = 1

2

+−

+ × 3 + - × 1 = 2

3

+0

+ × 3 + 0 × 1 = 3

4

++

+ × 3 + + × 1 = 4

5

+−−

+ × 9 + - × 3 + - × 1 = 5

6

+−0

+ × 9 + - × 3 + 0 × 1 = 6

7

+−+

+ × 9 + - × 3 + + × 1 = 7

8

+0−

+ × 9 + 0 × 3 + - × 1 = 8

Answer the below in ternary.md.

Questions

  1. (1 point.) How many bits are required to represent, in binary, the decimal number we know as 8, assuming you don’t need to be able to represent negative numbers as well?

  2. (1 point.) How many trits are required to represent, in balanced ternary, the decimal number we know as 8?

  3. (1 point.) How many distinct values can you represent in binary with 2 bits?

  4. (1 point.) How many distinct values can you represent in balanced ternary with 3 trits?

  5. (1 point.) What is the largest (i.e., most positive) value, in decimal, that you can represent in balanced ternary with 3 trits?

  6. (1 point.) What is the smallest (i.e., most negative) value, in decimal, that you can represent in balanced ternary with 3 trits?

  7. (1 point.) How would a ternary computer represent, in balanced ternary, the decimal number we know as 50?

  8. (2 points.) If the only physical input to a ternary computer is electricity, how might each of -, 0, and + actually be stored electronically?

Debrief

  1. Which resources, if any, did you find helpful in answering this problem’s questions?

  2. About how long, in minutes, did you spend on this problem’s questions?