#Initialisation
f=20*10**3 #bandwidth frequency in KHz
#Calculation
gain=(10**6)/(f) #gain
#Result
print'Gain = %d'%gain
#Initialisation
og=2*10**5 #Open Loop Gain
cg=20 #Closed Loop Gain
or1=75 #Output Resistance
ir1=2*10**6 #Input Resistance
#Calculation
ab=og*cg**-1 #factor (1+AB)
or2=or1/ab #Output Resistance
ir2=ir1*ab #Input Resistance
#Result
print'Output Resistance = %.1f mOhm\n'%(or2*1000)
print'Input Resistance = %d GOhm'%(ir2*10**-9)
#Initialisation
og=2*10**5 #Open Loop Gain
cg=20 #Closed Loop Gain
or1=75 #Output Resistance
ir1=2*10**6 #Input Resistance
r1=20*10**3 #Resistnce in Ohm
r2=10**3 #Resistnce in Ohm
#Calculation
ab=og*cg**-1 #factor (1+AB)
or2=or1*ab**-1 #Output Resistance
#the input is connected to a virtual earth point by the resistance R2,
#so the input resistance is equal to R 2 ,
ir2=r2 #Input Resistance
#Result
print'Output Resistance = %.1f mOhm\n'%(or2*1000)
print'Input Resistance = %d KOhm'%(ir2*10**-3)
#Initialisation
og=2*10**5 #Open Loop Gain
cg=1 #Closed Loop Gain
or1=75 #Output Resistance
ir1=2*10**6 #Input Resistance
#Calculation
ab=og*cg**-1 #factor (1+AB)
or2=or1*ab**-1 #Output Resistance
ir2=ir1*ab #Input Resistance
#Result
print'Output Resistance = %d uOhm\n'%(or2*10**6) #wrong answer in the textbook
print'Input Resistance = %d GOhm'%(ir2*10**-9)