Jump to content
Sign in to follow this  
raaaid

at last i found an inverse entropy algorythm that allows compresion of random info

Recommended Posts

its pretty simple i do i base change from binary and instead of adding the reminder i alternatively add it and substract it:

 

 

you can try it here but the online ide doesnt work youll have to download small basic ide if you want to verify it

 

https://smallbasic-publicwebsite.azurewebsites.net/

 

 

 

re:

TextWindow.WriteLine("enter random number to compress")

number=TextWindow.Read()


dectobin()


compresion()
TextWindow.WriteLine(number+" compressed number:")
decompresion()
 
bintodec()
TextWindow.WriteLine(number+" decompressed number: ")

Goto re

Sub bintodec
numero=0
For i=1 To Text.GetLength(number)
    dig=Text.GetSubText(number,i,1) 
    numero=numero*2+dig
  EndFor
  number=numero
EndSub


Sub dectobin
  numero=""
  While number>0
    dig=Math.Remainder(number,2)
    numero=Text.Append(dig,numero)
    number=Math.Floor(number/2)
  EndWhile
  number=numero
EndSub

Sub compresion

numero=0
flag=1
j=0
While j<Text.GetLength(number)
j=j+1
dig=text.GetSubText(number,j,1)
flag=flag*(-1)
  numero=numero*2-dig*flag
'TextWindow.WriteLine(numero)
  EndWhile
number=numero
endsub


Sub decompresion

numero=""
repeat:
savednumber=number
While number>0
 'TextWindow.WriteLine(number)
dig=Math.Remainder(number,2) 

number=(number+dig*flag)/2
flag=flag*(-1)
  numero=Text.Append(dig,numero) 
EndWhile
l=Text.GetLength(number)
If Math.Remainder(l,2)=0 Then
  flag=-1
  number=savednumber
  Goto repeat
EndIf

number=numero
EndSub

  
  
  
  
  


  
  
  

Share this post


Link to post
Share on other sites

If you want people to take compression algorithms seriously, you need to separate your compression code entirely from your decompression code. That way, people won't need to try to disentangle the whole thing (with all its 'goto's and reused variables) to ensure you aren't merely storing the input somewhere, and then writing it back. Though frankly, since this seems to be another attempt to disprove the pigeonhole principle, I can't imagine anyone taking it seriously anyway. It will fail in at least one of two ways (possibly both): it will fail to compress some numbers, and/or it will compress two (or more) different inputs to the same output. Because it must. Because that is how integers work. Unless of course you've discovered a way to create entirely new integers that fit in between the ones mathematics already knows about.

 

 

  • Upvote 1

Share this post


Link to post
Share on other sites

you were right andy i had saved the variable flag with out noticing

 

still im working on it i think the pigeon principle only applies to limited sets of numbers, of cours you can not fit one thousand pigeons in 999 holes but you can fit infinite pigeons in infinite minus one holes

Share this post


Link to post
Share on other sites

now im thinking on using a transformation of an euclidean space to a flat one

 

in a flat one you just need two coodenates so you save

 

imagine you take a picture of somebody with his arms towards you but the hands are not in the picture

 

how would you know the directions his arms aim ti in  a flat picture?

 

because the arms gorw or shrink as they aim as you see them so you know the 3 coordenates describing a space just wih two

Share this post


Link to post
Share on other sites
On 10/30/2019 at 12:53 PM, raaaid said:

you were right andy i had saved the variable flag with out noticing

 

still im working on it i think the pigeon principle only applies to limited sets of numbers, of cours you can not fit one thousand pigeons in 999 holes but you can fit infinite pigeons in infinite minus one holes

 

Yup, the pigeon hole principle only applies to finite sets. There's no such thing as 'infinite minus one' numbers though, but as Hilbert's paradox demonstrates, you can always find extra room to add things if you work with infinite sets.

https://en.wikipedia.org/wiki/Hilbert's_paradox_of_the_Grand_Hotel

 

Not much use with compression algorithms though, since your data is presumably finite, and making it infinitely long isn't going to make it shorter.

 

 

As for 'transformation of an euclidean space to a flat one', I'm fairly sure that such transformations always entail a loss of information, so no good for lossless compression.

 

  • Upvote 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...