develooper Front page | perl.beginners | Postings from October 2009

question

Thread Next
From:
Jesus Fernandez
Date:
October 12, 2009 14:40
Subject:
question
Message ID:
952a527f0910121440m4855680h9ee51cc36f011e75@mail.gmail.com
Hello friends,

I wrote a program that can simulate coalescent times of gene copies in a
single population of constant size with a N=10 000 and a k=25, now i want to
make 5000 simulations, any help?

#!jesusafernandez/bin/perl
use warnings;

$n = 10000;
$k = 25;
while ($k>=2){
    if ($k==1) {last;}
    $mean=(4*$n)/$k*($k-1);
    $time=(-log(rand)*$mean);
    push(@coalt, $time);
    $k=$k-1;
    }
    for ($time=0; $time<24; $time++){
    print "$coalt[$time]\n";
    }

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About