<jupyter_start><jupyter_text>**Level 3**<jupyter_code>import matplotlib.pyplot as plt
from pylab import rand, ylim, xlim
from random import randint
import numpy as np

# random.randint(a, b) # Return a random integer N such that a <= N <= b.

kBase = 1.8

def randomMinMaxPref(min, max):
    aa = randint(int(kBase**min), int(kBase**(max+1)-1))
    bb = int(log(aa, kBase))
    return bb

def randomMinMax(min, max):
    if min >= max : return min
    return randint(min, max)

def onGenerate():
  #   z = randint(3,6)
  z = randomMinMaxPref(1,6)
  x = randomMinMax(0, z-1)
#   return [x, z-x, z]
  return  [[x, z-x, z], [z-x, x, z]][randint(0, 1)]

X = []
Y = []
Z = []
for i in range(100):
  c = 0
  while (c==0): a, b, c = onGenerate()
  
  X.append(a)
  Y.append(b)
  Z.append(c)

plt.scatter(X,Y, color='r', alpha=0.1)
plt.xlabel("X")
plt.ylabel("Y")
# ylim([-1,10])
# xlim([-1,10])
plt.show()
plt.hist(Z, bins=24)
plt.xlabel("Z")
plt.show()
from math import log
import matplotlib.pyplot as plt

x = []
xx = []
for i in range(100):
    xxi = randint(1, 2**10-1)
    xx.append(xxi)
    x.append(int(log(xxi, 2)))
             
plt.scatter(xx,x, color="b", alpha=0.2)
plt.xlabel("xx")
plt.ylabel("x")
plt.show()
import matplotlib.pyplot as plt

x = []
xx = []

for i in range(-10, 10):
    xx.append(i)
    x.append(-(100*i**2 + -5*i + 5000) )


plt.scatter(xx,x, color="g", alpha=0.2)
plt.xlabel("xx")
plt.ylabel("x")
plt.show()
import matplotlib.pyplot as plt
from pylab import rand, ylim, xlim
from random import randint
import numpy as np

# random.randint(a, b) # Return a random integer N such that a <= N <= b.

def randomMinMax(min, max):
    if min >= max : return min
    return randint(min, max)

def onGenerate():
  z = randomMinMax(3,6)
  x = randomMinMax(0, z-1)
#   return [x, z-x, z]
  return  [[x, z-x, z], [z-x, x, z]][randint(0, 1)]

X = []
Y = []
Z = []
for i in range(100):
  a, b, c = onGenerate()
  X.append(a)
  Y.append(b)
  Z.append(c)


plt.scatter(X,Y, color='r', alpha=0.1)
plt.xlabel("X")
plt.ylabel("Y")
# ylim([-1,10])
# xlim([-1,10])
plt.show()

# plt.scatter(Z, np.zeros_like(Z), color="b", alpha=0.01)
plt.hist(Z, )
plt.xlabel("Z")
plt.show()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup