Last active
July 28, 2019 17:14
-
-
Save azarnyx/a2b44f74ecb537d62152ccff17f3e038 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.optimize import minimize | |
import pylab as plt | |
import itertools | |
num_sides1 = 6 | |
num_sides2 = 10 | |
mean1 = 4.5 | |
mean2 = mean1 | |
def f(x): | |
return - x*np.log(x) | |
def sum_form(p): | |
s = 0 | |
for pi in p: | |
# as we will to minimize, add minus | |
s += - f(pi) | |
return s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment