9873

Self-Delimiting Binary Representation of a Ternary List

A list of numbers can be stored as one binary number which concatenates their self-delimiting representations. The numbers do not have be aligned by padding them and there is no need for extra delimiter characters.
This Demonstration stores 24 numbers. Their self-delimited ternary representations are encoded as base 3 digits. Each of the base 3 digits is represented by a pair of binary digits. The fourth possible pair of binary digits represents the delimiter. This delimiter marks the end of each number in the given list of numbers.
You can choose another set of 24 numbers. Each is given by 24 bits. Click on one of the 24 numbers to see its ternary representation and the binary encoding of its self-delimited ternary representation. Note that its self-delimited representation always ends with 2 black pixels.
The left plot at the bottom shows the 24-bit aligned binary representations for the 24 numbers. The binary representations of these numbers are aligned by padding them with zeros. The right plot shows the binary encoding of the self-delimited ternary representation for the same numbers.
Note that the self-delimiting representation needs more bits but no alignment. The gray pixels in the bottom right plot fill the ragged array of bits which results from partitioning the concatened bits of the 24 self-delimiting representations.

THINGS TO TRY

SNAPSHOTS

  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.









 
RELATED RESOURCES
Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2014 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+