Jump to content

Math Algorithm Help Please


Salis

Recommended Posts

I have give myself a bit of a challenge over the past week. I need some help on figuring out how to equate 8 numbers in to 1 number, the turn around and get those numbers back. This is a little hard to explain but I'll do my best:

 

Let's say I have; 25,52,16,25,52,24,0,16

I now need away to combine these numbers in to 1 number (smaller)

Say 25+52+16 and so on then once I have my base number, I need to recover the original array of 8. Dose this make since, can any one help me?

 

I know this is hard so thank you to every one who gives it a shot.

Link to comment
Share on other sites

Adding the numbers to get one isn't a problem. Deriving the same numbers from one is a tough process because there are lots of combinations.

 

For example, how do you make 100 out of 8 numbers?

100 + 0 + 0 + 0 + 0 + 0 + 0 + 0

99 + 1 + 0 + 0 + 0 + 0 + 0 + 0

...and so on...

Link to comment
Share on other sites

I agree. That's what I'm stuck on. I've thought about a "Magic Number" that I all ready know. I'm thinking that if you take the final Number and the "Magic Number" along with the last number in the array, then through some algorithm check and compare to return each number in the array. So for an example if you have the Magic Number = 100 then you could take 100+25=125,100+52=152 :: 125+152... or something.

 

Maybe a few known constants? I'll tell ya, coming up with an equation is hard.

Link to comment
Share on other sites

Compact. I'm actually working on a compression algorithm. My intention is freeware of course. My theory is that if you open a file read the bytes, convert the bytes to an integer array then compute that array to a single number (or a much much much smaller groups of numbers you can drastically reduce the size of the file. I have every working so far except for the algorithm! Think about it if you add 1+2+3+4+5 up to 20 you get 210. So you just took 20 bytes and compressed it to 1 byte with an impressive 20:1 ration on bytes! Now think of that on MB or GB file sizes. I do a little programming Visual Basic EE and I've been digging around on the MSDN forums for a few days. But that's the idea. It's hard to explain still but if take a set of numbers and equate them in way that they can be recovered then this is possible. If we can calculate equations that require hundreds of pads of paper and a lot of erasers then I think this is possible.

 

Imagen the server storage and Bandwidth savings! This is a project I've been thinking about for 2 or 3 months. In theory, we could go back to Dialup and have the same DL times.

 

That code you helped me with effigy, is actually part of my compression for php.

Link to comment
Share on other sites

You might want to look for patterns instead.

 

E.g. if you had the number 888883333333 you would see that you had five eights and seven threes. You could write 8[5]3[7].

 

The first one uses 12 characters and the last one uses 8 characters. That's 4 characters saved and that is a compression ratio of about 33%.

Link to comment
Share on other sites

maybe some kind of combo of the Magic Number and the Number of records (Numbers [8])

 

say

(1 * 25 * 100) * (2 * 52 * 100) * (3 * 16 * 100) ........

 

 

I like that, it's a good idea, but I keep hitting the same wall. In this case, isolation. I would need a way to recover this. If you calculate this you get 124800000000 (Which is much larger) Maybe if I exclude the 100s...

Link to comment
Share on other sites

You might want to look for patterns instead.

 

E.g. if you had the number 888883333333 you would see that you had five eights and seven threes. You could write 8[5]3[7].

 

The first one uses 12 characters and the last one uses 8 characters. That's 4 characters saved and that is a compression ratio of about 33%.

This is a good form of compression but it's has been done. 33% is a very good ratio but I've been looking into file, view in hex and ascii and for the ratios I want I'm not sure if this would work. Basically I'm trying to take 10 pounds and cram it into a 5 pound bag......

 

but man I know this ca be done I just know it!

Link to comment
Share on other sites

My idea is based on patters much like other compression programs, but where my design differs is with the way it handles the patters (at least in my mind right now it does). So far this is what I've been thinking.

 

If we know a constant number in the equation then we have a better shot of recovering the array. So if we know the number 100 and we periodically add that to the equation this help us check for the remaining integers which will then be converted to bytes. (I've tested Byte to integer to byte conversion using php and an image and it works which is 40% of this program...)

 

I'm trying to come up with an equation that can kind'a check it's self. I was thinking that while equating the array, a separate array is built to guide the equation. So If we take 25(-1) + 100 = 75' then take 52(-1) + 100 = 48 and 16(-1) + 100 = 86. Now add one of these to an array of know values which will help equate.

 

The reason I chose 25(-1) + 100 is because 25 is our unknown value. We don't know how to get this. We know 100 or at least the answer should be 100. Since we know the equation gives us 75 and we know 75 should actually be 100 we would subtract 75 from 100 giving us the original value of 25. This is a simple check, 6th grade algebra. Basically x = y - 75, x=? and y=100

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.