Kenji L Logie

Modeling Simulation Final Project

Simulating a Worst Case Social Security Model
System of Interest
For the purpose of this simulation a simplified worst case social security model was
created for a developing country’s social security program. The program simulates
how long it would take this new social security program to go bankrupt, if it earns
no interest on its capital, and its only source of paying out benefits is members’
monthly contributions and its initial capital of $750,000.
This model only deals with paying into the social security for the purpose of
retirement benefits. Persons pay into the social security program at one of three
possible earning levels monthly. This would lead to one of three possible payouts of
benefits monthly for persons 60 years or older. Simulating the point of bankruptcy
begins at the third part of the program when the organization has built up capital
over a period of time, which is defined within the simulation as the contribution
only period without paying out any benefits. At the end of the contribution only
period it begins to pay out benefits to anyone in the simulation eligible to receive
benefits which by definition is a members who is 60 years or older.
Events and System Variables
Events: a new person joins the work force, payment of benefits, and receiving
contributions

Page 1 of 20

Kenji L Logie

Modeling Simulation Final Project

System State variables:
c- Social Security capital,
n- Maximum number of persons in the system at that point in time
t- Time
Discrete Event Simulation
The simulation represents a discrete event simulation. The events all take place
chronologically, and represent state changes at a particular point in the simulation.
The simulation begins with the creation of a fixed number of persons, and the time
at which a new person joining the workforce is generated from an exponential
distribution to move time forward. This step is followed by generating more times
persons joining the workforce, payment of benefits or receiving contribution; an
increment of one since time in the simulation is measured in months. Each event
moves time forward until the capital of the social security becomes negative; the
point of termination in the simulation.
Worst Case Social Security Model
The simulation represents a Poisson Process. Each inter arrival time of a person to
the workforce is independent of the person before them and it occurs at a rate
specified within the simulation.

Page 2 of 20

Kenji L Logie

Modeling Simulation Final Project

The simulation is a terminating simulation. The simulation ends when the social
security office becomes bankrupt. This event occurs when the amount of cash paid
out exceeds the amount currently held by the social security office.

The following simplification assumptions were made for the purpose of the model
or imposed by restrictions of the program used to simulate the model:
 The maximum number of persons the system can accommodate is 90000
persons.
 There are only three levels of contributions and benefit payments.
 The simulation time variables are all measured in months.
 The simulations values of capital, benefits and payments all in $100,000.
 Persons join the workforce at a random age between 18 and 60 and only
leave the workforce at retirement.
 Persons live to a life expectancy based on their gender; 70 years for males
and 76 years for females.
 The population ratio for males to females is approximately 1:1.
The input distribution was exponential and was chosen based on data provided by
the Social Security the simulation was modeled on.
Purpose of performing simulation

Page 3 of 20

Kenji L Logie

Modeling Simulation Final Project

The purpose of the simulation is to calculate how long it takes for a simulation to go
bankrupt. From this initial question the rate of joining the workforce, return on
capital and the contribution period were all varied individually while holding
everything else constant to determine which variable extended the length of time it
takes to go bankrupt. An average of the time taken to go bankrupt was calculated for
all these variations to the base case.
The model in its current inception models an existing system, in a simplified version
of its worst case scenario. The variation to individual variables in the simulation
(rate of joining the workforce, contribution only periods and return on capital) also
allow recommendations to be made in extended the life of the social security even
under simplified worst case conditions.

Programing the Worst Case Scenario Simulation
The simulation used was written by the user using the programming language C++.
The program can be divided into three parts. The first part involves generating the
initial population the social security would start with. The second part of the
program involved simulating the contribution only period in which persons
between the age of 18 and 60 paid contributions based on their income level. During
this period persons between the age of 18 and 60 at a specified exponential monthly
Page 4 of 20

Kenji L Logie

Modeling Simulation Final Project

rate joined the social security and begin to pay contribution. Persons over the age of
60 do not receive benefits during the period of contribution only. The third part of
the program involves persons joining the workforce, paying contributing, and
paying benefits to persons age 60 or older based on their income level, until they
reach their life expectancy based on their gender. Each part was validated by using
cout statements and the data generated was observed for irregularities. Based upon
these observations all dollar amounts in the simulation are in $100,000 and the
Mersenne Twister was used instead of C++ standard rand generator.

Running Simulation
Base case conditions
Starting capital = $750,000
Persons join the social security at a rate of a 150 new persons a month
No return on capital

Page 5 of 20

Kenji L Logie

Modeling Simulation Final Project

Simulation

Runtime (seconds)

No return on capital (Base Case)

5.47

1 percent return on capital monthly

8.79

$5 million return on capital monthly

26.2

Rate of joining 50 persons a month

1.26

Rate of joining 100 persons a month

3.03

Rate of joining 150 persons a month

5.47

Rate of joining 200 persons a month

9.03

Rate of joining 250 persons a month

13.64

60 contribution only periods

5.47

120 contribution only periods

9.10

150 contribution only periods

11.10

180 contribution only periods

13.63

210 contribution only periods

15.65

Termination of Simulation
All simulations performed terminate at the point which the capital held by the social
security plus the contribution is less than the benefits paid out for a particular
month.
Page 6 of 20

Kenji L Logie

Modeling Simulation Final Project

Capital + Contributions<Benefits Paid Out
Simulation Runs
The simulations were all run a 100 times. The only exception was the base case
which ran 10000 times. Only the base case ran 10,000 times due to the amount of
time of taken for an individual run.

Results from Simulation
 all measurements of time are given in months in the tables except execution
time
Return on capital lower
upper
standard
monthly limit
limit
variance error
xbar
execution time per run
5million
402.344
404.436
28.76
0.536335
402.6
26.20
1 percent return
204.161
206.369 40.3636
0.635324
205.4
8.79
no capital
153.752
155.208 13.9491
0.373485
154.48
5.47

Page 7 of 20

Kenji L Logie

Modeling Simulation Final Project

Table showing results of variation of the return on capital for the social security
monthly only.
450
400
350
300
250

Month(no additional capital)
(5 million)Month

200

(1percent reurn) Month

150
100
50

1
6
11
16
21
26
31
36
41
46
51
56
61
66
71
76
81
86
91
96

0

Graph shows the difference in the length of time the social security goes bankrupt
with a variation in the return on capital
Rate at which
persons join the lower
upper
standard
workforce limit
limit
variance error
xbar
execution time per run
50 139.988 141.452 14.0824
0.375266
140.72
1.26
100 148.114 149.606 14.6267
0.382448
148.86
3.03
150 153.752 155.208 13.9491
0.373485
154.48
5.47
200 159.505 160.795 10.9369
0.330709
160.15
9.03
250
164.16
165.36 9.47717
0.30785
164.76
13.64

Page 8 of 20

Kenji L Logie

Modeling Simulation Final Project

Table showing results of variation in rate at which persons join the social security
monthly only.
200
180
160
140
120

rate 50 Month
rate 100 Month

100

rate 150 Month
rate 200 Month

80

rate 250 Month

60
40
20

1
5
9
13
17
21
25
29
33
37
41
45
49
53
57
61
65
69
73
77
81
85
89
93
97

0

Graph shows the difference in the length of time the social security goes bankrupt
with a variation in the rate at which persons join the social security monthly
Variation in lower
upper
standard
contribution limit
limit
variance error
60
153.752
155.208 13.9491
0.373485
120
213.556
214.564 6.68623
0.258519
150
244.58
245.342 4.04798
0.201196
180
277.196
277.944 3.68192
0.191883

xbar
execution time per run
154.48
5.47
214.06
9.10
244.95
11.10
277.57
13.63
Page 9 of 20

Kenji L Logie

Modeling Simulation Final Project
210

309.716

310.384

2.93687

0.171373 310.15

15.65

Table showing results of variation in contribution only period.

350

300

250
contributon period
120(Months)
contribution period 60
(months)

200

contribution period 150
(months)
150

contribution period 180
(months)
contribution period 210
(months)

100

50

1
6
11
16
21
26
31
36
41
46
51
56
61
66
71
76
81
86
91
96

0

Graph shows the difference in the length of time the social security goes bankrupt
with a variation in the contribution only period

Results for Original Question

Page 10 of 20

Kenji L Logie

Modeling Simulation Final Project

The original question asked when creating this model was; how long would a worst
case simplified social security model take to go bankrupt. After repeating the
original simulation 10,000 times under the base case conditions the following table
contains the results of the experiment.
lower
upper
standard
limit
limit
variance error
xbar
execution time per run
154.947
155.085 12.4408
0.3502715 155.016
5.63

All data generated for results except the base 10,000 case can be found in the
appendix.
Suggestions for Improving the Simulation
 An exponential death rate for persons between the age of 18 and 60 should be
developed. A death rate for persons over the age of 60 should only be
developed if a normal case was to be developed. Since a worst case model
means the social security runs out of money; it is normally due to persons
maximize their benefits by living to their life expectancy or greater.
 Contributions and benefits should be determined as a percentage of a
person’s income.
 Persons should be allowed to leave the work force temporary or permanently
for reasons other than death.
 The simplification assumptions should be removed one by one for improved
results.
Page 11 of 20

Kenji L Logie

Modeling Simulation Final Project

Reference page

Arbez, Birta. Modeling and Simulation Exploring Dynamic System Behaviour . Ottawa: Springer, 2007.
Law, Averill M. and W.David Kelton. Simulation Modeling & Analysis. McGraw-Hill, 1991.
Ross, Sheldon M. Simulation. San Diego: Academic Press, 2006.
Severance, Frank L. System Modeling and Simulation An Intoduction. New York: Wiley, 2001.

Appendix
Data generated by simulation and used to create the graphs
Page 12 of 20

Kenji L Logie

Observation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

Modeling Simulation Final Project
contribution contribution
contribution
contribution
contribution
period 120
period 60
period 150
period 180
period 210
213
156
243
275
308
218
156
244
277
309
213
153
242
279
312
216
167
243
278
310
211
165
244
276
309
215
155
247
278
310
211
158
247
277
312
216
153
245
279
310
213
152
244
278
310
213
159
243
280
313
212
153
246
277
311
213
154
246
281
310
215
149
242
280
312
215
162
247
277
312
211
156
246
279
310
217
154
250
281
309
214
149
244
277
313
210
150
245
278
313
208
157
249
279
313
215
161
243
279
311
213
153
248
278
311
220
157
246
280
307
214
151
243
276
312
212
157
246
275
308
213
146
245
277
311
217
152
243
276
307
217
153
245
274
312
214
151
246
275
308
219
154
244
274
307
216
148
243
277
310
215
151
247
277
309
213
160
245
276
311
213
155
245
279
304
216
156
248
276
310
218
153
245
278
309
214
149
244
280
309
211
155
248
278
309
214
149
244
275
310
213
156
243
282
310
214
157
245
280
311
Page 13 of 20

Kenji L Logie
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

Modeling Simulation Final Project
212
214
216
214
214
215
213
214
212
217
218
210
213
213
210
214
218
214
217
216
210
212
215
214
215
218
209
216
211
208
217
213
215
218
213
216
215
214
217
213
218

155
156
156
159
155
160
154
156
156
153
158
149
154
154
152
155
158
151
158
156
153
151
157
149
156
157
153
152
153
150
151
151
154
155
151
155
159
154
152
155
151

247
243
246
245
242
243
245
245
247
242
244
245
243
245
244
241
246
244
245
248
244
243
247
247
244
244
246
245
245
248
246
244
245
243
247
244
249
246
242
245
245

280
276
281
278
276
277
280
277
277
282
277
278
275
277
276
279
280
273
280
277
276
277
276
277
278
280
276
276
280
277
280
276
278
275
274
275
279
282
277
279
279

307
311
311
307
310
308
310
309
311
310
311
312
312
308
311
311
309
311
310
312
311
312
310
311
310
309
313
310
310
307
310
312
308
310
311
309
307
308
311
309
313
Page 14 of 20

Kenji L Logie
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

Modeling Simulation Final Project
221
213
214
213
208
210
213
210
216
214
214
212
212
216
214
216
215
215
214

rate 50
rate 100
Observation Month
Month
1
142
2
142
3
142
4
138
5
143
6
139
7
144
8
141
9
146
10
133
11
142
12
140
13
143
14
143
15
138
16
142
17
139
18
140

157
152
149
151
158
151
153
152
156
152
156
161
151
158
162
155
151
156
161

243
244
243
244
240
250
244
243
244
244
246
244
248
242
249
249
245
244
247

rate 150
Month
151
147
145
152
153
153
144
151
154
155
149
149
155
151
147
142
145
149

278
276
276
278
276
276
277
276
278
277
277
279
277
280
278
275
277
279
276

rate 200
Month
156
156
153
167
165
155
158
153
152
159
153
154
149
162
156
154
149
150

