When a baby is born in the UK, there is a book given to the parents, to record all the baby's details. In amongst the pages are various growth and weight charts. There is also a page that gives some formulaes, to help you guestimate the height of your child by the time they reach 20. It is by no means acurate, but it can help to identify any possible growth patterns that might be cause for concern.
Nicole asked me to calculate the expected height for Ethne, which was 161cm (5'4"). However, there are percentile readings that are a bit difficult to calculate, so I turned to Perl for the answer.
#!/usr/bin/perl -w use strict; use Getopt::Long; my ($opt_m,$opt_f,$opt_s); my %options = ( 'mother|m=f' => \$opt_m, 'father|f=f' => \$opt_f, 'sex|s=s' => \$opt_s, ); GetOptions(%options); usage() unless($opt_m && $opt_f && $opt_s); $opt_s = lc $opt_s; usage() unless($opt_s eq 'm' or $opt_s eq 'f'); my ($MPH,$cent,$offset) = (177,10.0,7); # male if($opt_s eq 'f') { ($MPH,$cent,$offset) = (164,8.5,-7) } my %centiles = ( 50 => $MPH ); my $centile = $cent / 41; for(1..49) { $centiles{$_} = $MPH - ((50 - $_) * $centile); } for(51..99) { $centiles{$_} = $MPH + (($_ - 50) * $centile); } my $mph = (($opt_m + $opt_f) / 2) + $offset; printf "(a) %3.2f cm\n", $opt_f; printf "(b) %3.2f cm\n", $opt_m; printf "(c) %3.2f cm\n", $opt_m + $opt_f; printf "(d) %3.2f cm\n", ($opt_m + $opt_f) / 2; printf "(e) %3.2f cm (MPH) (f) %s centile\n",$mph,centile($mph); printf "(g) %s centile - %s centile (TCR)\n", centile($mph+$cent),centile($mph-$cent); print <$centiles{$i}) { $i++ } return '100th' if($i >= 99); # backout now! my $r = ($c - $centiles{$i}) > ($centiles{$i+1} - $c) ? $i+1 : $i; my $m = $r % 10; sprintf "%d%s", int($r), ($m == 1 && $r != 11 ? 'st' : $m == 2 && $r != 12 ? 'nd' : $m == 3 && $r != 13 ? 'rd' : 'th'); } sub usage { print < The calculations are different for boys and girls, but thankfully we still have DanDan's to hand.
Seeing as both my brother and I are taller than our parents, I wonder if these figures change with any known regularity. Or is it a finger in the air job.