import math
#Given that
m_i = 15 # initial magnitude of supernova
m_f = 2 # final magnitude of supernova
print "Standard formula used \t M = m - 2.5log(L/L_0) "
del_m = m_i - m_f # calculation of change in magnitude
brightness_ratio = 100**(del_m/5) # calculation of increment in brightness ratio.
print " In two days novas brightness is increased by ",math.ceil(brightness_ratio / 10000)*10000," times nearly"
import math
#Given that
b_ratio = 2 # ratio of light output in a period
print "Standard formula used \t M = m - 2.5log(L/L_0) "
del_m = 2.5 * math.log10(b_ratio) # calulation of change in magnitude
print " Change in magnitude is ",round(del_m,4) ," times"
import math
# given that
m_capella = 0.05 # magnitude of brightness of capella at 14 parsecs
m_sun = 4.8 # absolute magnitude of brightness of sun
d = 14 # distance of capella in parsecs
D = 10 # distance of capella considerd for observation
print "Standard formula used \t M = m - 2.5log(L/L_0) "
M_capella = m_capella - 5*math.log10(d/D) # calculation of absolute magnitude of brightness at distance of 10 parsecs
del_m = m_sun - M_capella # difference between absolute magnitude of sun and capella
ratio = 10**(del_m/2.5)
print " Capella is ",round(ratio,4)," times brighter than sun."