Advertisement

crunch time

Started by March 14, 2003 12:29 PM
7 comments, last by Dalik 21 years, 11 months ago
I have an idea and I need a vital question answered. Say I have a number consisting of one and zeros, it doesnt matter how big it is but for the sake of this question lets make this like this 011011000100111101001100111000111001010 ok is there a math formula that can turn that into a small number like 12, 5 of course bigger number depending how many 1''s and 0''s there are. Then use another formula and input say the number 5 and or input a few numbers and get 011011000100111101001100111000111001010 ? If you dont understand the question I want to turn an unknown size length of 1 and 0 into one number or a few numbers do a math calculation and get the binary number that I started with. If you think you know where a formula might be on this please let me know or point me in a direction.
Interested in being apart of a team of people that are developing a toolkit that can help anyone product an online game? Then click here http://tangle.thomson.id.au/
You could break the binary number into 4 digit pieces that would each become a number from 0-15

like:
0110110001001111

0110, 1100, 0100, 1111

6, 12, 4, 15

You could use other size groups of digits, i.e. break it into 5 digit chunks to get numbers 0-31, 6 digit for 0-63 etc

If you don''t understand it look up binary numbers

I hope this is what you were looking for, I had some trouble understanding the question
Advertisement
010101011111001
let i be the index from right to left of this binary chain. And B(i) the corresponding 1 or 0.
010101011111001 => sum of 2^i*B(i) for every i.

for example:
11010 = 0 + 2^1 + 0 + 2^3 + 2^4 = 26

and the way back in an example again, with the same number 26:
find the biggest power of 2 satisfiing 2^n < number(26)
26 - 2^4 = 10 => 1
10 - 2^3 = 2 => 1
2 - 2^2 < 0 => 0
2 - 2^1 = 0 => 1
2 - 2^0 < 0 => 0
the output is 11010
Yes I understand what your saying.

I kinda dont wanna give to much details but thank you.
Interested in being apart of a team of people that are developing a toolkit that can help anyone product an online game? Then click here http://tangle.thomson.id.au/
if your tyring ot make your own winzip this is not the way to go if uhave 8 bits 11111111 = 255 and u store 255 as text in a file you have just used 32 bits 8 for the 2, 8 for the 5 and another 8 for the next 5 u will end up multiplying your file size by a huge effect
^
|____this guy: 8 * 3 = 24 bits...


two words: hash tables

[edited by - 63616c68h on March 16, 2003 4:28:49 PM]
Keep coming back, because it's worth it, if you work it, so work it, you're worth it!
Advertisement
I''ll caution Dalik to review the forum FAQ. This question seems very academic, homework like. This forum frowns upon homework questions.

Forum FAQ

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Yes I am sorry to say I am learning about compression, but the sad thing is I am not in school anymore since I graduated a few months ago. But none the less I was just getting ideas, if a math calculation that I was asking was possible.

I have some good ideas that I would like to implement but again I am at the idea stage right now not in the coding. So please keep them coming. I got many many years to work on this.

Try not to asume a question about compression is a homework question.

cheers
Interested in being apart of a team of people that are developing a toolkit that can help anyone product an online game? Then click here http://tangle.thomson.id.au/
Dalik,

There is no simple math function that does compression. We are talking about a whole branch of mathematics here.

It sounds like you are wondering if a method you have come up with is original and/or any good. You need to do a lot more research than just asking a question in this forum.

Do a google search on "compression encryption mathematics research" and it will point you in the direction of many years of reading material.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

This topic is closed to new replies.

Advertisement