<jupyter_start><jupyter_text>Example of usage<jupyter_code>import numpy as np
import pyximport
_ = pyximport.install()
from math_func_cython import solveFBern<jupyter_output><empty_output><jupyter_text>Define the average reward for each arm<jupyter_code>mu = [0.6, 0.5]<jupyter_output><empty_output><jupyter_text>Solve the problem<jupyter_code>w, Tinv = solveFBern(np.ascontiguousarray(np.sort(mu)[::-1]))
print("T^(-1): {}".format(Tinv))
print("Sample complexity: {}".format(1/Tinv))
print("Optimal weights: {}".format(w))<jupyter_output>T^(-1): 0.005059447899363592
Sample complexity: 197.65002424983683
Optimal weights: [0.50169393 0.49830607]
{'fraction_non_alphanumeric': 0.15015479876160992, 'fraction_numerical': 0.09597523219814241, 'mean_word_length': 9.60655737704918, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '314402', 'license': 'MIT', 'n_tokens_mistral': 289, 'n_tokens_neox': 252, 'n_words': 41, 'path': 'example1.ipynb', 'repo_name': 'rssalessio/py-lower-bound-bai', 'size': '646'}