Number System Conversions and Binary Tree Data Compression

Number System Conversions

  • Problem Statement:

    • Convert the octal number 125,35(8)125{,}35_{(8)} (q=8q=8) into binary (q=2q=2), decimal (q=10q=10), and hexadecimal (q=16q=16) numeral systems.

  • Radix Conversion Reference Table (Q=2Q=2, Q=8Q=8, Q=16Q=16):

    • Decimal 00: Binary 00000000, Octal 000000, Hexadecimal 00

    • Decimal 11: Binary 00010001, Octal 001001, Hexadecimal 11

    • Decimal 22: Binary 00100010, Octal 010010, Hexadecimal 22

    • Decimal 33: Binary 00110011, Octal 011011, Hexadecimal 33

    • Decimal 44: Binary 01000100, Octal 100100, Hexadecimal 44

    • Decimal 55: Binary 01010101, Octal 101101, Hexadecimal 55

    • Decimal 66: Binary 01100110, Octal 110110, Hexadecimal 66

    • Decimal 77: Binary 01110111, Octal 111111, Hexadecimal 77

    • Decimal 88: Binary 10001000, Hexadecimal 88

    • Decimal 99: Binary 10011001, Hexadecimal 99

    • Decimal 1010: Binary 10101010, Hexadecimal AA

    • Decimal 1111: Binary 10111011, Hexadecimal BB

    • Decimal 1212: Binary 11001100, Hexadecimal CC

    • Decimal 1313: Binary 11011101, Hexadecimal DD

    • Decimal 1414: Binary 11101110, Hexadecimal EE

    • Decimal 1515: Binary 11111111, Hexadecimal FF

  • Conversion to Binary (q=2q=2):

    • Each octal digit maps directly to a 3-bit binary triad:

    • Integer portion:

      • 1(8)=001(2)1_{(8)} = 001_{(2)}

      • 2(8)=010(2)2_{(8)} = 010_{(2)}

      • 5(8)=101(2)5_{(8)} = 101_{(2)}

    • Fractional portion:

      • 3(8)=011(2)3_{(8)} = 011_{(2)}

      • 5(8)=101(2)5_{(8)} = 101_{(2)}

    • Concatenated binary value:

    • 125,35(8)=001010101,011101(2)125{,}35_{(8)} = 001010101{,}011101_{(2)}

  • Conversion to Hexadecimal (q=16q=16):

    • Regroup the binary bits into 4-bit tetrads originating outwards from the radix point:

    • Integer portion (grouped to the left with leading zero padding):

      • Binary grouping: 0000 0101 0101(2)0000\ 0101\ 0101_{(2)}

      • Hexadecimal mapping: 0 5 5(16)=55(16)0\ 5\ 5_{(16)} = 55_{(16)}

    • Fractional portion (grouped to the right with trailing zero padding):

      • Binary grouping: 0111 0100(2)0111\ 0100_{(2)}

      • Hexadecimal mapping: 7 4(16)=74(16)7\ 4_{(16)} = 74_{(16)}

    • Concatenated hexadecimal value:

    • 55,74(16)55{,}74_{(16)}

  • Conversion to Decimal (q=10q=10):

    • Positional expansion of the binary representation 001010101,011101(2)001010101{,}011101_{(2)} using powers of 2:

    • Bit positional indices for integer part (from right to left, starting at 00):

      • Index 66: 26=642^6 = 64

      • Index 44: 24=162^4 = 16

      • Index 22: 22=42^2 = 4

      • Index 00: 20=12^0 = 1

      • Integer sum: 64+16+4+1=8564 + 16 + 4 + 1 = 85

    • Bit positional indices for fractional part (from left to right, negative exponents):

      • Index −2-2: 122=14=0,25\frac{1}{2^2} = \frac{1}{4} = 0{,}25

      • Index −3-3: 123=18=0,125\frac{1}{2^3} = \frac{1}{8} = 0{,}125

      • Index −4-4: 124=116=0,0625\frac{1}{2^4} = \frac{1}{16} = 0{,}0625

      • Index −6-6: 126=164=0,015625\frac{1}{2^6} = \frac{1}{64} = 0{,}015625

      • Fractional sum: 0,25+0,125+0,0625+0,015625=0,4531250{,}25 + 0{,}125 + 0{,}0625 + 0{,}015625 = 0{,}453125

    • Total decimal sum:

    • 85+0,453125=85,453125(10)85 + 0{,}453125 = 85{,}453125_{(10)}

