<jupyter_start><jupyter_text>IntroductionIn this notebook we look at the behaviour of the funtion:$$F(x) = \frac12f(x) + \frac12\,,$$with:$$f(x) = Ax^\alpha(1-x)^\beta$$where the parameters $\alpha$ and $\beta$ are randomly extracted in the ranges:$$\alpha\in [0, 10)\quad\mbox{and}\quad\beta \in(0, 10)\,,$$and:$$-\frac{(\alpha+\beta)^{\alpha+\beta}}{\alpha^\alpha\beta^\beta}\leqA\leq \frac{(\alpha+\beta)^{\alpha+\beta}}{\alpha^\alpha\beta^\beta}\,.$$<jupyter_code>import numpy as np
import matplotlib.pyplot as pl

expmax = 2
nrand = 100

np.random.seed(1234)
alpha = expmax * np.random.rand(nrand)
beta  = expmax * np.random.rand(nrand)

A = [ 2 * a * np.random.rand(1)[0] - a  for a in (alpha + beta)**(alpha+beta) / alpha**alpha / beta**beta ]

def F(x, n):
    return A[n] * x**alpha[n] * ( 1 - x )**beta[n] / 2 + 0.5
# Compute random function
n = 1000
xmin = 0.01

# Define plot parameters
pl.style.use('seaborn-talk')
pl.rc('axes', linewidth=2)
ax = pl.gca()

# Adjust canvas
pl.xlim(xmin, 1)
pl.ylim(-0.1, 1.1)
pl.xticks(size=20)
pl.yticks(size=20)

# Axis labels
pl.xlabel(r'$x$', fontsize=22)
pl.ylabel(r'$F(x)$', fontsize=22)

# Title
pl.title("Random flavour-separation functions", fontsize=22)

# Compute functions
sx = np.linspace(xmin, 1, num = n)
for n in range(nrand):
    pl.plot(sx, F(sx, n), 'r', linewidth=1)

# Boundaries
pl.axhline(y=0, xmin=0, xmax=1, linewidth=2, color = 'k', linestyle='--')
pl.axhline(y=1, xmin=0, xmax=1, linewidth=2, color = 'k', linestyle='--')
pl.axhline(y=0.5, xmin=0, xmax=1, linewidth=2, color = 'k', linestyle='-')

# Save figure on file
pl.savefig("RandomFunctions.pdf")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.21497584541062803, 'fraction_numerical': 0.03864734299516908, 'mean_word_length': 4.6552901023890785, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '201514', 'license': 'MIT', 'n_tokens_mistral': 723, 'n_tokens_neox': 673, 'n_words': 148, 'path': 'docs/latex/src/plots/RandomFunctions.ipynb', 'repo_name': 'vbertone/apfelxx', 'size': '1656'}