Lesson 14 of 15
Channel Matrix and Mutual Information
Channel Matrix
A discrete memoryless channel is fully described by its channel matrix (also called transition matrix or stochastic matrix):
Row gives the conditional distribution of output given input . Each row sums to 1.
Computing Output Probabilities
Given input distribution and channel matrix , the marginal output distribution is:
In matrix form: .
Mutual Information Through a Channel
The mutual information between input and output is:
The joint distribution needed for is:
Examples
Noiseless (identity) channel: (identity matrix) → , no information lost.
Completely noisy: each row of is identical → output is independent of input → .
import math
def channel_output_probs(input_probs, channel_matrix):
n_in = len(input_probs)
n_out = len(channel_matrix[0])
return [sum(input_probs[i] * channel_matrix[i][j]
for i in range(n_in)) for j in range(n_out)]
identity = [[1.0, 0.0], [0.0, 1.0]]
print(channel_output_probs([0.5, 0.5], identity)) # [0.5, 0.5]
Your Task
Implement:
channel_output_probs(input_probs, channel_matrix)—channel_mutual_info(input_probs, channel_matrix)— using the joint distribution
Python runtime loading...
Loading...
Click "Run" to execute your code.