PDA

View Full Version : Too Many Numbers


Hypercase
Sep13-04, 04:17 AM
How do i compress 24 numbers to something like 1 to 6 numbers.
For example consider these numbers:-
134217736
14336
16515072
-33554425
768
229376
25165825
-1073741376
16834306
16776192
-1048449
-268402704
16775169
-1336671440
1141059650
53494531
809567024
1090728001

Please help me with an algorithim that will compress these to less than 6 numbers, and that i can reverse the effect of and obtain these number back at a later stage.
Is there any other way that you can think of compressing numbers.
Thanx in advance.
-Cheers.

gravenewworld
Sep13-04, 06:20 AM
If you work with a different number base other than 10 you will be able to shrink how long the numbers are. For example 100 in base 100 would just be 10. Just try to find a different base that will work for you.

gazzo
Sep13-04, 08:04 AM
heh, my compsci lecturer was talking about how she did something like that for her masters thesis, involving prime numbers :S, compressing >60 digit numbers

Gokul43201
Sep13-04, 09:05 AM
Are you trying to reduce the number of digits in each number (the number of numbers remains unchanged), or the total number of numbers (digits of no concern), or do you want to reduce the total number of digits (just reduce memory space...how , doesn't matter) ?

Hypercase
Sep13-04, 10:59 PM
Im hoping to reduce the number of numbers.
I suppose reducing the number of digits would help too.

-Cheers.

Gokul43201
Sep13-04, 11:09 PM
Here's an approach that reduces the number of numbers by any amount you desire...but it increases the total number of digits :

append numbers to each other using a specific sequence (key) as a spacer. Choose the key such that it does not already exist among your numbers. For your numbers, say you pick the sequence 1234 (as that does not appear anywhere) as your spacer.

Now you can combine all your numbers into one giant number with several 1234s in it.

So, you'd have : 1342177361234143361234165150721234-3355442512347681234....

Now, if you wish you can switch to a higher base, to reduce the number of digits (though you'll need more types of digits).