Data Compression via Binary Tree Coding


Binary tree compression diagram and manual calculations for the word ABRAKADABRA
  • Character Frequency Analysis:

    • Target word: ABRAKADABRA

    • Total length: 1111 characters

    • Frequencies per symbol:

    • A: appears 5×5\times

    • B: appears 2×2\times

    • R: appears 2×2\times

    • K: appears 1×1\times

    • D: appears 1×1\times

  • Uncompressed Representation (Nezgoščen Zapis):

    • Total unique characters: 55

    • Fixed bit-length required per symbol: ⌈log⁡2(5)⌉=3 bits\lceil \log_2(5) \rceil = 3\,\text{bits}

    • Fixed storage requirement per character type:

    • A: 5×3 b=15 b5 \times 3\,\text{b} = 15\,\text{b}

    • B: 2×3 b=6 b2 \times 3\,\text{b} = 6\,\text{b}

    • R: 2×3 b=6 b2 \times 3\,\text{b} = 6\,\text{b}

    • K: 1×3 b=3 b1 \times 3\,\text{b} = 3\,\text{b}

    • D: 1×3 b=3 b1 \times 3\,\text{b} = 3\,\text{b}

    • Total uncompressed size:

    • 11×3 bits=33 bits11 \times 3\,\text{bits} = 33\,\text{bits}

  • Binary Tree Construction and Topology:

    • Root node containing set ABRKD (cumulative weight 1111):

    • Left branch (00): Leaf node A (frequency 55)

    • Right branch (11): Internal node BRKD (weight 66)

    • Internal node BRKD:

    • Left branch (00): Internal node BR (weight 44)

      • Left branch (00): Leaf node B (frequency 22)

      • Right branch (11): Leaf node R (frequency 22)

    • Right branch (11): Internal node KD (weight 22)

      • Left branch (00): Leaf node K (frequency 11)

      • Right branch (11): Leaf node D (frequency 11)

  • Prefix Codebook:

    • A: Code 0 (length 1 bit1\,\text{bit})

    • B: Code 100 (length 3 bits3\,\text{bits})

    • R: Code 101 (length 3 bits3\,\text{bits})

    • K: Code 110 (length 3 bits3\,\text{bits})

    • D: Code 111 (length 3 bits3\,\text{bits})

  • Compressed Representation (Zgoščen Zapis):

    • Standard mathematical bit accumulation:

    • A: 5×1 b=5 b5 \times 1\,\text{b} = 5\,\text{b}

    • B: 2×3 b=6 b2 \times 3\,\text{b} = 6\,\text{b}

    • R: 2×3 b=6 b2 \times 3\,\text{b} = 6\,\text{b}

    • K: 1×3 b=3 b1 \times 3\,\text{b} = 3\,\text{b}

    • D: 1×3 b=3 b1 \times 3\,\text{b} = 3\,\text{b}

    • Full bit sum: 5 b+6 b+6 b+3 b+3 b=23 bits5\,\text{b} + 6\,\text{b} + 6\,\text{b} + 3\,\text{b} + 3\,\text{b} = 23\,\text{bits}

    • Worksheet branch evaluation:

    • Expression recorded: 0+6+6+3+3=18 b0 + 6 + 6 + 3 + 3 = 18\,\text{b}

  • Full Encoded Message Sequence:

    • Translation of A-B-R-A-K-A-D-A-B-R-A:

    • A = 0

    • B = 100

    • R = 101

    • A = 0

    • K = 110

    • A = 0

    • D = 111

    • A = 0

    • B = 100

    • R = 101

    • A = 0

    • Complete binary bitstream: 01001010110011101001010

  • Compression Metrics:

    • Compression Factor (FzF_z):

    • Formula: Fz=Nezgosˇcˇen zapisZgosˇcˇen zapisF_z = \frac{\text{Nezgoščen zapis}}{\text{Zgoščen zapis}}

    • Computed ratio: Fz=11×3 b18 b=33 b18 b≐1,83F_z = \frac{11 \times 3\,\text{b}}{18\,\text{b}} = \frac{33\,\text{b}}{18\,\text{b}} \doteq 1{,}83

    • Percentage calculation (% zgosˇcˇevanja\%\,\text{zgoščevanja}):

    • Expression: 1,83×100%=183%1{,}83 \times 100\% = 183\%

