UIT2201: Tutorial Set 9 (Fall 2016)
(Solution Sketch to Selected Problems)
** NOT TO BE GIVEN TO FUTURE UIT2201 STUDENTS **


T9-D1: (Binary Representations) -- DIY (See solution sketch for T9-Q1.)

T9-D2: (ASCII and UNICODE encoding) -- SOLUTION SKETCH
Message: (Does not include the surrounding "" marks.)
    "What are you doing up so early in Cinnamon?" is 43 characters long.
(a) in ASCII code --- 43 bytes = 43x8 bits = 344 bits
(b) in UNICODE --- 86 bytes = 86x8 bits = 688 bits



T9-Q1: (10 points) [Binary Representations] --- SOLUTION SKETCH



T9-Q2: (5 points) (Storing Image) -- SOLUTION SKETCH
(Colour digital picture: true colour with 24 bits per pixel or 3 bytes per pixel)
(a) Uncompressed:
     25 Mega-Pixel image = (25 x 106) x 3 bytes = 75 x 106 bytes 
     A 32-GBytes = (32 x 109) bytes,
     can store (32 x 109) / (75 x 106) = 426.67,  (namely 426 images)

Alternatively, (using 1G = 2^30)
     a 32-GBytes = (32 x 230) = 34,359,738,368 bytes,
     can store (34,359,738,368) / (7.5 x 107) = 458.13,  (namely 458 images)

(b) Compressed 20:1 ratio: 426.66 x 20 = 8533.3,  (namely 8533 images)
            Alternatively, 458.13 x 20 = 9162.60, (namely, 9162 images)


T9-Q3: (5 points) (Storing Sound) -- SOLUTION SKETCH
(MP3 format sound) 4 minute song
[From textbook, MP3 format: sample rate 44,100/sec and bit depth 16 bits]
(a) Uncompressed:   
     44100 samples/sec x 16 bits/sample x (60 x 4) sec = 169,344,000 bits
                                 = 169,344,000/8 bytes =  21,168,000 bytes per song
     A 32-GBytes = (32 x 109) bytes,
     can store (32 x 109) / (21,168,000) = 1511.72,  (namely 1511 songs)

Alternatively, (using 1G = 2^30)
     a 32-GBytes = (32 x 230) = 34,359,738,368 bytes,
     can store (34,359,738,368) / (21,168,000) = 1623.19,  (namely 1623 songs)
 
(b) Compressed 11:1 ratio: 1511.72 x 11 = 16628.87,  (namely 16628 songs)
            Alternatively, 1623.19 x 11 = 17855.12, (namely, 17855 song)

T9-Q4: (5 points) [Creative, Interesting Interpretations] --- DIY

T9-Q5: (10 points) [Boolean Logic Laws] ---- DIY
Using truth tables, prove the following logical laws.
        1. X*(X+Y) = X               [Absorption Law]
        2. ~(X*Y) = (~X) + (~Y)               [de Morgan's Law]
        3. X+(Y*Z) = (X+Y)*(X+Z)         [Distributive Law]


UIT2201: CS & IT Revolution; (Fall 2016); A/P Leong HW