c - Represent a file as a equation? -


hey first question on se, i'm nervous. have searched answer , done experimenting(hacked java code) , can't seem figure out whether or not possible turn file equation represents decimal representation of machine code makes file.

example:

  • take in file
  • turn binary
  • calculate decimal representation
  • turn number equation saved or written down.

assuming i'm coding in c, know how produce decimal representation of large binary numbers?

the answer question "sure!" binary data encoded arbitrarily long number, , it's possible find multiple equations represent number.

i suspect underlying question you're asking whether doing such thing smaller original file itself. if source file happened contain, example, string "10000000000", represented compactly 10^10, saving bunch of bytes.

the answer whether can done in general "no". fundamental limitation of representing information in more compact format described shannon's theory of information. (see wikipedia article 'information theory' says, in nutshell, more entropy in data, less possible represent information in smaller format. existing compression algorithms, including idea represent data equation, relies on source data having predictable patterns within it. trying compress arbitrary sequence of random numbers, example, can't done.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -