JavaScript bindings for OpenCV landed in 3.3.1
docs.opencv.org3 pointsby arnioxux1 comments
def neighbors4(point):
"The four neighboring squares."
x, y = point
return ( (x, y-1),
(x-1, y), (x+1, y),
(x, y+1))
def neighbors8(point):
"The eight neighboring squares."
x, y = point
return ((x-1, y-1), (x, y-1), (x+1, y-1),
(x-1, y), (x+1, y),
(x-1, y+1), (x, y+1), (x+1, y+1)) E[ln(X_1*...*X_N)] = sum E[ln(X)]
So kelly happens to maximize this expected utility by construction since it was derived by maximizing expected log of one round of betting (E[ln(X)]). E[sqrt(X_1*...*X_N)] = prod E[sqrt(X)]
We would maximize this expected utility by maximizing E[sqrt(X)]. Going through the same calculus we can see that we don't arrive at kelly.
OTOH as a programming problem you can just cheat and store state somewhere to count the row width. This satisfies your interface requirements (python):