200 likes | 439 Views
Number Representations November 23, 2009. Chelsea Lowe Jefferson Parker Joshua Parker. What is Number Representation?. The concept of expressing the same number in many different ways What are different ways of expressing the number 12? Talk amongst yourselves.
E N D
Number RepresentationsNovember 23, 2009 Chelsea Lowe Jefferson Parker Joshua Parker
What is Number Representation? • The concept of expressing the same number in many different ways • What are different ways of expressing the number 12? • Talk amongst yourselves
How can we represent the number 12? • Roman Numeral: XII • Tally Marks:|||||,|||||,|| • Words: twelve • Fractions: (120/10), (12/1) • Different bases: • Base 2 (Binary): 11002 • Base 10 (Common decimal form): 12
Base 10 • This is referred to as ordinary representation • Digits used in base 10 are from the set {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} • Numbers are expressed as a sum of digits from the set above multiplied by powers of 10 • For example • 458 = 4 X 102 + 5 X 101 + 8 X 100 • 5280 = 5 X 103 + 2 X 102 + 8 X 101 + 0 X 100
Base 2 • This is referred to as binary representation • Digits used in base 2 are from the set {0, 1} • Numbers are expressed as a sum of digits from the set above multiplied by powers of 2 • Expressed as a2 where a is some number composed of only 0s and 1s • For example • 102 = 1 X 21 + 0 X 20 = 2 • 11002 = 1 X 23 + 1 X 22 + 0 X 21 + 0 X 20 = 12
Other Bases • Any real number can be expressed in any positive integer base greater than or equal to 2 • For bases 10 or less, numbers in base a can be expressed with the digits {0, 1, 2, …, a-1} • For example in base 5 digits used will be {0, 1, 2, 3, 4}
Other Bases • Any base larger than 10 uses symbols to represent digits equal to or larger than 10 • For example in base 16 (hexadecimal representation) the letters A, B, C, D, E, and F are used to represent 10, 11, 12, 13, 14, and 15 respectively
Modular Arithmatic • Useful for determining the representation of any positive integer x in base b • Examples: • Find the base 5 representation of 2117 • Find the base 8 representation of 2117
Using Modular Arithmetic to Find Base 5 Representation of 2117 • 2117 = 5 X 423 + 2 • 423 = 5 X 84 + 3 • 84 = 5 X 16 + 4 • 16 = 5 X 3 + 1 • 3 = 5 X 0 + 3 • So, 2117 = 314325
Let’s check our answer… • 314325 = 3 X 54 + 1 X 53 + 4 X 52 + 3 X 51 + 2 X 50 • 314325 = 1875 + 125 + 100 + 15 + 2 • 314325 = 2117
Can You Find the Base 8 Representation of 2117? • 2117 = 8 X 264 + 5 • 264 = 8 X 33 + 0 • 33 = 8 X 4 + 1 • 4 = 8 X 0 + 4 • So, 2117 = 41058
Modular Arithmetic and Integer Division • Is ¼ a rational number? • Yes! But what is the base 10 decimal representation of ¼? • You might know off the top of your head that ¼ = 0.25. • But how could you find this if you didn’t know?
Writing ¼ as a Base 10 Decimal • 1/4 X 10 = 10/4 = 2 + 2/4 • 2/4 X 10 = 20/4 = 5 + 0/4 • You can see that the integer values of the remainders creates the base 10 decimal representation of the fraction 1/4 • So 1/4 = 0.25
Writing 3/8 as a Base 10 Decimal • 3/8 X 10 = 30/8 = 3 + 6/8 • 6/8 X 10 = 60/8 = 7 + 4/8 • 4/8 X 10 = 40/8 = 5 + 0/8 • So, 3/8 = 0.375
Writing 1/7 as a Base 10 Decimal • 1/7 X 10 = 10/7 = 1 + 3/7 • 3/7 X 10 = 30/7 = 4 + 2/7 • 2/7 X 10 = 20/7 = 2 + 6/7 • 6/7 X 10 = 60/7 = 8 + 4/7 • 4/7 X 10 = 40/7 = 5+ 5/7 • 5/7 X 10 = 50/7 = 7 + 1/7 • 1/7 X 10 = 10/7 = 1 + 3/7 • So 1/7 = 0.142857
Now how about converting from decimals to fractions? • 0.1313 = 13/102 + 13/104 + 13/106 + …+ 13/10n • = 13/100 (1+1/102 + 1/104 + 1/106 + …+ 1/10n) • What does this look like? • Geometric series!!! • Common ratio, r = 1/102, a = 13/100 • Adds to a/(1-r) = (13/100)/(1 - 1/102) • = (13/100)/(99/100) = (13/100) X (100/99) • = 13/99 • So, 0.1313 = 13/99
An easier, quicker way to do the same thing… • Call 0.1313 the number s • So s = 0.1313 • Multiply through by 100 • 100 s = 13.1313 • Subtract the first equation from the second • We get 99 s = 13 • Solve for s, s = 13/99 • So, 0.1313 = 13/99
Sources • Introduction to Discrete Mathematics by James Burgmeier and Larry Kost • Personal Communication with Professor Larry Kost • Websites: • http://chortle.ccsu.edu/AssemblyTutorial/Chapter-06/ass06_1.html • http://chortle.ccsu.edu/AssemblyTutorial/Chapter-07/ass07_1.html • http://courses.cs.vt.edu/~cs1104/BuildingBlocks/Chapter4.005.html
Homework Problem • Convert 72346 to base 6.