Grading Criteria and Assessment Scale

  • Task Points Distribution (Točkovanje Nalog):

    • Task 1: 2 t2\,\text{t}

    • Task 2: 2 t2\,\text{t}

    • Task 3: 1,5 t1{,}5\,\text{t}

    • Task 4: 1,5 t1{,}5\,\text{t}

    • Task 5: 2 t2\,\text{t}

    • Task 6: 2 t2\,\text{t}

    • Task 7: 2 t2\,\text{t}

    • Task 8: 2 t2\,\text{t}

    • Task 9: 2,5 t2{,}5\,\text{t}

    • Task 10: 1,5 t1{,}5\,\text{t}

    • Task 11: 2,5 t2{,}5\,\text{t}

    • Task 12: 2,5 t2{,}5\,\text{t}

    • Task 13: 3 t3\,\text{t}

    • Task 14: 2 t2\,\text{t}

    • Task 15: 1,5 t1{,}5\,\text{t}

    • Task 16: 1,5 t1{,}5\,\text{t}

    • Task 17: 3 t3\,\text{t}

    • Task 18: 2 t2\,\text{t}

    • Task 19: 3 t3\,\text{t}

    • Task 20: 3 t3\,\text{t}

    • Total cumulative points: Σ=43,0 points\Sigma = 43{,}0\,\text{points}

    • Page classification index: A - 4

  • Grading Scale Boundaries (Ocenjevanje Nalog):

    • Grade 5 – Excellent (odlično):

    • Points: 43 t−39 t43\,\text{t} - 39\,\text{t}

    • Percentage: 100%−90%100\% - 90\%

    • Grade 4 – Very Good (prav dobro):

    • Points: 38 t−34 t38\,\text{t} - 34\,\text{t}

    • Percentage: 89%−78%89\% - 78\%

    • Grade 3 – Good (dobro):

    • Points: 33 t−28 t33\,\text{t} - 28\,\text{t}

    • Percentage: 77%−66%77\% - 66\%

    • Grade 2 – Sufficient (zadostno):

    • Points: 27 t−21 t27\,\text{t} - 21\,\text{t}

    • Percentage: 65%−50%65\% - 50\%

    • Grade 1 – Insufficient (nezadostno):

    • Points: <21 t< 21\,\text{t}

    • Percentage: <50%< 50\%

Supplementary Worksheet Content: English Language Exercises

  • Verb Tense Completions:

    • Job tenure context: (START) his job at a consultancy since last summer.

    • Work duration context: The company... Last month, he 16 (WORK) late...

    • Social encounter context: ...finally had time to meet. They 17 (NOT SEE) each other for...

    • Conversation duration: ...a café where they 19 (TALK) for hours about their lives.

    • Entrepreneurship dialogue: ...asked, "...you ever 20 (THINK) about starting your... really, yes. Maybe someday I will."

  • Irregular and Regular Noun Plural Forms (4 Points Total):

    • Singular: A phenomenon →\rightarrow Plural: phenomena

    • Singular: A proof →\rightarrow Plural: proofs

    • Singular: A louse →\rightarrow Plural: lice

    • Singular: A calf →\rightarrow Plural: calves