#Given
t=0.0016
No_words=256.0
bits_word = 12.0
#Calculation
tword= t/No_words
tbit = tword/bits_word
bps =1/tbit
#Result
print"(a) The time duration of the word ",tword*10**8,"microsecond"
print"(b) The time duration of the one bit is ",round(tbit*10**8,4),"microseconds"
print"(c) The speed of transmission is ",bps/10**5,"kbps"
#Given
B=12.5*10**3
SN_dB= 25
#Calculation
import math
C_th = 2*B
SN=316.2
C =B*3.32*log10(SN+1)
N= 2**(C/(2.0*B))
#Result
print"(a) The maximum theorotical data rate is ",C_th/10**3,"kbps"
print"(b) The maximum theorotical capacity of channel is ",round(C/10**3,1),"Kbps"
print"(c) The number of levels needed to acheive maximum speed are ",round(N,2)
#Given
block =512
packets =8
BER = 2*10**-4
#Calculation
avg_errors = block*packets*8*BER
print"Average number of errors are ",avg_errors