Here are some coding theory scripts I’ve written in python for ease of learning and to handle homework tasks from the Hankerson textbook.
KBITS
KBITS FUNCTION for generating all binary numbers of length n and k 1 bits.
Likelihood
LIKE FUNCTION for finding out probability that if v is sent, w is received. input: word sent, word received, probability of error output: probability that the word w is received
Most Likely Word Send
BEST FUNCTION for finding out best w for given V”
input format: word received, all elements of C as individual string arguments
output: best possible value of v
Error Pattern
EP FUNCTION for finding out error pattern
input format: word received, all elements of C as individual string arguments
output: all error patterns of w
Incomplete Maximum Likelihood Decoder
IMLD FUNCTION for finding out the best fit v for a given w through xor’ing through all the possible words in C input format: word received, all elements of C as individual string arguments output: error patterns of w, closest v value, dictionary of word in C : weight of error pattern for reference
Reliability of MLD
REL FUNCTION for finding out probability theta p as sum of probability of v = w input format: word sent, probability of error, set L(v) output: theta p
ENTER P AS NUMBER NOT STRING!”””
Correctable Error Patterns
ERR FUNCTION for finding out all error patterns that will be corrected input format:setC containing, all error patterns, output: list of correctable things
近期评论