mlsem/assigns.py

36 lines
605 B
Python
Raw Normal View History

2021-10-17 15:00:05 +02:00
from plt2 import *
import numpy as np
#probability that one thesis is not going to be picket
students=20
topics=20
def by_picks(picks=3):
return (1-(((topics-picks)/topics)**students))**topics
print(by_picks(1))
#print(by_picks(1))
#print(by_picks(2))
#print(by_picks(3))
picks=np.arange(1.0,5.0,0.1)
probs=[by_picks(pick) for pick in picks]
plt.plot(picks,probs)
plt.title("Probability of everybody being assigned a favorable topic")
plt.ylabel("Probability")
plt.xlabel("Average number of favored topics")
plt.savefig("assigns.png")
plt.savefig("assigns.pdf",format="pdf")
plt.show()