5 ms·
> The alternative is to have your boss decide for you when he wants to fire you Just for fun, I thought I’d do the math on deflationary economics: #!/usr/
by atweiden 4y ago
> The alternative is to have your boss decide for you when he wants to fire you
Just for fun, I thought I’d do the math on deflationary economics:
#!/usr/bin/env raku
use v6;
multi sub deflate($n, $r, $y)
{
my $m = $n;
loop (my $i = 0; $i < $y; $i++)
{
$m = deflate($m, $r);
}
$m;
}
multi sub deflate($n, $r)
{
$n * (1 + $r);
}
sub MAIN(:$rate = 0.0225, :$years = 10)
{
my $purchasing-power = 1;
my $deflate = deflate($purchasing-power, $rate, $years);
my $output = qq:to/EOF/.trim;
After $years years of deflation at a rate of {$rate * 100}% per year,
purchasing power is {$deflate * 100}% of what it was initially.
EOF
$output.say;
}
Without inflation, your personal wealth would grow by the average inflation rate target plus GDP growth, compounding each year.
Assuming an average inflation rate target of 2% per year (per the Fed) and an average GDP growth rate of 0.25% per year, your real purchasing power would grow by about 25% per decade.
Under this scenario, you could mimic a universal basic income of $1000 per month upon saving a total of $480,307.
Bonus: your monthly “UBI” could never be shut off by your government.
- kamaal 4y agoWow! Nice to see Perl 6 in use these days!
- lizmat 4y agoCool, but I couldn't resist rakufying your "deflate" subroutine: sub deflate($power is copy, $rate, $years) { $power *= 1 + $rate for ^$years; $power * 100 } sub MAIN(:$rate = 0.0225, :$years = 10) { print qq:to/EOF/; After $years years of deflation at a rate of {$rate * 100}% per year, purchasing power is &deflate(1,$rate,$years)% of what it was initially. EOF } Which I think reads quite a bit better :-)
- atweiden 4y agolizmat++ The innumerable dark-seeming corners of the language is part of what makes Raku so very, distinctly “Perl”. Little traits and single character sigils that change everything. I find the black magic of Perl моѕt all∪ring ∮.