309
310
311
310
310
307
313
309
309
311
308
310
312
310
311
310
309
310
312

rate 250
Month
160
167
162
164
162
159
162
163
162
162
167
159
164
162
155
160
162
158

164
168
161
167
161
164
162
164
161
160
163
166
167
165
170
165
167
166
Page 15 of 20

Kenji L Logie
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

Modeling Simulation Final Project
146
139
140
140
141
143
138
143
137
141
146
139
131
141
137
133
149
139
141
139
137
133
140
142
144
136
141
142
145
143
146
144
140
142
140
143
148
142
136
143
133

154
144
141
151
152
152
152
148
147
155
152
142
143
150
147
146
146
150
153
150
148
148
152
147
144
145
150
148
149
151
146
145
148
150
152
141
152
145
149
145
151

157
161
153
157
151
157
146
152
153
151
154
148
151
160
155
156
153
149
155
149
156
157
155
156
156
159
155
160
154
156
156
153
158
149
154
154
152
155
158
151
158

159
156
154
161
156
161
157
155
158
156
160
162
160
161
162
159
165
172
160
156
159
155
157
163
161
158
158
161
163
166
162
157
158
162
162
160
164
159
155
165
157

164
167
168
171
162
173
165
171
164
166
163
164
165
169
166
159
166
163
166
162
164
164
162
172
164
167
161
163
162
162
166
161
169
163
157
162
160
165
168
166
167
Page 16 of 20

Kenji L Logie
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

Modeling Simulation Final Project
152
145
142
144
144
142
135
142
136
143
141
145
144
141
140
141
140
141
146
141
139
140
146
141
133
137
143
145
137
137
135
140
133
145
141
138
139
141
140
141
136

147
145
146
149
141
152
154
147
143
144
154
144
148
148
146
150
144
150
152
157
147
149
146
156
154
151
148
151
153
148
152
148
144
142
151
151
148
154
154
149
156

156
153
151
157
149
156
157
153
152
153
150
151
151
154
155
151
155
159
154
152
155
151
157
152
149
151
158
151
153
152
156
152
156
161
151
158
162
155
151
156
161

159
160
158
158
160
160
162
167
164
159
152
157
162
161
162
160
157
157
159
161
164
152
161
159
155
161
160
161
165
158
161
162
164
159
156
158
160
159
162
160
161

164
162
163
166
162
166
162
169
161
161
171
165
166
168
163
164
163
169
158
166
163
161
165
165
162
166
169
170
163
169
168
162
167
166
164
164
165
164
165
164
165
Page 17 of 20

Kenji L Logie

Modeling Simulation Final Project

Observation no return on capital
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

5 million
156
156
153
167
165
155
158
153
152
159
153
154
149
162
156
154
149
150
157
161
153
157
151
157
146
152
153
151
154
148
151
160
155
156
153
149
155
149

1percent return
398
410
400
399
402
399
406
402
404
406
396
408
399
410
414
411
399
404
403
403
410
401
410
412
403
399
399
407
403
407
399
411
402
407
402
399
403
401

205
198
196
207
213
211
217
206
210
211
201
201
205
202
199
200
210
219
205
225
199
192
209
217
208
213
200
211
213
211
204
203
204
198
204
198
202
200
Page 18 of 20

Kenji L Logie
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

Modeling Simulation Final Project
156
157
155
156
156
159
155
160
154
156
156
153
158
149
154
154
152
155
158
151
158
156
153
151
157
149
156
157
153
152
153
150
151
151
154
155
151
155
159
154
152

408
410
404
410
409
398
405
398
404
410
400
404
409
404
393
410
411
407
414
399
402
404
400
403
403
398
394
385
404
398
397
410
403
404
400
412
404
407
409
402
394

206
207
200
210
203
205
211
210
199
206
211
198
199
203
198
202
202
194
198
203
209
205
201
204
210
202
212
195
204
208
197
207
201
211
204
198
200
212
208
204
211
Page 19 of 20

Kenji L Logie
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

Modeling Simulation Final Project
155
151
157
152
149
151
158
151
153
152
156
152
156
161
151
158
162
155
151
156
161

408
403
408
394
398
408
401
412
397
403
399
405
407
398
408
408
405
399
399
397
394

206
217
203
200
220
208
206
206
216
205
210
197
203
208
190
215
210
211
209
199
206

Page 20 of 20

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.