Exploring the Connection: Fibonacci Series and Shannon's Discrete, Noiseless Channel Capacity
πŸ›°οΈ

Exploring the Connection: Fibonacci Series and Shannon's Discrete, Noiseless Channel Capacity

This section from the  paper discusses the concept of a discrete noiseless channel.
This section from the paper discusses the concept of a discrete noiseless channel.

Overview

A discrete noiseless channel is a system for transmitting information without errors. This means that the transmitted symbols are received exactly as sent. Two historical examples are the teletype and telegraphy.

Symbols and Transmission

In such a channel, symbols S1,S2,…,SnS_1, S_2, \ldots, S_n can be transmitted, each taking a specific amount of time tit_i. For instance, in telegraphy:

  1. A dot (one unit of time and one unit open).
  2. A dash (three units of close and one unit open).
  3. A letter space (three units open).
  4. A word space (six units open).

The capacity of the channel, which is the maximum rate at which information can be transmitted, is the main focus.

Channel Capacity Definition

The capacity CC of a discrete channel is defined as:

⁍⁍

Where N(T)N(T) is the number of allowed signals of duration TT.

Explanation

  • N(T)N(T): Number of allowed sequences of length TT.
  • log⁑N(T)\log N(T): Logarithm of the number of sequences, which relates to the amount of information.
  • log⁑N(T)T\frac{\log N(T)}{T}: Average information per unit time.

In simpler terms, CC measures how much information per time unit the channel can transmit when TT becomes very large.

Special Case: Teletype Channel

For the teletype example, if all symbols have the same duration and there are 32 symbols, each symbol represents five bits. Thus, the capacity would be 5n5n bits per second if the system transmits nn symbols per second.

General Case

For different lengths of symbols and constraints on durations, the capacity CC is given by the below.

Mathematical Details

Given symbols S1,S2,…,SnS_1, S_2, \ldots, S_n with durations t1,t2,…,tnt_1, t_2, \ldots, t_n:

⁍⁍

This recurrence relation shows N(t)N(t) as a sum of sequences ending in each symbol SiS_i.

For large tt, N(t)N(t) follows a characteristic equation related to the largest real solution X0X_0:

⁍⁍

This equation helps in finding the asymptotic behavior of N(t)N(t) and thus the channel capacity CC.

Summary

  • Channel Capacity CC measures the information rate of a noiseless channel.
  • For teletype, CC is straightforward when all symbols are equal duration.
  • General case involves solving a recurrence relation to find N(T)N(T).
  • Characteristic Equation is used to find the asymptotic behavior of N(T)N(T).

Understanding N(t)N(t) and the Characteristic Equation

Why is N(t)N(t) the Sum?

N(t)N(t) represents the number of allowed sequences of duration tt. Let's break down why N(t)N(t) can be expressed as a sum:

  1. Allowed Sequences:
    • You have a set of symbols S1,S2,…,SnS_1, S_2, \ldots, S_n with corresponding durations t1,t2,…,tnt_1, t_2, \ldots, t_n.
    • Each sequence of total duration tt can end in any of these symbols.
  2. Recursive Nature:
    • Suppose you know the number of allowed sequences for all durations less than tt.
    • To find N(t)N(t), consider the sequence could end with SiS_i, which has a duration tit_i.
    • The remaining duration before SiS_i must then be tβˆ’tit - t_i.
    • Therefore, the number of sequences of duration tt that end in SiS_i is N(tβˆ’ti)N(t - t_i).
  3. Summing Over All Possible Endings:
    • The total number of sequences of duration tt is the sum of all sequences ending in each possible symbol.
    • This gives us the recurrence relation:

From Recurrence to Characteristic Equation

To solve the recurrence relation, we use generating functions or characteristic equations. Here’s a step-by-step outline of how we get to the characteristic equation:

  1. Assume a Solution Form:
    • Assume N(t)=XtN(t) = X^t is a solution to the recurrence relation. This is a common technique to solve linear recurrence relations.
    • Substitute N(t)=XtN(t) = X^t into the recurrence relation:
  2. Simplify the Equation:
    • Divide through by XtX^t:
  3. Characteristic Equation:
    • The equation 1=Xβˆ’t1+Xβˆ’t2+…+Xβˆ’tn1 = X^{-t_1} + X^{-t_2} + \ldots + X^{-t_n} is known as the characteristic equation.
    • Solving this equation for XX gives the characteristic roots, which help in understanding the behavior of N(t)N(t).

Finding N(t)N(t) Asymptotically

  1. Largest Real Solution:
    • The largest real solution X0X_0 to the characteristic equation determines the dominant term in the growth of N(t)N(t).
    • As tt becomes large, N(t)N(t) behaves asymptotically like X0tX_0^t.
  2. Channel Capacity:
    • Since log⁑N(t)β‰ˆtlog⁑X0\log N(t) \approx t \log X_0 for large tt, the channel capacity CC is: C=lim⁑Tβ†’βˆžlog⁑N(T)T=log⁑X0C = \lim_{T \to \infty} \frac{\log N(T)}{T} = \log X_0

Summary

  • Recurrence Relation: N(t)=N(tβˆ’t1)+N(tβˆ’t2)+…+N(tβˆ’tn)N(t) = N(t - t_1) + N(t - t_2) + \ldots + N(t - t_n) because each sequence can end in any of the symbols SiS_i.
  • Characteristic Equation: Found by assuming a solution form N(t)=XtN(t) = X^t and simplifying to 1=Xβˆ’t1+Xβˆ’t2+…+Xβˆ’tn1 = X^{-t_1} + X^{-t_2} + \ldots + X^{-t_n}.
  • Capacity: The capacity CC is related to the largest real solution X0X_0 of the characteristic equation, where C=log⁑X0C = \log X_0.

