Skip to content

Instantly share code, notes, and snippets.

@arpruss
Created February 3, 2020 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arpruss/caef5e62b5caad8ffa7f8036b3a1a41e to your computer and use it in GitHub Desktop.
Save arpruss/caef5e62b5caad8ffa7f8036b3a1a41e to your computer and use it in GitHub Desktop.
Look for a counterexample for a conjecture regarding Level Set Integrals
from random import *
pa = 0.25
pb = 0.25
def E(f):
fa,fb = f
return fa + (fb-fa) * pb if fa < fb else fb + (fa-fb) * pa
def r():
return (randint(0,3),randint(0,3))
def test():
while True:
A = r()
A_ = r()
if E(A)<E(A_):
A,A_ = A_,A
if E(A)>E(A_):
break
while True:
B = r()
B_ = r()
AB = (A[0]+B[0],A[1]+B[1])
A_B_ = (A_[0]+B_[0],A_[1]+B_[1])
AB_ = (A[0]+B_[0],A[1]+B_[1])
if E(AB) > E(AB_):
break
if A_B_[0] > AB[0] and A_B_[1] > AB[1]:
print(A,A_,B,B_)
for i in range(1000000):
test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment