import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
plt.style.use("seaborn")

#fig = plt.figure()#figsize=(300,2))


#sequence = np.linspace(0,299,300)
#image = np.vstack((sequence, sequence))
#r = sns.heatmap(image,  annot = True)
#plt.show()


failure = [0.0004, 0.0003, 0.0002, 0.0001]
failure = np.tile(failure, (300, 1))
experimentNumber = np.linspace(1,300,300)
bernouliSuccess = np.ones((300, 4), dtype = np.float64) - failure
bernouli = np.zeros((300,4), dtype = np.float64)
[m,n] = np.shape(failure)
for j in range(n):
    bernouli[:,j] = bernouliSuccess[:,j] ** experimentNumber
r1 = sns.heatmap(bernouli.T)#,  annot = True)
plt.show()

#####
fig, ax = plt.subplots()
alphabetSize = np.array([4,6,8,10,12,14,16])
merLength = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])#np.linspace(5,30,26)
probabilityOfNotSeeingASequence = np.zeros((len(alphabetSize), len(merLength)))
for i in range(len(alphabetSize)):    
    probabilityOfNotSeeingASequence[i, :] = (1 - 1 / ((alphabetSize[i]) ** merLength)) ** 300

ax.plot(merLength, probabilityOfNotSeeingASequence[0,:], label = "DNA 4 bases")
ax.plot(merLength, probabilityOfNotSeeingASequence[1,:], label = "XNA 6 bases")
ax.plot(merLength, probabilityOfNotSeeingASequence[2,:], label = "XNA 8 bases")
ax.plot(merLength, probabilityOfNotSeeingASequence[3,:], label = "XNA 10 bases")
#ax.plot(merLength, probabilityOfNotSeeingASequence[4,:])
#ax.plot(merLength, probabilityOfNotSeeingASequence[5,:])
#ax.plot(merLength, probabilityOfNotSeeingASequence[6,:])
legend = ax.legend(loc='upper center', shadow=True, fontsize='x-large')
plt.show()