<commit_before><commit_msg>new file<commit_after>#!/usr/bin/env python3

import random

def newTry():
    # how many trials are necessary for a 6 to appear?
    i=1
    while random.randint(1, 6) != 6:
        i+=1
    return i

def newList(n):
    a=[]
    i=0
    while i < n:
        a.append(newTry())
        i=i+1
    return a

def main1(n=1000):
    # show the distribution of the number of trials necessary for a 6 to appear
    l=newList(n)
    u=list(set(l))
    for x in sorted(u, key=l.count, reverse=True):
        print(x,"\t",l.count(x))
    print(len(u),"items")

def p(n):
    return (1/6) * (5/6)**(n-1)

def main2():
    # show that it is more likely that the first 6 appears in one the first four trials than later
    s=0
    i=0
    while s < 1/2:
        i=i+1
        a=p(i)
        s+=a
        print(i,s,"\t",a)
{'fraction_non_alphanumeric': 0.14217443249701314, 'fraction_numerical': 0.03225806451612903, 'mean_word_length': 2.2355212355212357, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '903257', 'n_tokens_mistral': 331, 'n_tokens_neox': 319, 'n_words': 97}