0% found this document useful (0 votes)
11 views9 pages

Monte Carlo Simulation for Blood Inventory Management

The summary of the document is as follows: 1) A Monte Carlo simulation problem is described to determine the surplus or shortage of half-liter units of type A blood at a rural clinic at the end of 6 weeks, considering random variables for weekly delivery, number of patients, and demand per patient. 2) Probability tables for each variable and the random numbers generated for the simulation are presented. 3) The simulation yields a final inventory of 23 surplus units.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views9 pages

Monte Carlo Simulation for Blood Inventory Management

The summary of the document is as follows: 1) A Monte Carlo simulation problem is described to determine the surplus or shortage of half-liter units of type A blood at a rural clinic at the end of 6 weeks, considering random variables for weekly delivery, number of patients, and demand per patient. 2) Probability tables for each variable and the random numbers generated for the simulation are presented. 3) The simulation yields a final inventory of 23 surplus units.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PROBLEM 1

Una clínica rural recibe del banco de sangre local una entrega de plasma fresco una vez por
week. The supply varies according to the demand from other clinics and hospitals of the
region, but it is between 4 and 9 units of half a liter of the most commonly used blood type, type
A. The number of patients per week who need this type of blood varies between 0 and 4, and
Each one may need from 1 to 4 units of half a liter.

Based on the following delivery quantities, patient distribution, and demand for
patient. What would be the number of half-liter units remaining or missing at the end?
a period of 6 weeks? Use Monte Carlo simulation to obtain your answer.
Consider that plasma can be stored and that at this moment there is nothing.
available.

Amounts of Demand for


Patient distribution
delivery patient
Units of Patients by Units
Frecue Frequency Frecue
1/2 liter for week that of 1/2
nia ncia ncia
week they require blood liter
4 0.15 0 0.25 1 0.4
5 0.2 1 0.25 2 0.3
6 0.25 2 0.3 3 0.2
7 0.15 3 0.15 4 0.1
8 0.15 4 0.05
9 0.1

Initial considerations

The first thing to identify in this problem is that we are dealing with 3
variables that determine the blood bank inventory.
For each variable, a random number is required to generate changes in the
inventory status. Since we are working with discrete units, it
will use the middle square method for seed generation.
I will require 6 random numbers for each variable to simulate each week.
the blood demand per patient will exceed 6 depending on how many patients there are
they attend every week.
A range table is needed for each variable based on which
They will introduce the simulation data (Note that the table they provide with
frequencies are now sorted in ascending order.

Rank tables for each variable.

Delivery quantities per week


Units of
½ liter per Accumulated Frequency F. Range
week
4 0.15 0.15 01 - 05
5 0.20 0.35 16 - 35
6 0.25 0.60 36 - 60
7 0.15 0.75 61 - 75
8 0.15 0.90 76 - 90
9 0.10 1.00 91 - 00

Patient distribution
Patients per week
Accumulated Frequency F. Range
that require blood
0 0.25 0.25 01 - 25
1 0.25 0.50 26 - 50
2 0.30 0.80 51 - 80
3 0.15 0.95 81 - 95
4 0.05 1.00 96 - 00

Demand for patient


Half-liter units Accumulated Frequency F. Range
1 0.40 0.40 01 - 40
2 0.30 0.70 41 – 70
3 0.20 0.90 71 - 90
4 0.10 1.00 91 – 00
Random numbers for each variable.

Random numbers
Delivery Patients
by for Demand
week week of blood
Seed (Seed) (Seed)
7845 8347 5761
5440 6724 1891
5936 2121 5758
2360 4986 1545
6960 8601 3870
4416 9772 9769

Simulation table.

Patients
No. No. Delivery Total No. No. Demand
Inventory what Patient Leftover
Seman Random for randomly available Random units
the initial they require e s
a o week e o o of blood
blood

1 0 54 6 6 67 2 1° 18 1 5
2° 91 4 1
2 1 40 6 7 24 0 --- -- 0 7
3 7 59 6 13 21 0 --- -- 0 13
4 13 36 6 19 21 0 --- -- 0 19
5 19 23 5 24 49 1 1° 57 2 22
6 22 60 6 28 86 3 1° 58 2 26
2° 15 1 25
3° 45 2 23
Remaining units in 6 weeks 23

OBSERVATION: It should be noted that the demand for blood units per week is at
function of two things: the number of patients requiring blood per week and the amount
of blood units required by each of the patients for the corresponding week.
PROBLEM 2.

In a game between two players, Gerald and Arnold toss a fair coin into the air;
by turns, if the result is heads Gerald pays Arnold $1.0, otherwise Arnold
pay $1.0 to Gerald.

a) Propose How would the simulation be with the Monte Carlo method? Use the function
Random number generator calculator.
b) Conduct an experiment with 5 replicas of 6 launches each to determine it
What does Gerald pay.
c) Based on the results of item b, what is the probability that Gerald will leave?
winning?

SOLUTION:

Part a. To work based on Monte Carlo, it is necessary to create a table of ranges based on
to the probabilities of each event occurring: heads or tails. In this problem, it is said that
the coin is not biased, so the probabilities of each outcome are similar.

On the other hand, a method for generating random numbers is necessary, since
The statement suggests the use of a calculator function, values will be noted.
obtained from the corresponding table

Event (X) P(x) ∑P(x) Range


Dude, Gerald pays $1 0.5 0.5 0.0 ≤ R ≤ 0.5
Corona, Gerald wins $1 0.5 1.00 0.51 ≤ R ≤ 1.0

Random numbers with RAN# function


0.532 0.155 0.370 0.586 0.607 0.884 0.286 0.293 0.035 0.317
0.094 0.448 0.576 0.612 0.308 0.748 0.668 0.922 0.872 0.650
0.655 0.533 0.735 0.700 0.261 0.459 0.346 0.369 0.050 0.021
Part b. For the simulation of 5 replicas, we will use the random numbers from the table.
previous. Let ’s remember that this table is to observe the occasions when he/she pays.
Gerald, that is if 0.0 ≤ R ≤ 0.5

Replica 1 Replica 2 Replica 3 Replica 4 Replica 5


R $ R $ R $ R $ R $
0.532 -1 0.370 1 0.607 -1 0.286 1 0.035 1
0.094 1 0.576 -1 0.308 1 0.668 -1 0.872 -1
0.655 -1 0.735 -1 0.261 1 0.346 1 0.050 1
0.155 1 0.586 -1 0.884 -1 0.293 1 0.317 1
0.448 1 0.612 -1 0.748 -1 0.922 -1 0.650 -1
0.533 -1 0.700 -1 0.459 1 0.369 1 0.021 1
Total 0 Total -4 Total 0 Total 2 Total 2
A positive number is payment and a negative number is profit.

Part c. To evaluate the probability of Gerald winning, the...


results of the simulations and the classical definition of probability.

FavorableC.1
P (GaneGerald )= = =0.20
[Link] 5

For 5 replicas, it is obtained that Gerald has a 20% chance of getting out.
winning
PROBLEM 3.

Using Monte Carlo simulation, simulate 5 losses or wins in the following game of
data. The player rolls two fair dice; if the resulting sum is 4, 7, or 11, the player
wins $10. Otherwise, the player records the resulting sum (called a point) and continues.
rolling the dice until the resulting sum matches the noted point, in which case
the player wins $10. If during the throws after a scored value (Point) ...
gets 7 or 12, the player loses $10.

SOLUTION

. To work on Monte Carlo simulation, we must create the rank tables.


probabilistic. But in this case, they do not give probabilities; however, they tell us that
This is about 2 dice that are not loaded, so each face of a die has the same probability.
probability (1/6) of that being the result.

The image on the right shows the


sum of the different results that
we can obtain in each launch
from data, we can extract from there the

next sample space:

4 = (3,1),(2,2,),(1,3)

7 = (6,1),(5,2),(4,3),(3,4),(2,5),(1,6)

11 = (6,5),(5,6)

. Since a victory or loss event involves the sum of both dice, it


it must simulate the result of each die for each by random numbers
launch, that is to say, the result of each die is a variable therefore
we will use two seed generators for the random numbers of each die
using the least squares method.
Rank tables for each die.

Generation of ranges for Die 1 and 2


Result P(x) ∑P(x) Rango
1 1/6 1/6 = 0.17 01 – 17
2 1/6 1/3 = 0.33 18 - 33
3 1/6 1/2 = 0.50 34 - 50
4 1/6 2/3 = 0.67 51 - 67
5 1/6 5/6 = 0.83 68 - 83
6 1/6 1.0 84 – 00

190 636 525 657 164 719 724 533 462


Randoms Die 1 (Seed 6418)
7 6 9 0 9 2 8 5 2
965 180 544 604 529 348 166 758 592
Random Given 2 (Seed 7139)
3 4 1 4 9 8 1 9 9

Simulation table

R1 R2 SUM (D1 + D2) PROFIT


19 96 2+6 = 8 point
07 53 1+4 = 5
63 18 4+2 = 6
66 04 4+1 = 5
52 54 4+4 = 8 win 10
59 41 4+3 = 7 win 10
65 60 4+4 = 8 (point)
70 44 5+3=8 earn 10
16 52 1+4 = 5 (point)
49 99 3+6 = 9
71 34 5+3 = 8
92 88 6+6 = 12 (loses) -10
72 16 5+1 = 6 (point)
48 61 3+4 = 7 Loses .10
TOTAL $10
PROBLEM 3

The demand for an expensive spare part for a passenger airplane is 0, 1, 2, or 3.


units per month, with respective probabilities of 0.2, 0.3, 0.4, and 0.1. The workshop of
airline maintenance starts working with an inventory of 5 units and
wants to return the level to 5 units immediately when it drops below 3 units.

a) Describe the procedure to determine demand samples.


b) How many months will pass until the first restocking? Use the values.
successive R in the table below.

Random numbers (R)


0.0589 0.6733 0.4799 0.9486 0.6139 0.5933 0.9341 0.1782 0.3473 0.5644

SOLUTION

Part a. The approach consists of the formulation of a ranking table for the
Probabilities given in the statement. The resulting table is shown below:

Demand of P(X) ∑P(x) Rank


parts per month
0 0.20 0.20 0 ≤ R ≤ 0.20
1 0.30 0.50 0.21 ≤ R ≤ 0.50
2 0.40 0.90 0.51 ≤ R ≤ 0.90
3 0.10 1.00 0.91 ≤ R ≤ 1.00

Part b. This part consists of analyzing by simulation the final inventory until it falls to
a value less than 3. To do this we will use the proposed random numbers as
show below:
Month #Random Demand Final Inventory
0 -- -- 5
1 0.0589 0 5
2 0.6733 2 3
3 0.4799 1 2

It will take 3 months until the first restocking of spare parts is done.

You might also like