Click here to Skip to main content
15,915,873 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Two become one... Pin
Michael Dunn9-Dec-06 15:57
sitebuilderMichael Dunn9-Dec-06 15:57 
GeneralRe: Two become one... Pin
Kevnar9-Dec-06 16:20
Kevnar9-Dec-06 16:20 
AnswerRe: Two become one... Pin
Chris Maunder10-Dec-06 9:55
cofounderChris Maunder10-Dec-06 9:55 
GeneralRe: Two become one... Pin
Kevnar10-Dec-06 10:13
Kevnar10-Dec-06 10:13 
GeneralRe: Two become one... Pin
Chris Maunder10-Dec-06 10:52
cofounderChris Maunder10-Dec-06 10:52 
GeneralRe: Two become one... Pin
Kevnar10-Dec-06 17:06
Kevnar10-Dec-06 17:06 
AnswerRe: Two become one... Pin
PIEBALDconsult24-Jan-07 4:11
mvePIEBALDconsult24-Jan-07 4:11 
AnswerRe: Two become one... Pin
Rilhas30-Jan-07 13:32
Rilhas30-Jan-07 13:32 
Simple answer is no. Long answer is maybe.

For example, if your number A is guaranteed to never reach 19 and the other number B is guaranteed to never reach 13 then you can add them with the following formula:

C=A*13+B

The value C always fits in 1 byte. The individual values can be recovered with the formula:

A=C/13
B=C%13

This is not a simple bit combination, since A needs 5 bits, B needs 4 bits, and C needs 8. But, to be honest, the largest A times the largest B cannot exceed the 8 bits of capacity of C. This can, of course, be generalized to other bit sizes.

So, no magical compression here, and no violation of the principle of the conservation of energy in the universe.

All forms of turbo-coding (ones that use state machines behind the sceenes to help determine what the numbers could be when spliting them back again) like the ones I've seen posted here (mentioning rand) do not guarantee you can recover the original exactly. So, to compress executables I wouldn't use turbo-coding, but for audio files then maybe... if the state machines are clever enough.

Rogério Rilhas

GeneralRe: Two become one... Pin
Kevnar30-Jan-07 14:39
Kevnar30-Jan-07 14:39 
GeneralRe: Two become one... Pin
Rilhas31-Jan-07 14:26
Rilhas31-Jan-07 14:26 
GeneralRe: Two become one... Pin
Kevnar31-Jan-07 18:17
Kevnar31-Jan-07 18:17 
QuestionGENETIC ALGORITHM FOR BUS ROUTE NETWORK DESIGN, help me Pin
DHIRAJ SHETI7-Dec-06 17:57
DHIRAJ SHETI7-Dec-06 17:57 
AnswerRe: GENETIC ALGORITHM FOR BUS ROUTE NETWORK DESIGN, help me Pin
karam chandrabose8-Dec-06 5:35
karam chandrabose8-Dec-06 5:35 
GeneralRe: GENETIC ALGORITHM FOR BUS ROUTE NETWORK DESIGN, help me Pin
dead_link8-Dec-06 8:37
dead_link8-Dec-06 8:37 
GeneralRe: GENETIC ALGORITHM FOR BUS ROUTE NETWORK DESIGN, help me Pin
Dan Neely8-Dec-06 9:16
Dan Neely8-Dec-06 9:16 
GeneralRe: GENETIC ALGORITHM FOR BUS ROUTE NETWORK DESIGN, help me Pin
DHIRAJ SHETI8-Dec-06 19:14
DHIRAJ SHETI8-Dec-06 19:14 
GeneralRe: GENETIC ALGORITHM FOR BUS ROUTE NETWORK DESIGN, help me Pin
DHIRAJ SHETI8-Dec-06 19:10
DHIRAJ SHETI8-Dec-06 19:10 
Questionfirst occurence of multiple search terms in a string Pin
peterchen5-Dec-06 16:55
peterchen5-Dec-06 16:55 
AnswerRe: first occurence of multiple search terms in a string Pin
Frank Kerrigan5-Dec-06 23:30
Frank Kerrigan5-Dec-06 23:30 
GeneralRe: first occurence of multiple search terms in a string Pin
peterchen6-Dec-06 1:21
peterchen6-Dec-06 1:21 
AnswerRe: first occurence of multiple search terms in a string Pin
Bassam Abdul-Baki6-Dec-06 8:27
professionalBassam Abdul-Baki6-Dec-06 8:27 
AnswerRe: first occurence of multiple search terms in a string Pin
szukuro7-Dec-06 1:02
szukuro7-Dec-06 1:02 
AnswerRe: first occurence of multiple search terms in a string Pin
ricecake7-Dec-06 3:22
ricecake7-Dec-06 3:22 
AnswerRe: first occurence of multiple search terms in a string Pin
A.A.7-Dec-06 3:28
A.A.7-Dec-06 3:28 
GeneralRe: first occurence of multiple search terms in a string Pin
peterchen9-Dec-06 3:05
peterchen9-Dec-06 3:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.