<commit_before>use v6;

=begin pod

=TITLE Independent Segregation of Chromosomes

L<http://rosalind.info/problems/indc/>

Sample input

    5

Sample output

    0.000 -0.004 -0.024 -0.082 -0.206 -0.424 -0.765 -1.262 -1.969 -3.010

=end pod

my $n = 5;  # $*IN.get.Int;

sub C($n, $k) {
    state %cache;
    %cache{$n}{$k} //=
    $k == 1 ?? $n !! C($n, $k-1)*($n-$k+1) div $k 
}

say gather for 1 .. 2*$n -> $k {
    take .log / log 10 given 1/2**(2*$n) * [+] map { C 2*$n, $_ }, $k .. 2*$n;
}

# vim: expandtab shiftwidth=4 ft=perl6<commit_msg>[rosalind] remove commented out code<commit_after>use v6;

=begin pod

=TITLE Independent Segregation of Chromosomes

L<http://rosalind.info/problems/indc/>

Sample input

    5

Sample output

    0.000 -0.004 -0.024 -0.082 -0.206 -0.424 -0.765 -1.262 -1.969 -3.010

=end pod

my $n = 5;

sub C($n, $k) {
    state %cache;
    %cache{$n}{$k} //=
    $k == 1 ?? $n !! C($n, $k-1)*($n-$k+1) div $k 
}

say gather for 1 .. 2*$n -> $k {
    take .log / log 10 given 1/2**(2*$n) * [+] map { C 2*$n, $_ }, $k .. 2*$n;
}

# vim: expandtab shiftwidth=4 ft=perl6
{'fraction_non_alphanumeric': 0.22141560798548093, 'fraction_numerical': 0.10344827586206896, 'mean_word_length': 2.4254658385093166, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5307552', 'n_tokens_mistral': 583, 'n_tokens_neox': 507, 'n_words': 132}