Go back to previous page
Forum URL: http://www.cut-the-knot.org/cgi-bin/dcforum/forumctk.cgi
Forum Name: This and that
Topic ID: 112
#0, "Reducing" large numbers
Posted by Stephen Thorne (Guest) on Apr-19-01 at 05:45 PM
Hope you can help me solving a peculiar problem or at least giving me a hint about how it could be solved.
I'd like to know if it does exist a mathematical function that is able to reduce any large number (about 50 or 100 digits long) to a small number, i.e. something like an "inverted" factorial.
When I'm talking of large or small numbers, I talk about the amount of digits needed to represent it, i.e. 2500 is smaller than 3,1415 because the first requires 4 digits, while the latter requires 5 digits (the comma is insignificant).
Btw, the function should also be reversible (I need to convert the large number to a small one and vice versa).
Thank you in advance.
Best regards,

Stephen Thorne


#1, RE: "Reducing" large numbers
Posted by garethgibson (Guest) on Apr-19-01 at 09:23 PM
In response to message #0
Do you have a scientific calculator? If you do you should be able to convert the number format between decimal and some other format... eg hexadecimal. THis will significantly reduce the number of digits required to represent your number. In the same way binary (base 2) to decimal (base 10) conversion works...

eg.

binary (base 2) 1010101010101010101 is equivalent to
decimal(base 10)349525 which is equivalent to
hexadecimal (base16)55555

The "saving" in digits come s from the base of numerals available to represent a number.

Bnary: two numerals available 0 and 1
Decimal: 10 numerals available 0,1,2,3,4,5,6,7,8 and 9
Hexadecimal: 16 numerals avaialable 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E and F.

YOu may have noticed hexadecimal quite e bit in html when defining colours. It is quite useful here because of the wide range of colours that can be represented with only 6 hexadecimal digits.

I hope that helps you.