0% found this document useful (0 votes)
21 views3 pages

DAO Cheatsheeet

Uploaded by

yichienlui03
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)
21 views3 pages

DAO Cheatsheeet

Uploaded by

yichienlui03
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
You are on page 1/ 3

lOMoARcPSD|48036201

DAO1704 Cheatsheet

Decision Analytics using Spreadsheets (National University of Singapore)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Lui Yi Chien ([email protected])
lOMoARcPSD|48036201

Probability Poisson Distribution Var (aX+bY) = a2Var(X) + b2Var (Y) + Excel:


Mutually exclusive: P(A∪B) = P(A) + P(B) Models no. of occurrences of an event 2abcov(X,Y) NORM.S.DIST (Z, cumulative)
Non-ME: P(A∪B) = P(A) + P(B) – P(A∩B) over a specific interval of time and Var (aX+bY) = a2Var(X) + b2Var (Y) + NORM.DIST (x, 𝜇, 𝜎, cumulative)
space. (𝜆: ave. no. per period) 2ab 𝜎x 𝜎y corr (X,Y) R?S
OR convert to Z = T then use S.DIST
Conditional probability: 1. Prob. of an occurrences is same If X and Y are independent, corr = 0, NORM.S.INV(probability) à find n
P(A|B) = P(A|B) = P(A∩B) / P(B) for any 2 intervals of equal length Var(aX+bY) = a2Var(X) + b2Var(Y) Geometry of Linear Programming
If P(Z<n) = 0.345, NORM.S.INV (1-0.345)
P(A∩B) = P(A|B) P(B) OR P(B|A) P(A) 2. Occurrences in non-overlapping Continuous Random Variables Feasible region: set of all the allowed
NORM.INV (probability, 𝜇, 𝜎)
intervals are independent of one 1. The probability for X to be a solutions; a region bounded by the
Finding mean, 1. Use NORM.S.INV to
Given that A1,A2,B1,B2 are mutually exclusive another particular value is nearly 0 R?S constraints
and collectively exhaustive, A r.v. X is said to be a Poisson r.v. with 2. It makes sense to measure the find n. 2. T = n Equality constraints define a line,
A1 A2 parameter 𝜆 (> 0) if it has the probability of a random variable inequality constraints define a space
B1 P(B1∩A1) P(B1∩A2) P(B1) probability function: over a range of values If X~N(𝜇𝑥, 𝜎𝑥 ) & Y~N(𝜇𝑦, 𝜎𝑦 ). Extreme points: corner points on the
B2 P(B2∩A1) P(B2∩A2) P(B2) P(X = i) =
1 23 45
for I = 0, 1, 2… 3. It is still possible to compare the For Z=X+Y, Z~(𝜇x +𝜇y, √ 𝜎𝑥2 + 𝜎𝑦2 ) boundary of the feasible region
6! likelihood of the probabilities of Infeasible problem: a problem with an
P(A1) P(A2) 1 Mean E(X) = 𝜆 Decision Analysis (*Sequence)
r.v. taking diff values. 4 factors: Decisions, Outcomes, empty feasible region (if no common
Var (X) = 𝜆 area between constraints)
Independent events: Excel: POISSON (x, 𝜆, cumulative) Probability, Payoffs
> Redundant constraint: adding or
(P(A|B) = P(A∩B)/P(B) = P(A) Mean 𝜇 = ∫?> 𝑥𝑓(𝑥)dx EMV: weighted average of all possible
Linear functions of a r.v. > removing constraint does not affect
P(A∩B) = P(A|B) x P(B) = P(A) x P(B) If Y = aX + b Variance 𝜎2 = ∫?>(𝑥 − 𝜇)A 𝑓(𝑥)dx payoffs for this decision. (max EMV on
decision node) – sum product of prob. feasible region
E(Y) = aE(X) + b PDF: area under curve = 1; Isoquant: a line on which all points have
Bayes’ Theorem: (used to find reverse cond. Prob.) area = P(a ≤ X ≤ b) and payoffs (written on prob node)
Var(Y) = a2Var(X) the same objective value; all points are
𝐏(𝐀 𝐢 ∩𝐁) >
P(Ai|B) = CDF: F(t) = P(X≤t) = ∫?> 𝑓(𝑠) 𝑑𝑠; equally good on objective function.
𝐏(𝐁) EVPI: max. amount a decision maker
𝐏(𝐁|𝐀 𝐢 )𝐏(𝐀 𝐢 ) Covariance F(t) = F(<t); P(X≤t) = P(X<t) Optimal solution: best feasible solution,
would pay for perfect info.
= 𝐏(𝐁∩𝐀 Cov (X,Y) = E[(X- 𝜇x) (Y- 𝜇y)]
𝟏 )+𝐏(𝐁∩𝐀 𝟐 )+⋯+𝐏(𝐁∩𝐀 𝐧 ) EVPI = max EMV with perfect info – max need not be unique & finite
𝐏(𝐁|𝐀 𝐢 )𝐏(𝐀 𝐢 ) = ∑6 𝑃(X=xi,Y=yi) [(xi - 𝜇x) (yi - 𝜇y)] Uniform Distribution Theorem: for any feasible LP with a
= 𝐏(𝐁|𝐀 EMV without additional info
𝟏 )𝐏(𝐀 𝟏 )+𝐏(𝐁|𝐀 𝟐 )𝐏(𝐀 𝟐 )+..+𝐏(𝐁|𝐀 𝐧 )𝐏(𝐀 𝐧 ) Cov (X,Y) = E(XY) – E(X)*E(Y) X~U[a,b] where X is equally likely to finite optimal solution, there is an
• [P(A1) + P(A2) +…+ P(An) = 1] Cov (X,X) = E[(X - 𝜇x)2] = Var (X) take any value in the range of a to b. optimal solution that is an extreme
[E(XY) = prob * X * Y] D EVSI: max. amount a decision maker
PDF: f(t) = if a≤t≤b; 0 if otherwise would pay for sample info. point. Extreme point is an optimal sln.
[P(X=xi,Y=yi) – joint probability] E?F
Sensitivity = P(test positive|has disease) G?F Binding(active) constraint: constraints
CDF: F(t) = E?F ; 0 if otherwise EVSI = max EMV with sample info – max
Specificity = P(test negative|no disease) Excel: sumproduct(prob, X- 𝜇x, Y- 𝜇y) that are satisfied at equality at the
F+E EMV without additional info)
+ve Predictive value = P(has disease|positive) OR sumproduct(prob,X,Y) – (𝜇x * 𝜇y) Mean E(X) = optimal solution (RHS = LHS). Directly
A EVSI = value of survey = EMV (with cost)
Probability Distributions Correlation (measure of interdependence) (E?F)H related to optimal solution.
XYZ (R,[) Var(X) = + cost i.e. EVSI = 1.36m + 2.4m
Mean E(X) = 𝜇x = ∑^6_D 𝑃6 𝑋6 Corr (X,Y) = DA Non-binding(inactive) constraints:
A TJ T\ Linear Optimization
Var 𝜎2x = ∑^6_D 𝑃6 (𝑋6 − 𝜇J )A = ∑^6_D 𝑃6 𝑋6 A − 𝜇J Cov (X,Y) = Corr (X,Y) 𝜎x 𝜎y Exponential Distribution Decision variable, objective, constraints constraints that are satisfied at strict
1.0 – perfect positive linear r/s i.e. i – product, j – resource, Pi – price of inequality at optimal solution. (RHS!LHS)
Distribution of the amount of time Not directly related to optimal solution.
Discrete: 0 – no linear r/s between X and Y product i, rj – availability of resource j,
until an event occurs. Slack: inequality level; difference
Binomial Distribution: -1.0 – perfect negative linear r/s PDF: f(x) = 𝜆𝑒 ?4J for x>0 aij – units of resource j needed for one
between LHS and RHS (binding = 0)
X ~ B(n,p) Corr = Cov(X,Y)/[s.d.(X) * s.d.(Y)]
^! CDF: F(X) = 1-𝑒 ?4J unit of product i, xi – no. of units to
P(X=x) = J!(^?J)! px (1-p)n-x for x = 0,1,…n D D produce
Joint Probability Distribution E(X) = 4; Var(X) = 4H Active constraints pass through optimal
Mean = E(X) = 𝜇x = np
Two r.v. are independent if all Excel: EXPONDIST (x, 𝜆, cumulative) solution; inactive constraints do not
Var(X) = 𝜎2x = np(1-p) pass through optimal solution.
P(X=x, Y=y) = P(X=x) * P(Y=y)
S.D. = 𝜎x = √ 𝜎2x = √𝑛𝑝(1 − 𝑝) Normal Distribution *an extreme point is the optimal
If independent, (does not mean indp.)
Excel: BINOMDIST (x, n, p, cumulative) X~N(𝜇, 𝜎) solution
P(X = x) – 0/FALSE; P(X ≤ x) – 1/TRUE E(XY) = E(X)*E(Y) à Cov = 0 à Corr = 0
f(t) is symmetric around and highest
*indp. variables are always uncorr but
at its mean.
1. n independent trials r.v. may also be uncorr.
(𝒕2𝝁)𝟐
𝟏 ?
2. 2 outcomes only: success/failure f(t) = 𝒆 𝟐𝝈𝟐
Sum of Random Variables √𝟐𝝅𝝈𝟐
3. Same prob. for each trial (p/1-p) R?S
Mean: E(aX+bY) = aE(X) + bE(Y) X~N (𝜇, 𝜎) à Z = ~ N(0,1)
T

Downloaded by Lui Yi Chien ([email protected])


lOMoARcPSD|48036201

Sensitivity Analysis & Shadow Price Changes in constraint quantity (bi): Discrete Optimization Common uses of binary variables: Converting Linear expression:
Studies the effect of parameter change on Maximisation: objective – profit An optimization problem in which At most 1 event can occur – x1 + x2 ≤ 1 Conditional Range: if event y does not
optimal solution and objective value. ≥ b: high requirement à low profit some(or all) of the decision variables All or nothing – x1 = x2 occur (0), then x=0 ; if event y occurs
≤ b: high resources à high profit must be integer-valued. If 1 occurs, 2 must occur – x1 ≤ x2 (1), then 0 ≤ x ≤ My; y binary
Using example, measure how Minimization: objective – cost Integer programming: all decision If Y is not selected, X must be selected –
optimal solution changes with ≥ b: high requirement à high cost variables are integer valued X+Y≥1
respect to changes in aij, bi, cj
≤ b: high resources à low cost Binary optimization: all decision If X and Y occur, Z must occur – f(x) = 10y + 5x; 0 ≤ x ≤ My
Sensitivity range of an objective coefficient *changes in b changes feasible region variables being binary valued (yes/no) X+Y–1≤Z
*last point that isoquant hits feasible Mixed Interger Optimization: some of If X occurs, Y, Z or Y and Z must occur – Excel Functions
(ci): range that current optimal solution WILL COUNTIF(range, criteria) i.e. (A:A,South)
NOT CHANGE. Objective value WILL change region is the optimal solution. the decision variables being integer or X≤Y+Z
binary valued. If X is not chosen, Z cannot be chosen – COUNTIFS(criteria range 1, criteria 1,
according to change in c. Changing ci rotates
the isoquant and direction. Shadow Price: marginal change of the X≥Z criteria range 2, criteria 2,…)
objective value because of an General Framework for binary: At most 2/3 selected – X + Y + Z ≤ 2 SUM/MAX/MIN/AVERAGE(range)
Sensitivity range of a constraint quantity (bi): SUMPRODUCT(array 1, array 2…)
range of values that binding constraints will additional resource or requirement. Conditional: If logical statement 1 is If either X or Y or both occur, Z cannot
*only valid within sensitivity range true, then statement 2 must be true 𝑿+𝒀 AVERAGEIF(range, criteria, range of data
remain so. Optimal solution ALWAYS CHANGES occur – ≤1–Z
1 unit change in b will result in 1 LS 1 (condition) ≤ LS 2 (conclusion) 𝟐 to count average) i.e. ave sales in region
if changing constraint is binding but binding X only occurs if both Y and Z occur – AVERAGEIFS(ave. range, range 1, criteria
constraint WILL NOT change if in the range. shadow price unit change in objective. Cross validation must be done in
2X ≤ Y + Z 1, range 2, criteria 2…)
Changing aij rotates constraint: changes Allowable increase/decrease: order to make sure constraint is right.
If C is not selected, A or B or both has to IF(logical test, [value if true],[value if
sensitivity range that SP & set of Condition true à conclusion true
everything (binding constraint, optimal be selected – 1 – C ≤ A + B false]) i.e. =IF(F2=$K$1,J2,NA())
solution, objective value) binding constraints do not change. Condition false à conclusion may or
If 2 out of B, C, D are selected, A has to VAR.P(range) or VAR.S(range)
Changing bi shifts the corresponding may not be true 𝐁+𝐂+𝐃?𝟏
Questions: be selected – 𝐀 ≥ 𝟐
COVARIANCE.P(array 1, array 2)
constraint: optimal solution and objective *remember to specify r/s between x and y CORREL(array 1, array 2)
Check if new parameter is in sensitivity Cannot choose C and D at the same
value always changes. Shadow price will (conditional range) i.e. xi ≤ Myi STDEV.P(highlight numbers)
remain the same – use to estimate impact on range à if yes, optimal solution no *Logical upper limit = M*y (binary) time unless both A and B are chosen:
𝐀+𝐁 *S = sample, P = population
objective value. change à use SP to calculate objective - constraint/smallest unit 𝐂+𝐃≤ 𝟐 +𝟏
Cloth example Shopping Mall Call Scheduling
i – type of product; Ri – rental cost of machine 1 if j number of type i store is chosen i – working hours in a day; j – shifts (j=1,2,3
X ƒ„ = m
for product I; Hi – unit labor hours per product i; 0 if otherwise full time shift respectively)
Ai – sq yard of cloth per unit of product i, Pi – Xij binary (i – type of store, j – number of stores) 1 if shift j works in hour i
𝐚𝐢𝐣 = m
unit profit of product i; Xi: quantity to produce Fi – square footage of store type i 0 if otherwise
1 if product i is produced Rij – rental income per store for j number of type i stores Di – the no. of calls arriving in hour i (where I
𝑌𝑖 = m = 1,…11); Pf – full time pay and Pp – part
0 otherwise (Rij = 0.05Pij)
Max ∑|6_D 𝑃𝑖𝑋𝑖 – ∑|6_D 𝑅𝑖𝑌𝑖 1. Max rental income – max ∑6(∑•‹_D 𝑗𝑃𝑖𝑗𝑋𝑖𝑗 ) time pay; W – total no. of workstations avail;
∑ | ∑ |
s.t. 6_D 𝐻𝑖𝑋𝑖 ≤ 4000, 6_D 𝐴𝑖𝑋𝑖 ≤ 4500 2. Mutually exclusive – Xi1+Xi2+Xi3 = 1, where i = R – no. of calls an operator can process per
0 ≤ Xi ≤ MYi, for i = 1,2,3,4,5. Yi binary. M is J,S,D,C; XB1+XB2+XB3 ≤ 1 (0-3) hour; Xj – the no. of operators to hire for
logical upper limit (constraint/smallest unit) 3. Total square footage – ∑6(𝑓𝑖 ∑•‹_D 𝑗𝑋𝑖𝑗𝑃𝑖𝑗 ) ≤ 10000 shift j (where j = 1…5); Ai – no. of operators
TV Show avail in hour i; Yi – no. of operators working
Linda choose course in hour i; Zi – the no. of calls to be processed
1 if j is selected at sem i 1 if show i is chosen
X ƒ„ = m Xƒ = m
0 otherwise 0 if otherwise in hour i; Bi – no. of calls to be processed in
EVSI: -13.9-(-14)+1=1.1, EVPI: -13-(-14)+1=2. If want to find If 2 or more shows in comedy chosen, then must
1 if j is offerred at sem i hour i; Vi – no. of calls unanswered in hour i
best value of p to maximise EVPI/SI, separate p into bins, aij = m schedule at least one in drama – (X1+X5+X8-1)/2 ≤
0 otherwise
place EVSI value beside the header, highlight the table, Xij, Aij binary. X1+X2+X3+X4+X7 Min Pf ∑•‹_D 𝑋𝑗 + Pp ∑|‹_• 𝑋𝑗
what-if analysis, column input cell is p’s cell. If more than 3 violence chosen,
Max interest level – max ∑A6_D ∑AŒ ‹_D 𝐼‹ 𝑋6,‹ 𝑎6,‹ Ai = ∑|‹_D 𝑎𝑖𝑗𝑋𝑗 for i = 1…11 (avail. Operators)
will be penalized and lose 4 mil.
EVPI: Assume outcome of survey 1. Take at most 5 courses each sem – ∑AŒ ‹_D 𝑋𝑖𝑗 ≤ 5, i = 1,2 1 if penalised
Yi ≤ Ai (working cannot exceed avail)
perfectly accurate – after “conduct 2. Can only take course if completed/taking prerequisites - Yƒ = m Bi = Di + Vi-1
0 if otherwise
survey” node, branch into X2,10 ≤ (X1,1 + X1,8 + X2,1 + X2,8)/2 [need to take 1&8 to take (X2+X3+X4+X6–3) / M ≤ y Zi ≤ Bi
outcomes (no positive & negative) 10] Objective: max ∑˜6_D 𝑋𝑖𝑃𝑖 − 4𝑦 Zi ≤ RYi (processed cannot exceed what the
If neither X nor Y is selected, Z X2,14 ≤ X1,4 + X2,4 [need to take 4 to take 14] Sudoku operators call process)
must be selected – 1 – X – Y ≤ Z 3. Take at least 3 courses from 5 – 1 if number k is used in cell (i, j) Vi = Bi – Zi
X ƒ„™ = m
If either X or Y is selected, Z cannot XD,D + XD,• + XD,• + XD,| + XD,‘ ≥ 3 0 if otherwise Vo = 0 (no carried forward calls for 1st hour)
be selected – X + Y ≤ 2( 1 – Z) Only 1 number in each cell - ∑˜›_D 𝑋6‹› = 1 V11 = 0
4. Take 18 or 20 – X1,18 + X2,18 + X2,20 ≤ 1
All numbers in each row must be different - Xj ≥ 0, integer; Yi ≥ 0, integer; Zi ≥ 0, integer
𝐀+𝐁
Cannot choose C or D unless both A and B are chosen – 𝐂 ≤ 𝟐 𝐚𝐧𝐝 𝐃 ≤ 𝟐
𝐀+𝐁 5. 𝑥6,‹ ≤ 𝑎6,‹ (Course can only be taken in Sem i if it is
∑˜‹_D 𝑋6‹› = 1 where k = 1…9, i = 1…9
offered)
Must choose at least C or D if both A & B are chosen – C + D ≥ A + B – 1 6. ∑A6_D 𝑋6‹ ≤ 1(Course is only taken once even if it is Every number cannot be repeated in each
Yi Chien ([email protected]) box ∑‹_D ∑6_D 𝑋6‹› = 1, for k = 1…9
𝐀+𝐁 • •
Must choose at least C or D if either A or B or both are chosen – 𝐂 + 𝐃 ≥ 𝟐 Downloaded by Lui
offered in both semesters)

You might also like