Skip to content

Instantly share code, notes, and snippets.

@acdimalev
Last active March 2, 2022 03:27
Show Gist options
  • Save acdimalev/aed766b654a198a53785d1080c132b0d to your computer and use it in GitHub Desktop.
Save acdimalev/aed766b654a198a53785d1080c132b0d to your computer and use it in GitHub Desktop.
from math import log
from random import random, randrange
sample = lambda: (randrange(1, 101), random())
q = [
(1 - y) * log(x) + y * x
for (x, y)
in (sample() for _ in range(1000))
]
import matplotlib.pyplot as pyplot
pyplot.xscale('log')
pyplot.plot(sorted(q), range(len(q)))
pyplot.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment