Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Too Many Numbers

  1. Sep 13, 2004 #1
    How do i compress 24 numbers to something like 1 to 6 numbers.
    For example consider these numbers:-

    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.
  2. jcsd
  3. Sep 13, 2004 #2
    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.
  4. Sep 13, 2004 #3
    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
  5. Sep 13, 2004 #4


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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) ?
  6. Sep 13, 2004 #5
    Im hoping to reduce the number of numbers.
    I suppose reducing the number of digits would help too.

  7. Sep 13, 2004 #6


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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).
    Last edited: Sep 13, 2004
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?