Thursday, September 16, 2010

Enron Severance Package MATLAB Script

I got a little bored and decided to write a little MATLAB script that would calculate your severance package if you were an Enron employee (before they went bankrupt). Formula is courtesy of The Smartest Guys in the Room by McLean and Elkind.


% Given current salary and number of years served, calculates the severance
% package according to Enron's formula
disp('What would your severance package be as an Enron employee?')
years_served = input('Enter number of years served: ');
end_salary = input('Enter salary at end of service: ');
% Enron's formula is as follows:
% Two weeks pay for every year served + two weeks pay for every $10,000
% of base salary
floor_years_served = floor(years_served);
base_salary_factor = floor(end_salary/10000);
% Assume 52 weeks in a year
two_weeks_pay = end_salary / 26;
sev_package = two_weeks_pay * (floor_years_served + base_salary_factor);
str = sprintf('Your severance package would be: $%0.2f',sev_package);

No comments: