Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Theoretical numeric data minimization

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Theoretical numeric data minimization

    I have been working on a program for about a year now that encodes and decodes text files. The problem is that encoded text files are far larger than their originals. I want them to be smaller. There is an intermediate step in the converting algorithm that changes the letters into ASCII code, which is where the numbers come in. I was wondering if there was a way to reduce the amount of letters by combining them in some way while keeping the original text.
    A simpler way to put it is:
    I have two numbers that range from 0-255. I need to combine them into one number between 0 and 225, or I need to combine them into two smaller numbers who's total length (character-wise) is not greater than that of the original two. The catch is, I also need to get them back in their original form, so simply subtracting the smaller from the larger won't work. Also, all of the numbers must be integers, so division will probably not be very practical.
    I've been trying to figure out an answer to this problem for a while, and I don't even know if there is one.

    Thanks,

    Xenone


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,330
    Thanks
    181
    Thanked 829 Times in 772 Posts
    Blog Entries
    5

    Default Re: Theoretical numeric data minimization

    Sounds like you want a data compression algorithm. There are many algorithms to accomplish this: have a look at Data compression - Wikipedia, the free encyclopedia

Similar Threads

  1. File class theoretical question
    By Darqneez in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: June 23rd, 2011, 04:25 PM
  2. Data is covered by latter data
    By ljz1031 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: June 15th, 2011, 08:04 PM
  3. Replies: 2
    Last Post: June 15th, 2011, 03:49 PM
  4. Replies: 1
    Last Post: June 11th, 2011, 05:39 AM
  5. Working out the day from numeric date (dd/mm/yy format).
    By ShaunB in forum Java Theory & Questions
    Replies: 6
    Last Post: April 23rd, 2011, 08:55 PM