All 21 questions UPSC has asked on information measure and source coding in the Electrical Engineering Optional (Paper II, Digital Communication) from 1996 to 2026, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Digital Communication topic-wise PYQs page. Circuit diagrams have been redrawn from the question papers.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the numbers were worked out again independently in code (SymPy and NumPy: circuit equations, power balance, matrices, integrals).
- ✓ Proof checked step by step or ✓ Derivation checked step by step for “prove” and “derive” questions, every step was checked against the definitions and standard results.
- ✓ Answer checked step by step for theory and descriptive questions, every point was checked against the standard theory.
Where a printed question is wrong, unclear or incomplete, we say so and solve the intended version.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2026 · 1e 2026 · 6b 2026 · 7b(i) 2026 · 8b(i) 2025 · 5e 2024 · 8a 2023 · 7a 2022 · 6c 2021 · 5d 2019 · 7c 2019 · 8a(i) 2018 · 6b(i) 2018 · 6b(ii) 2017 · 3b 2017 · 5d 2016 · 7c 2012 · 1f(i) 2012 · 5f(i) 2012 · 8b(i) 2006 · 1d 1996 · 200w/9a
A discrete memoryless channel has the following channel matrix: (i) Draw the channel diagram. (ii) If the source has equally likely outputs, compute the probabilities associated with the channel output for .
Solution
(i) Channel diagram
Each input reaches its “own” output with probability , and reaches the middle output (an erasure) with probability . Inputs are never confused with each other. This is a binary erasure channel.
(ii) Output probabilities (, )
(The capacity of this channel is bit per use.)
✓ Checked by computer We computed the output probabilities.
Consider a discrete memoryless source with alphabet and statistics for its output. (i) Apply the Huffman algorithm to this source. Hence, show that the average code-word length of the Huffman code equals 1.3 bits/symbol. (ii) Let the source be extended to order two. Apply the Huffman algorithm to the resulting extended source and show that the average code-word length of the new code equals 1.1975 bits/symbol. (iii) Compare the average code-word length calculated in part (ii) with the entropy of the original source.
Solution
(i) Huffman code for {0.7, 0.15, 0.15}
Combine 0.15 + 0.15 = 0.30, then 0.70 + 0.30 = 1.
| Symbol | p | Code | Length |
|---|---|---|---|
| 0.70 | 0 | 1 | |
| 0.15 | 10 | 2 | |
| 0.15 | 11 | 2 |
(ii) Second-order extension (9 symbols, )
| Pair | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| p | 0.49 | 0.105 | 0.105 | 0.105 | 0.105 | 0.0225 | 0.0225 | 0.0225 | 0.0225 |
| Huffman length | 1 | 3 | 3 | 3 | 4 | 6 | 6 | 6 | 6 |
(Combining: 0.0225 + 0.0225 = 0.045 twice; 0.045 + 0.045 = 0.09; 0.09 + 0.105 = 0.195; 0.105 + 0.105 = 0.21; 0.105 + 0.195 = 0.30; 0.21 + 0.30 = 0.51; 0.49 + 0.51 = 1. Ties may be broken differently, giving other codes with the same average length.)
(iii) Comparison with the entropy
- The single-symbol code has efficiency .
- The extended code has efficiency .
Coding the second extension brings much closer to . By Shannon’s source-coding theorem, , so as the order of extension .
✓ Checked by computer We built both Huffman codes and computed the entropy in Python.
A discrete memoryless source has four symbols with probabilities , , , respectively. I. Calculate . II. Find the amount of information contained in the messages and and compare with the obtained in part (I).
Solution
I. Entropy
II. Information in the two messages (the symbols are independent)
:
That is 1.68 bits per symbol.
:
That is 2.43 bits per symbol.
Comparison
For four symbols, the average information is bits.
- The first message is made of more probable symbols, so it carries less information than average (6.70 < 7.39).
- The second contains rare symbols, so it carries more (9.70 > 7.39).
H is the average information per symbol over long sequences. Individual messages can carry more or less.
✓ Checked by computer We computed the entropy and the message information in Python.
Show that the channel capacity of an ideal AWGN channel with infinite bandwidth is given by bit/sec. Given that: is the average signal power and is the power spectral density of white Gaussian noise.
Solution
Shannon–Hartley capacity
where is the bandwidth and the noise power.
Limit as
Let
Then
Since :
∎
Significance
- Increasing the bandwidth indefinitely does not give unlimited capacity, because the noise power grows with . The capacity is limited by the signal power.
- With , this gives the Shannon limit
✓ Derivation checked step by step We derived the limit step by step.
A code is made up of ‘dots’ and ‘dashes’. Assuming that a dash is three times as long as a dot with one-third the probability of occurrence of a dot, calculate— (i) the information in a dot and a dash; (ii) the entropy of the dot-dash code; (iii) the average rate of information, if a dot lasts for 10 ms and this time is allowed between symbols.
Solution
Probabilities
(i) Information
(ii) Entropy
(iii) Average rate of information
A dot lasts 10 ms, a dash 30 ms, and a 10 ms gap follows each symbol. The average time per symbol is
✓ Checked by computer We computed the information, entropy and rate in Python.
Two sources and emit messages , , and , , with the joint probability P(X,Y) as shown below in the matrix form.
| P(X, Y) | |||
Determine H(X), H(Y), H(X/Y) and H(Y/X).
Solution
Marginals
(The nine joint probabilities sum to 1 ✓.)
Entropies
Conditional entropies
(Mutual information: bit.)
✓ Checked by computer We computed the entropies with exact fractions in Python.
A discrete memoryless source generates three independent message symbols , and with probabilities 0.9, 0.08 and 0.02 respectively. (i) Design a binary variable length Huffman code. (Assign ‘0’ to the message with highest probability). Determine the average code length, compression ratio and coding efficiency. (ii) Design a binary first-order extension code for this source and find the average code length for the designed code. Determine the compression ratio and efficiency for the extended code.
Solution
(i) Huffman code
Combine 0.08 + 0.02 = 0.10, then 0.9 + 0.1 = 1.
| Symbol | p | Code |
|---|---|---|
| 0.90 | 0 | |
| 0.08 | 10 | |
| 0.02 | 11 |
- Efficiency:
- Compression ratio (against a fixed 2-bit code for 3 symbols):
(ii) Second-order extension (9 pairs, )
| Pair | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| p | 0.81 | 0.072 | 0.072 | 0.018 | 0.018 | 0.0064 | 0.0016 | 0.0016 | 0.0004 |
| Code | 0 | 11 | 100 | 1011 | 10100 | 101010 | 1010111 | 10101100 | 10101101 |
| Length | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 8 |
- Efficiency:
- Compression ratio (against 4 bits per pair for 9 symbols):
Extension improves the efficiency greatly, because a single-symbol code cannot use less than 1 bit for the very probable .
✓ Checked by computer We built both Huffman codes and computed the measures in Python.
Find the capacity of the cascade connection of n binary symmetric channels with the same crossover probability ε. What is the capacity when the number of channels goes to infinity?
Solution
One BSC
Crossover probability ε, with capacity
Cascade
A bit is received correctly after channels if it is flipped an even number of times. Let be the overall crossover probability:
(The difference between the even-flip and odd-flip probabilities.) So
The cascade is again a BSC, with crossover :
(Equivalently, by matrix multiplication of the n channel matrices.)
As (for ): , so . Then and :
The output becomes independent of the input. (The exceptions are ε = 0, a perfect channel with , and ε = 1, which inverts every bit, giving for any n.)
✓ Derivation checked step by step We derived the cascade crossover probability step by step.
A discrete memoryless source (DMS) has five symbols , , , and with , , , and . (i) Construct a Shannon Fano code for the source and calculate the efficiency of the code. (ii) Repeat for Huffman code. Compare the results of (i) and (ii).
Solution
Entropy
(i) Shannon–Fano code
Split the ordered list into two groups of nearly equal probability, assign 0 and 1, and repeat:
- {0.4, 0.19} (0.59) | {0.16, 0.15, 0.1} (0.41)
- {0.4} | {0.19}
- {0.16} | {0.15, 0.1}
- {0.15} | {0.1}
| Symbol | p | Code | Length |
|---|---|---|---|
| 0.40 | 00 | 2 | |
| 0.19 | 01 | 2 | |
| 0.16 | 10 | 2 | |
| 0.15 | 110 | 3 | |
| 0.10 | 111 | 3 |
(ii) Huffman code
Combine: 0.15 + 0.10 = 0.25; 0.19 + 0.16 = 0.35; 0.25 + 0.35 = 0.60; 0.40 + 0.60 = 1.
| Symbol | p | Code | Length |
|---|---|---|---|
| 0.40 | 1 | 1 | |
| 0.19 | 000 | 3 | |
| 0.16 | 001 | 3 | |
| 0.15 | 010 | 3 | |
| 0.10 | 011 | 3 |
Comparison: the Huffman code is optimum, with the shorter average length (2.2 < 2.25) and higher efficiency (97.7% against 95.5%). Shannon–Fano is simpler but not always optimal.
✓ Checked by computer We constructed both codes and computed the efficiencies in Python.
Consider a discrete memoryless source, whose output can be modeled as a discrete random variable S taking on symbols from a fixed alphabet with probabilities . Further . Assume that the symbols emitted by the source during successive signaling intervals are statistically independent. Show that the entropy of such a source is bounded by where K represents the number of symbols of the source alphabet.
Solution
Lower bound:
For each , , so and each term . (Terms with contribute 0, since .) Hence .
Equality holds if and only if every term is zero, i.e. one and the rest are 0. There is then no uncertainty.
Upper bound:
Use the inequality (equality only at ). Consider
So .
Equality holds if and only if for all , i.e. : all symbols equiprobable, which is maximum uncertainty.
∎
✓ Proof checked step by step We proved both bounds step by step.
A memoryless source S emits 6 message symbols with probabilities 0.3, 0.25, 0.15, 0.12, 0.1 and 0.08. Determine a 4-ary (quaternary) Huffman code for this source. Determine the average word length, the entropy and the efficiency of this Huffman code.
Solution
Dummy symbols
For an r-ary Huffman code, we need divisible by . With and : , so one dummy symbol of probability 0 is added, making .
Reduction
- Combine the four smallest: 0 + 0.08 + 0.10 + 0.12 = 0.30.
- The remaining four (0.30, 0.30, 0.25, 0.15) combine to 1.
Code (digits 0–3)
| Symbol | p | Code | Length |
|---|---|---|---|
| 0.30 | 0 | 1 | |
| 0.25 | 2 | 1 | |
| 0.15 | 3 | 1 | |
| 0.12 | 10 | 2 | |
| 0.10 | 11 | 2 | |
| 0.08 | 12 | 2 |
Average length
Entropy
Efficiency
✓ Checked by computer We built the quaternary Huffman code and computed the measures in Python.
Write the step-by-step procedure to obtain source code by using Shannon-Fano algorithm.
Solution
Shannon–Fano coding: procedure
- List the source symbols in order of decreasing probability.
- Partition the list into two groups whose total probabilities are as nearly equal as possible, without changing the order.
- Assign 0 to every symbol of the upper group and 1 to every symbol of the lower group, as the first code digit.
- Repeat steps 2–3 within each group, adding further digits, until every group contains only one symbol.
- Each symbol’s codeword is the sequence of digits assigned to it.
- Compute the average length , the entropy and the efficiency .
The code is a prefix code (no codeword is the prefix of another), so it is uniquely and instantaneously decodable. It is optimal (100% efficient) when the probabilities are negative powers of 2. Otherwise Huffman coding may be slightly better.
✓ Answer checked step by step Standard procedure.
Obtain the source code for a source that generates messages with the following probabilities:
Also calculate the efficiency of the code.
Solution
Shannon–Fano partitioning
The probabilities are exact powers of 1/2, so each split is exactly equal:
- {m₁, m₂} (1/2) | {m₃ … m₈} (1/2)
- m₁ | m₂
- {m₃, m₄} (1/4) | {m₅ … m₈} (1/4)
- m₃ | m₄
- {m₅, m₆} | {m₇, m₈}
- and so on.
| Message | p | Code | Length |
|---|---|---|---|
| 1/4 | 00 | 2 | |
| 1/4 | 01 | 2 | |
| 1/8 | 100 | 3 | |
| 1/8 | 101 | 3 | |
| 1/16 | 1100 | 4 | |
| 1/16 | 1101 | 4 | |
| 1/16 | 1110 | 4 | |
| 1/16 | 1111 | 4 |
Average length
Entropy
Efficiency
This holds because each codeword length equals exactly.
✓ Checked by computer We constructed the code and computed the efficiency.
A discrete memoryless source is emitting the symbols , and with probabilities, respectively, 0.2, 0.45 and 0.35. Construct optimal binary Huffman code for the second extension of the source and calculate the coding efficiency.
Solution
Second extension (9 symbols, )
| Pair | p | Code | Length |
|---|---|---|---|
| 0.2025 | 10 | 2 | |
| 0.1575 | 010 | 3 | |
| 0.1575 | 001 | 3 | |
| 0.1225 | 011 | 3 | |
| 0.0900 | 0000 | 4 | |
| 0.0900 | 111 | 3 | |
| 0.0700 | 1100 | 4 | |
| 0.0700 | 0001 | 4 | |
| 0.0400 | 1101 | 4 |
(Ties among the 0.09 and 0.07 entries may be resolved differently without changing .)
Average length
Entropy
Efficiency
For comparison, the single-symbol Huffman code (lengths 2, 1, 2) has and .
✓ Checked by computer We built the Huffman code for the extension in Python.
An information source is modelled as a bandlimited process with a bandwidth of 6000 Hz. This process is sampled at a rate higher than the Nyquist rate to provide a guard band of 2000 Hz. The resulting samples takes one of the value in the set {−4, −3, −1, 2, 4, 7} with corresponding probabilities {0.2, 0.1, 0.15, 0.05, 0.3, 0.2}. Determine the rate of information of the source.
Solution
Sampling rate
Nyquist rate plus guard band:
Entropy per sample
Information rate
✓ Checked by computer We computed the entropy and the information rate in Python.
Eight messages are generated by a source with the following probabilities:
| Message | ||||||||
| Probability | 0.02 | 0.04 | 0.07 | 0.10 | 0.13 | 0.18 | 0.22 | 0.24 |
(i) Use Huffman scheme to code these messages. (ii) Explain and illustrate the prefix property of the code. (iii) Determine the average number of bits per message (1) with the Huffman coding, and (2) with uniform coding assuming the messages to be equiprobable. Also find the information content (entropy) in the message and hence efficiency of the Huffman coding.
Solution
(i) Huffman code
Reduction (combine the two smallest each time):
- 0.02 + 0.04 = 0.06
- 0.06 + 0.07 = 0.13
- 0.10 + 0.13 = 0.23
- 0.13 + 0.18 = 0.31
- 0.22 + 0.23 = 0.45
- 0.24 + 0.31 = 0.55
- 0.45 + 0.55 = 1
| Message | p | Code | Length |
|---|---|---|---|
| 0.24 | 01 | 2 | |
| 0.22 | 11 | 2 | |
| 0.18 | 000 | 3 | |
| 0.13 | 100 | 3 | |
| 0.10 | 101 | 3 | |
| 0.07 | 0010 | 4 | |
| 0.04 | 00110 | 5 | |
| 0.02 | 00111 | 5 |
(ii) Prefix property
No codeword is the beginning (prefix) of any other codeword. For example, 01 is not the start of any other word, and 000 is not the start of 0010. A received bit stream can therefore be decoded instantaneously and uniquely, without separators: read bits until a complete codeword is matched.
Example: 01 11 000 00111 decodes as .
(iii) Averages and efficiency
- Huffman:
- Uniform coding of 8 messages: bits per message.
Entropy:
Efficiency:
- Huffman:
- Uniform:
✓ Checked by computer We built the Huffman code and computed the averages in Python.
This question has the following parts.
(i) A binary PCM system uses a uniform quantizer and an 8-bit binary encoder. If the bit rate is 100 Mb/s, what is the maximum bandwidth for which the system operates satisfactorily? Determine the output signal to quantization ratio when full-load sinusoidal modulating wave of frequency 1 MHz is applied to the input.
(ii) A discrete memoryless source is described by the alphabet and the corresponding probability vector Design a Huffman code for this source; find , the average codeword length for the Huffman code; and determine the efficiency of the code.
Solution
(i) PCM system
Sampling rate:
Maximum message bandwidth (Nyquist):
SQNR for a full-load sinusoid:
(The 1 MHz frequency is within the limit and does not affect the SQNR.)
(ii) Huffman code
Repeatedly combine the two least probable entries:
Codewords (assigning 0 and 1 at each branch):
| Symbol | ||||||||
|---|---|---|---|---|---|---|---|---|
| p | 0.20 | 0.12 | 0.06 | 0.15 | 0.07 | 0.10 | 0.13 | 0.17 |
| Code | 00 | 011 | 1010 | 111 | 1011 | 010 | 100 | 110 |
| Length | 2 | 3 | 4 | 3 | 4 | 3 | 3 | 3 |
Average length
Entropy
Efficiency
✓ Checked by computer Same question as 6.1 (2012 Q1f); we computed the PCM values and the Huffman code in Python.
This question has the following parts.
(i) A convolutional encoder is given in the figure below: (1) Find the impulse response of the encoder. (2) Find the output code word if the input sequence is all 1’s (111111⋯).
(ii) Determine the channel capacity of band-limited waveform AWGN channel with an input power constraint.
Solution
(i) The encoder
From the figure: S1 holds the current input; upper output = S1 ⊕ S2, lower output = S1 ⊕ S3. So
(1) Impulse response (input 1 followed by 0s):
| Time | 0 | 1 | 2 |
|---|---|---|---|
| Output | 11 | 10 | 01 |
Impulse response: 11 10 01
(2) All-ones input (111…):
| Time | 0 | 1 | 2 | 3 | … |
|---|---|---|---|---|---|
| S1 S2 S3 | 100 | 110 | 111 | 111 | … |
| Output | 11 | 01 | 00 | 00 | … |
Output: 11 01 00 00 00 …
The infinite-weight input produces an output of finite weight 3. This shows the code is catastrophic: and share the factor . A few channel errors could then cause infinitely many decoding errors.
(ii) Capacity of the band-limited AWGN channel with power constraint
- Setting: the channel has bandwidth and additive white Gaussian noise of PSD . The input power is at most .
- Sampling: a band-limited signal is represented by samples per second (sampling theorem). Each sample is a use of a discrete-time Gaussian channel , with noise variance (noise power in band ) and .
- Capacity per sample: , where . is maximised when is Gaussian with variance , i.e. when is Gaussian with variance :
- Capacity per second ( samples/s):
This is the Shannon–Hartley theorem.
- As : , which gives the Shannon limit (−1.6 dB).
✓ Derivation checked step by step Same question as 6.3 (2012 Q5f); we computed the responses and derived the capacity step by step.
This question has the following parts.
(i) Bring out the salient points of relation between DM and DPCM. Draw the block diagram of delta modulator and demodulator.
(ii) Find the capacity of an additive white Gaussian noise channel with a bandwidth 1 MHz, power 10 W and noise power spectral density W/Hz
(iii) Explain cyclic codes.
Solution
(i) DM and DPCM
- DM is a special case of DPCM, with:
- a one-bit (two-level) quantizer;
- a first-order predictor with coefficient 1: the accumulator, or integrator, which predicts the next sample as the previous reconstructed value.
- Both transmit the prediction error instead of the sample. Both use feedback around the quantizer, so the receiver tracks the transmitter.
- DPCM uses multi-bit quantization at near-Nyquist rates. DM uses one bit at heavy oversampling.
- DPCM suffers only quantization noise. DM suffers granular noise and slope overload.
(ii) Capacity of the AWGN channel
(iii) Cyclic codes
- A cyclic code is a linear block code in which every cyclic shift of a codeword is also a codeword.
- Codewords are represented as polynomials . Every codeword is a multiple of a generator polynomial of degree , which divides .
- Encoding:
- non-systematic: ;
- systematic: append the remainder of divided by as parity bits.
- Decoding: divide the received polynomial by . A non-zero syndrome (remainder) indicates errors and, for correctable patterns, locates them.
- Encoding and syndrome calculation are implemented simply with linear feedback shift registers.
- Examples:
- Hamming (7,4) with ;
- CRC codes, used for error detection in data networks;
- BCH and Reed–Solomon codes.
- They detect burst errors of length up to .
✓ Checked by computer Same question as 6.1 (2012 Q8b); we computed the capacity in Python.
‘Huffman coding is done to increase the rate of information bits to make them approach the rate of binary digits while in parity-check coding rate of binary digits is increased to make the information transmission more reliable’ Comment.
Solution
The statement is correct.
Comment
- Huffman (source) coding removes redundancy from the source output. Frequent symbols get short codewords and rare symbols long ones, so the average number of binary digits per symbol, , approaches the entropy (information bits per symbol).
- The information rate per binary digit, (the efficiency), approaches 1: each binary digit carries nearly one bit of information.
- In the words of the statement, the rate of information bits is made to approach the rate of binary digits.
- Example: 2.93 digits for an entropy of 2.90 bits gives 99% efficiency.
- Parity-check (channel) coding does the opposite. It adds controlled redundancy (check digits), so that binary digits are sent for every information digits.
- The rate of binary digits rises relative to the information rate (code rate ).
- The redundancy lets the receiver detect and correct errors, making transmission more reliable.
- So the two are complementary:
- source coding makes the representation efficient;
- channel coding makes the transmission reliable.
✓ Answer checked step by step Same statement as 6.3 (2006 Q1d); standard reasoning.
Select any three of the following statements and indicate with justification whether they are correct or incorrect. Your answer must not exceed 200 words for each statement. Modern communication system is concerned with development of transmission and not with the sorting, processing and storing of information.
Solution
The statement is incorrect.
Justification
Modern communication systems are concerned as much with the handling of information (sorting, processing and storage) as with its transmission. Communication today is part of an integrated information system.
Processing:
- source coding and compression (speech, audio, image and video codecs: JPEG, MPEG, MP3);
- channel coding;
- encryption;
- modulation and equalisation in DSP;
- echo cancellation;
- error detection and correction.
All of this is processing of information, and much of it is done in software.
Switching, routing and sorting: packet-switched networks (the Internet) sort, queue, route and prioritise packets (QoS). Digital exchanges switch time slots. Network management sorts traffic.
Storage:
- store-and-forward networks (e-mail, messaging);
- buffering in routers;
- voice mail;
- content-delivery networks and caching;
- cloud storage;
- recording media, which use the same coding theory as communication (CD and DVD Reed–Solomon codes).
Information theory (Shannon) treats transmission, compression and storage in one framework: entropy, capacity, coding.
The convergence of computing and communication (ICT) means that transmission is only one part of the job. Efficient processing, organisation and storage of information are equally central.
So modern communication systems are concerned with transmission, processing, sorting and storage of information alike.
✓ Answer checked step by step Standard reasoning.
More on Digital Communication
- All Electrical Engineering PYQ solutions, topic by topic
- Digital Communication topic-wise PYQs (questions only, for practice)
- Electrical Engineering PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Electrical Engineering booklist
Questions: UPSC Civil Services (Main) Examination, Electrical Engineering Paper II, 1996–2026. Solutions: Optional Province. Found an error? Tell us.

