Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #
- # Script for number for modelling twitter follower increase using a Poisson distribution
- # http://zaynertech.blogspot.com
- #
- my %val = ();
- #hard coded values for Poisson distribution
- @counts = qw(0 1 2 3 4 5 6 7 8 9 10 11 12);
- @countsprob = qw(0.67 3.37 8.42 14.04 17.55 17.55 14.62 10.44 6.53 3.63 1.81 0.82 0.34);
- # starting number of followers
- $total = 6622356;
- open(FILER, ">", "calc.dist");
- #7344 is total time divided by 64 seconds per 5 counts
- for($x = 0; $x <7344; $x++)
- {
- $rnum = rand(10000);
- $tots = 0;
- for($y = 0; $y < 12; $y++)
- {
- $tots = $tots + (100 *$countsprob[$y]);
- if($rnum <= $tots){ $val{$x} = $counts[$y]; last;}
- }
- $total = $total + $val{$x};
- $realx = $x *64;
- print FILER "$realx $total\n";
- }
- close(FILER);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement