In: Computer Science
Updated! Python Code
4. Enhanced transmission method
Use the same probabilities ?0 ; ?0; and ?1 as before and consider the following experiment: p0=0.6 ; e0=0.05; e1=0.03
• You create and transmit a one-bit message S as before. In order to improve reliability, the same bit “S” is transmitted three times (S S S) as shown in Figure 2.
• The received bits “R” are not necessarily the same as the transmitted bits “S” due to transmission errors. The three received bits, shown as (R1 R2 R3) in Figure 2 will be equal to one of the following eight triplets: (R1 R2 R3) ={ (000), (001), (010), (100), (011), (101), (110), (111) } When you look at the received triplet (R1 R2 R3) you must decide what was the bit “S” originally transmitted by using voting and the majority rule. Here are some examples of the majority rule.
• For example, if the three received bits are (R1 R2 R3)=(001), then the majority rule will decide that the bit must be a “0”. We denote this as the decoded bit D=0.
• As another example if the three received bits are (R1 R2 R3)=(101), then the majority rule will decode the bit as D=1.
• Another example: If you send S=0 three times, i.e. (S S S) = ( 0 0 0 ) and the received string is (R1 R2 R3) = (000), (001), (010), or (100) then the symbol will be decoded as D=0 and the experiment is a success, otherwise it is a failure.
• Another example: If you transmit S=1 three times, i.e. (S S S) = ( 1 1 1 ) and the received string is (011), (101), (110), or (111) the symbol will be decoded as D=1 and the experiment is a success, otherwise it is a failure.
• This procedure as described above is considered one experiment.
• Repeat the experiment N=100,000 times and count the number of successes.
• Find the probability that the transmitted bit "S" will be received and decoded incorrectly.
• Comment on whether the voting method used in this problem provides any improvement as compared to the method of Problem 1.
• SUBMIT your report in a Word or PDF file. Use the table below for your answer. Note: You will need to replicate the table in your Word file, in order to provide the answer in your report. Points will be taken off if you do not use the table. Probability of error with enhanced transmission Ans. p = ?
Solution ::
We assume independence of bit errors.If I have swapped sucess rate and failure rate just swap return in find_received function.
import random as rd def find_received(prob, sent): random_val = rd.uniform(0, 1) if sent == 0: return random_val > prob else: return random_val < prob probability_0 = 0.4 probability_1 = 0.02 probability_2 = 0.03 probabilities = [probability_0, probability_1, probability_2] count = [] for prob in probabilities: counter = 0 for x in range(100000): sent = rd.randint(0, 1) #Get a value 0 and 1 received = find_received(prob, sent) #Get received if sent == received: counter = counter + 1 count.append(counter) for i in range(len(probabilities)): print("For probability %f number of failed transmission are : %d" %(probabilities[i], count[i])) print("Estimated probability of failure for %d'th value is: " %i, (count[i] / 100000)) print("\n")
Thank you:::