This framework allows us to transition from a combinatorial counting problem to a manageable algebraic equation that provides insights into the channel's capacity.

Recurrence Equation Definition

What is a Recurrence Equation?

A recurrence equation (or recurrence relation) is an equation that recursively defines a sequence: each term of the sequence is defined as a function of the preceding terms. In other words, it expresses the nn-th term of the sequence as a function of one or more of its previous terms.

Fields of Study

Recurrence equations are primarily used in the following fields:

  1. Mathematics:
    • Combinatorics: To count objects and solve counting problems.
    • Number Theory: For sequences like Fibonacci numbers.
  2. Computer Science:
    • Algorithms: To analyze the time complexity of recursive algorithms.
    • Data Structures: To determine properties of structures like trees and heaps.
  3. Engineering:
    • Signal Processing: For digital filters and system responses.

Solving Recurrence Equations

There are several methods to solve recurrence equations, depending on their form and complexity:

1. Iterative Method

  • Compute the first few terms manually and look for a pattern.
  • Useful for simple recurrences with obvious patterns.

2. Substitution Method

  • Guess the form of the solution and use mathematical induction to prove it.
  • Example: For linear homogeneous recurrences.

3. Characteristic Equation Method

  • Used for linear recurrences with constant coefficients.
  • Assume solutions of the form an=rna_n = r^n and derive the characteristic polynomial.
  • Solve the characteristic equation to find the roots.

Example: Linear Homogeneous Recurrence Relation

Consider the recurrence relation:

⁍⁍

Steps to solve using the characteristic equation method:

  1. Assume a Solution:
    • an=rna_n = r^n
  2. Substitute and Form the Characteristic Equation:
    • Substitute an=rna_n = r^n into the recurrence relation: rn=c1rnβˆ’1+c2rnβˆ’2+…+ckrnβˆ’kr^n = c_1 r^{n-1} + c_2 r^{n-2} + \ldots + c_k r^{n-k}
    • Divide by rnβˆ’kr^{n-k} to get: rk=c1rkβˆ’1+c2rkβˆ’2+…+ckr^k = c_1 r^{k-1} + c_2 r^{k-2} + \ldots + c_k
    • This is the characteristic equation.
  3. Solve the Characteristic Equation:
    • Find the roots r1,r2,…,rkr_1, r_2, \ldots, r_k.
  4. Form the General Solution:
    • The general solution is a linear combination of the roots:
    • Use initial conditions to solve for the constants A1,A2,…,AkA_1, A_2, \ldots, A_k.

Example: Fibonacci Sequence

The Fibonacci sequence is defined by:

⁍⁍
  1. Characteristic Equation:
⁍⁍
  1. r2βˆ’rβˆ’1=0r^2 - r - 1 = 0
  2. Solve for Roots: r=1Β±52r = \frac{1 \pm \sqrt{5}}{2} Let Ξ±=1+52\alpha = \frac{1 + \sqrt{5}}{2} and Ξ²=1βˆ’52\beta = \frac{1 - \sqrt{5}}{2}.
  3. General Solution: Fn=AΞ±n+BΞ²nF_n = A \alpha^n + B \beta^n Use initial conditions to find AA and BB: F0=0β€…β€ŠβŸΉβ€…β€ŠA+B=0β€…β€ŠβŸΉβ€…β€ŠB=βˆ’AF_0 = 0 \implies A + B = 0 \implies B = -A F1=1β€…β€ŠβŸΉβ€…β€ŠAΞ±+BΞ²=1β€…β€ŠβŸΉβ€…β€ŠA(Ξ±βˆ’Ξ²)=1β€…β€ŠβŸΉβ€…β€ŠA=1Ξ±βˆ’Ξ²=15F_1 = 1 \implies A \alpha + B \beta = 1 \implies A (\alpha - \beta) = 1 \implies A = \frac{1}{\alpha - \beta} = \frac{1}{\sqrt{5}} Hence,
⁍⁍

Python code

import math

# Recursive Fibonacci function
def fibonacci_recursive(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci_recursive(n - 1) + fibonacci_recursive(n - 2)

# Direct Fibonacci function using the closed-form expression (Binet's formula)
def fibonacci_direct(n):
    sqrt_5 = math.sqrt(5)
    alpha = (1 + sqrt_5) / 2
    beta = (1 - sqrt_5) / 2
    return int((alpha**n - beta**n) / sqrt_5)

# Compare results
n_terms = 10  # Number of terms to compare
recursive_results = [fibonacci_recursive(n) for n in range(n_terms)]
direct_results = [fibonacci_direct(n) for n in range(n_terms)]

# Print results
print("n\tRecursive\tDirect")
for n in range(n_terms):
    print(f"{n}\t\t{recursive_results[n]}\t\t\t{direct_results[n]}")

# Check if both methods yield the same results
for n in range(n_terms):
    assert recursive_results[n] == direct_results[n], f"Mismatch at term {n}"
print("Both methods yield the same results.")
n	Recursive	Direct
0		0				0
1		1				1
2		1				1
3		2				2
4		3				3
5		5				5
6		8				8
7		13			13
8		21			21
9		34			34
Both methods yield the same results.

Summary

  • Recurrence Equation: Defines a sequence recursively.
  • Fields: Mathematics, Computer Science, Engineering.
  • Solving Methods: Iterative, Substitution, Characteristic Equation.
  • Example: Fibonacci sequence solution using the characteristic equation method.
  • Comparison between the well known Fibonacci recursion and it’s direct solution.