📝 Security services and techniques in networks (12 MCQs)
📖 From Data Communication and Networks • 31. Cryptography and Network Security • 12 questions available
What is Security services and techniques in networks?
Security services like authentication, access control, and non-repudiation define what protection is needed, while security techniques like encryption, digital signatures, and firewalls provide the actual mechanisms to implement those protections in a network.
📝 All Security services and techniques in networks MCQs
Q1. In the context of Huffman coding, what does it mean for a code to be a \prefix code\?
📖 Explanation: A prefix code guarantees that no code word is the beginning of another code word. This property prevents ambiguity during decoding because the moment a complete code is recognized, the decoder can output the symbol without needing to look ahead. It is a fundamental characteristic of Huffman codes.
Q2. Suppose a Huffman tree yields the codes 00, 010, 011, 10, and 11. Which of the following statements is logically implied?
📖 Explanation: Because the set {00,010,011,10,11} satisfies the prefix property, none of the shorter codes (00,10,11) can start any longer code. Therefore, each code can be identified uniquely as soon as its bits are read, confirming that no code is a prefix of any other.
Q3. If the symbol frequencies are A:40%, B:30%, C:20%, D:10% for four symbols, which coding scheme yields a lower average code length?
📖 Explanation: The Huffman algorithm assigns the shortest code to the most frequent symbol (A) and longer codes to less frequent symbols. With lengths 1,2,3,3 bits, the weighted average becomes 0.4·1+0.3·2+0.2·3+0.1·3 = 1.9 bits, which is less than the fixed 2‑bit average.
Q4. Given symbols X, Y, Z with probabilities 0.5, 0.3, 0.2, what is the optimal Huffman code length for each symbol?
📖 Explanation: The two lowest probabilities (0.3 and 0.2) are combined first, giving a node of weight 0.5. This node and the highest‑probability symbol (0.5) are then merged. The resulting tree gives X a depth of 1 bit, while Y and Z each have depth 2, matching the optimal Huffman lengths.
Q5. A message of 100 characters encoded with a fixed‑length 3‑bit code occupies 300 bits. Using the Huffman code shown in the passage (average length 2.1 bits per character), what is the percentage reduction in transmitted bits?
📖 Explanation: The fixed‑length representation needs 300 bits. The Huffman representation needs 100 × 2.1 = 210 bits. The reduction is (300 − 210) / 300 = 0.30, or 30 %. This demonstrates the compression benefit achieved by exploiting symbol frequencies with Huffman coding.
Q6. Why does the absence of a code being a prefix of another guarantee that Huffman decoding can be performed instantaneously?
📖 Explanation: When no code word is a prefix of another, the decoder can decide as soon as a complete code appears in the bit stream. There is no ambiguity, so the decoder never has to retract bits or look ahead, eliminating back‑tracking and enabling immediate symbol identification.
Q7. Design a Huffman code for the alphabet {A,B,C,D,E} with frequencies {0.4,0.2,0.2,0.1,0.1}. Which of the following sets of code lengths is feasible?
📖 Explanation: The Kraft inequality must hold for any prefix code. For the set {1,3,3,4,4}, the sum is 2⁻¹+2⁻³+2⁻³+2⁻⁴+2⁻⁴ = 0.5+0.125+0.125+0.0625+0.0625 = 0.875 ≤ 1, so it is feasible. The other options exceed 1, making them impossible for a prefix‑free Huffman code.
Q8. If a Huffman code assigns the 2‑bit code 00 to symbol X, which of the following statements must be true about any other symbol's code?
📖 Explanation: Because Huffman codes are prefix‑free, once a code word (00) is assigned, no other code can start with the same bit pattern. Otherwise, the decoder could not uniquely determine where the first symbol ends, violating the prefix property essential for instantaneous decoding.
Q9. A text string contains 50 occurrences of 'A', 30 of 'B', 15 of 'C', and 5 of 'D'. Using Huffman coding, what is the total number of bits needed to encode the string if the resulting code lengths are 1,2,3,3 bits respectively?
📖 Explanation: Compute the weighted sum: 50 × 1 = 50, 30 × 2 = 60, 15 × 3 = 45, 5 × 3 = 15. Adding these yields 50+60+45+15 = 170 bits. This total reflects the efficiency of Huffman coding compared with a fixed‑length scheme that would require 4 × 100 = 400 bits.
Q10. How does the average length of an optimal Huffman code relate to the source entropy for a set of symbols?
📖 Explanation: The optimal Huffman code achieves an average length that satisfies . This bound follows from the fact that Huffman coding produces a prefix code whose expected length cannot be shorter than the entropy, yet it never exceeds the entropy by more than one bit per symbol.
Q11. For a five‑character alphabet, the minimum fixed‑length code requires bits per symbol. What is this number?
📖 Explanation: The binary logarithm of 5 is approximately 2.32. Taking the ceiling gives the smallest integer not less than this value, which is 3. Therefore, any fixed‑length binary representation for five distinct symbols must use at least 3 bits per symbol.
Q12. Compared to a Shannon‑Fano code for the same symbol probabilities, a Huffman code is guaranteed to be:
📖 Explanation: Huffman coding constructs the optimal prefix code by repeatedly merging the two least‑probable symbols, guaranteeing the minimal possible average code length. Shannon‑Fano, which splits symbols based on cumulative probability, may produce longer average lengths. Consequently, Huffman's average length is always less than or equal to that of Shannon‑Fano for the same distribution.