Exercise · Volume 1 · 1.2.2-19
Exercise 1.2.2-19
proved in Lean solution written
| Rating | 20 |
|---|---|
| Markers | recommended |
| Kind | K2, decide: say whether a claim holds from the written solution |
| Section | Section 1.2.2 of Volume 1. Companion chapter: Numbers, powers and logarithms |
The task
Decide whether every integer of decimal digits fits into a word of bits and a sign bit.
The exact wording is in your copy of the book.
Hints
Open one hint at a time. Try the exercise again after each.
Hint 1
Bound the largest -digit number.
Hint 2
Compare it with , with the help of .
Solution
Show the solution
A word of bits and a sign holds the integers with . An integer with digits has . Now , so , and hence . Yes, it fits.
Check
and . The largest -digit number is below . A -digit number may not fit, since .
Remarks
The general rule is that decimal digits need bits for the magnitude.
This solution is checked, and a person has not reviewed it yet. The source.
In Lean
proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.
- Problem:
TAOCP.S1_2_2.Ex19.statementaxioms: propext - Solution:
TAOCP.S1_2_2.Ex19.solvedaxioms: Classical.choice, Quot.sound, propext
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.