Operations Research
Comprehensive Notes, Examples & Quiz
Table of Contents
1. Introduction to Operations Research
Definition: Operations Research (OR) is a discipline that deals with the application of advanced analytical methods to help make better decisions. It employs techniques from mathematical sciences, statistics, and computing to solve complex problems and optimize processes.
Historical Background
Operations Research emerged during World War II when military planners needed scientific methods for complex strategic and tactical problems. After the war, these techniques were adopted by industries for operational efficiency.
Key Characteristics of OR:
- Interdisciplinary approach
- System orientation
- Use of scientific methodology
- Quantitative solutions to qualitative problems
- Team-based problem solving
The OR Process:
- Problem Definition: Clearly identify the problem, objectives, and constraints
- Model Construction: Create a mathematical representation of the real-world problem
- Solution Derivation: Apply appropriate techniques to solve the model
- Model Validation: Test the solution against real data
- Implementation: Apply the solution to the real-world problem
Real-World Applications
- Manufacturing optimization
- Supply chain and logistics management
- Financial portfolio management
- Healthcare systems optimization
- Transportation scheduling
- Resource allocation in various industries
2. Linear Programming
Definition: Linear Programming (LP) is an optimization technique for a system of linear constraints and a linear objective function. It's used to find the best outcome in a mathematical model with linear relationships.
Components of a Linear Program:
- Decision Variables: The quantities to be determined
- Objective Function: A linear function to be maximized or minimized
- Constraints: Linear inequalities or equations representing limitations
- Non-negativity: Variables are typically required to be non-negative
Standard Form Example
Maximize: Z = 3x + 4y
Subject to:
- x + 2y ≤ 10
- 3x + y ≤ 15
- x, y ≥ 0
Solution Methods:
1. Graphical Method (for 2 variables)
- Plot the constraints on a coordinate system
- Identify the feasible region (area satisfying all constraints)
- Find corner points (vertices) of the feasible region
- Evaluate the objective function at each corner point
- Select the point giving the optimal objective value
Graphical solution of a linear programming problem
2. Simplex Method
A systematic algebraic procedure for finding the optimal solution by moving from one feasible corner point to another while improving the objective function value.
3. Interior Point Methods
Algorithms that reach an optimal solution by traversing the interior of the feasible region rather than along its edges.
Practical Example: Product Mix Problem
Scenario: A furniture manufacturer produces chairs and tables. Each chair requires 5 hours of carpentry and 2 hours of finishing. Each table requires 10 hours of carpentry and 3 hours of finishing. The workshop has 100 hours available for carpentry and 36 hours for finishing per week. The profit is $25 per chair and $30 per table.
Formulation:
Let x = number of chairs produced
Let y = number of tables produced
Maximize: Z = 25x + 30y (profit)
Subject to:
- 5x + 10y ≤ 100 (carpentry constraint)
- 2x + 3y ≤ 36 (finishing constraint)
- x, y ≥ 0 (non-negativity)
Solution:
Using the simplex method or graphical method, we find the optimal solution is x = 12 chairs and y = 4 tables, giving a maximum profit of $420.
Applications of Linear Programming:
- Production planning and scheduling
- Transportation and logistics optimization
- Portfolio optimization in finance
- Staff scheduling
- Diet and nutrition planning
- Advertising media selection
3. Integer Programming
Definition: Integer Programming (IP) is a mathematical optimization where some or all variables are restricted to be integers. This is crucial for problems where fractional solutions don't make practical sense, like producing 2.5 cars.
Types of Integer Programs:
- Pure Integer Programming (IP): All variables must be integers
- Mixed Integer Programming (MIP): Some variables are integers, others can be continuous
- Binary Integer Programming (BIP): Variables are restricted to 0 or 1 (often used for yes/no decisions)
Example Formulation
Maximize: Z = 5x + 7y
Subject to:
- 2x + 3y ≤ 12
- 3x + 2y ≤ 12
- x, y ≥ 0 and integer
Solution Methods:
1. Branch and Bound
A systematic approach that:
- Solves the LP relaxation (ignoring integer constraints)
- If the solution has non-integer values, branches the problem into subproblems by adding constraints
- Continues branching and solving until finding the optimal integer solution
2. Cutting Plane Method
Adds constraints ("cuts") to the LP relaxation to eliminate non-integer solutions, gradually forcing the solution toward integer values.
3. Branch and Cut
A hybrid approach combining branch and bound with cutting planes for improved efficiency.
4. Dynamic Programming
For certain integer programming problems, especially those with a recursive structure.
Practical Example: Facility Location Problem
Scenario: A company needs to decide which of 3 potential warehouse locations to open to serve 5 customers with minimum cost. Each warehouse has a fixed opening cost and variable costs to serve each customer.
Formulation:
Let yj = 1 if warehouse j is opened, 0 otherwise
Let xij = 1 if customer i is served by warehouse j, 0 otherwise
Minimize: Z = Σ fjyj + Σ cijxij (fixed costs + variable costs)
Subject to:
- Σ xij = 1 for all i (each customer must be served)
- xij ≤ yj for all i,j (can only serve from open warehouses)
- xij, yj ∈ {0,1} (binary variables)
Applications of Integer Programming:
- Facility location and plant layout
- Production planning with setup costs
- Vehicle routing and scheduling
- Capital budgeting
- Crew scheduling
- Resource allocation with indivisible units
- Network design problems
4. Network Analysis
Definition: Network Analysis in OR involves optimizing flows, connections, or sequences in systems that can be modeled as networks of nodes (points) and arcs (connections).
Key Network Problems:
1. Shortest Path Problem
Finding the path between two nodes with minimum total distance or cost.
Solution Methods:
- Dijkstra's Algorithm: For networks with non-negative arc costs
- Bellman-Ford Algorithm: Can handle negative arc costs (but not negative cycles)
2. Minimum Spanning Tree
Finding a tree (a connected subgraph with no cycles) that connects all nodes with minimum total cost.
Solution Methods:
- Kruskal's Algorithm: Starts with no edges and adds the lowest-cost edge that doesn't create a cycle
- Prim's Algorithm: Starts with a single node and gradually grows the tree
3. Maximum Flow Problem
Determining the maximum flow that can be sent from a source to a sink through a network with capacity constraints.
Solution Methods:
- Ford-Fulkerson Algorithm: Iteratively finds augmenting paths and increases flow
- Edmonds-Karp Algorithm: A specific implementation of Ford-Fulkerson
4. Minimum Cost Flow Problem
Finding the cheapest way to send a specified amount of flow through a network with capacity and cost on each arc.
Solution Methods:
- Network Simplex Algorithm: A specialized version of the simplex method
- Successive Shortest Path Algorithm: Repeatedly finds shortest paths and pushes flow
5. Transportation Problem
Determining how to distribute goods from multiple sources to multiple destinations at minimum cost.
Solution Methods:
- Northwest Corner Method: A simple method to find an initial basic feasible solution
- Vogel's Approximation Method: A more sophisticated approach for initial solution
- Modified Distribution (MODI) Method: An optimality test and improvement procedure
6. Assignment Problem
Assigning n workers to n jobs in the most efficient way.
Solution Methods:
- Hungarian Algorithm: An efficient combinatorial optimization algorithm
Practical Example: Critical Path Method (CPM) for Project Scheduling
Scenario: A construction project consists of several activities with specified durations and precedence relationships. We need to determine the minimum project completion time and identify critical activities.
Activity | Duration (days) | Predecessors |
---|---|---|
A | 5 | - |
B | 3 | - |
C | 4 | A |
D | 6 | B |
E | 2 | C, D |
Solution Process:
- Create a network diagram showing activities and their dependencies
- Calculate earliest start (ES) and earliest finish (EF) times by forward pass
- Calculate latest start (LS) and latest finish (LF) times by backward pass
- Calculate float (slack) for each activity: LS - ES or LF - EF
- Identify critical activities (those with zero float)
- The critical path is the sequence of critical activities, and its length determines the minimum project duration
Result: The critical path is A → C → E with a project duration of 11 days.
Applications of Network Analysis:
- Transportation and logistics optimization
- Supply chain network design
- Project management (PERT/CPM)
- Telecommunication network design
- Traffic flow optimization
- Circuit design in electronics
- Social network analysis
5. Queuing Theory
Definition: Queuing Theory is the mathematical study of waiting lines or queues. It analyzes the behavior of service systems where customers arrive, wait for service, and depart after being served.
Kendall's Notation: A/B/c/K/m/Z
- A: Arrival process distribution (e.g., M for Markovian/exponential, D for deterministic)
- B: Service time distribution
- c: Number of servers
- K: System capacity (maximum number of customers allowed)
- m: Population size
- Z: Queue discipline (e.g., FCFS, LCFS, SIRO, priority)
The simplified notation A/B/c is commonly used when K = ∞, m = ∞, and Z = FCFS.
Basic Queue Performance Measures
- λ: Average arrival rate
- μ: Average service rate per server
- ρ = λ/(cμ): System utilization (traffic intensity)
- Lq: Average number of customers in queue
- Ls: Average number of customers in system
- Wq: Average waiting time in queue
- Ws: Average time spent in system
Little's Law: L = λW (The average number in the system equals the arrival rate times the average time in the system)
Common Queuing Models:
1. M/M/1 Queue (Single Server, Exponential Arrivals and Service)
Formulas (for stable systems where ρ < 1):
- ρ = λ/μ
- Ls = ρ/(1-ρ)
- Lq = ρ²/(1-ρ)
- Ws = 1/(μ-λ)
- Wq = λ/[μ(μ-λ)]
2. M/M/c Queue (Multiple Servers, Exponential Arrivals and Service)
A more complex model with c servers that requires special formulas involving Erlang's C formula.
3. M/G/1 Queue (General Service Times)
Pollaczek-Khinchin Formula for average waiting time:
Wq = (λ × E[S²]) / (2 × (1 - ρ))
where E[S²] is the second moment of service time.
4. G/G/1 Queue (General Arrivals and Service)
Requires approximation formulas or simulation for analysis.
Practical Example: Bank Teller Analysis
Scenario: A bank has a single teller. Customers arrive at an average rate of 15 per hour (Poisson distribution). The teller takes an average of 3 minutes to serve each customer (exponentially distributed).
Solution:
- Arrival rate: λ = 15 customers/hour
- Service rate: μ = 60/3 = 20 customers/hour
- Traffic intensity: ρ = λ/μ = 15/20 = 0.75
- Average number in system: Ls = ρ/(1-ρ) = 0.75/(1-0.75) = 3 customers
- Average waiting time in queue: Wq = ρ/(μ-λ) = 0.75/(20-15) = 0.15 hours = 9 minutes
- Average time in system: Ws = 1/(μ-λ) = 1/(20-15) = 0.2 hours = 12 minutes
Analysis: With a single teller, customers wait an average of 9 minutes in the queue before being served. If this is deemed too long, the bank might consider adding a second teller.
Applications of Queuing Theory:
- Customer service systems design
- Call center staffing
- Hospital emergency room management
- Traffic flow analysis
- Computer systems and network performance
- Manufacturing production lines
- Transportation systems (airports, highways)
6. Inventory Models
Definition: Inventory models are mathematical frameworks to determine optimal inventory levels that minimize total costs while meeting customer service requirements.
Key Inventory Costs:
- Holding (Carrying) Cost: Cost of maintaining inventory (storage, insurance, capital, etc.)
- Ordering (Setup) Cost: Fixed cost associated with placing an order or setting up production
- Shortage (Stockout) Cost: Cost from lost sales or backorders when demand cannot be met
- Purchase Cost: Cost of purchasing or manufacturing the item
Major Inventory Models:
1. Economic Order Quantity (EOQ) Model
Basic model assuming constant demand rate, instantaneous replenishment, and no stockouts.
EOQ Formula: Q* = √(2DS/H)
Where:
D = Annual demand
S = Setup/ordering cost per order
H = Annual holding cost per unit
Total Cost Formula: TC = PD + (D/Q)S + (Q/2)H
Where P = Unit purchase price
Optimal Cycle Time: T* = Q*/D
2. Production Order Quantity (POQ) Model
Extension of EOQ where replenishment is not instantaneous but occurs at a finite rate.
POQ Formula: Q* = √(2DS/H) × √(p/(p-d))
Where:
p = Production rate
d = Demand rate
3. EOQ with Planned Shortages
Allows for planned stockouts when it is cheaper to have occasional shortages than to hold excess inventory.
4. Quantity Discount Model
Incorporates price discounts for larger order quantities.
5. Probabilistic Inventory Models
Models with uncertain demand, including:
- Newsvendor (Single-Period) Model: For perishable items or single selling seasons
- Continuous Review (Q,R) Model: Orders Q units when inventory level drops to reorder point R
- Periodic Review (s,S) Model: Reviews inventory at fixed intervals and orders up to S when level is below s
Practical Example: EOQ Model Application
Scenario: A retail store sells 10,000 units of a product annually. The ordering cost is $50 per order. The annual holding cost is $2 per unit. The unit purchase price is $20.
Solution:
Given:
D = 10,000 units/year
S = $50 per order
H = $2 per unit per year
P = $20 per unit
Step 1: Calculate EOQ
Q* = √(2DS/H) = √(2 × 10,000 × 50 / 2) = √500,000 = 707 units
Step 2: Calculate number of orders per year
N = D/Q* = 10,000/707 ≈ 14.14 orders/year
Step 3: Calculate time between orders
T* = Q*/D = 707/10,000 = 0.0707 years ≈ 25.8 days
Step 4: Calculate total annual cost
TC = PD + (D/Q*)S + (Q*/2)H
TC = 20 × 10,000 + (10,000/707) × 50 + (707/2) × 2
TC = 200,000 + 707 + 707 = $201,414
Conclusion: The store should order 707 units every 25.8 days, resulting in a total annual inventory cost of $201,414 (including purchase cost).
Applications of Inventory Models:
- Retail inventory management
- Manufacturing production planning
- Pharmaceutical and healthcare supplies
- Spare parts inventory for maintenance
- Food and perishable goods management
- Supply chain optimization
- Seasonal goods planning
7. Simulation
Definition: Simulation is the imitation of a real-world process or system over time. In Operations Research, simulation is used to analyze systems too complex for analytical solutions, allowing for "what-if" scenario testing and risk assessment.
Types of Simulation:
- Discrete-Event Simulation: Models the operation of a system as a discrete sequence of events
- Continuous Simulation: Models systems where state variables change continuously over time
- Monte Carlo Simulation: Uses random sampling to obtain numerical results
- Agent-Based Simulation: Models the actions and interactions of autonomous agents
- System Dynamics: Models complex systems with feedback loops and time delays
Steps in a Simulation Study:
- Problem formulation and objective setting
- Model conceptualization and data collection
- Model translation (programming)
- Verification (ensuring the model runs as intended)
- Validation (ensuring the model represents reality)
- Experimental design and execution
- Analysis of results
- Documentation and implementation
Random Number Generation
Simulation often requires generating random numbers from specific probability distributions:
- Uniform Distribution: Basic random numbers between 0 and 1
- Other Distributions: Generated using techniques like inverse transform, acceptance-rejection, etc.
Common techniques:
- Inverse Transform: If F(x) is the CDF, then F-1(U) gives a random variate from the distribution, where U is uniform(0,1)
- Box-Muller Transform: For generating normal random variables
- Acceptance-Rejection: For complex distributions without closed-form inverse CDFs
Key Simulation Concepts:
1. Entities and Attributes
Entities are the objects being processed in the system (customers, products). Attributes are their characteristics (arrival time, service needs).
2. Activities and Events
Activities consume time (service, transport). Events are instantaneous occurrences that change the system state (arrival, departure).
3. State Variables
Variables that describe the system at any point in time (queue length, server status).
4. Random Variates
Random values drawn from probability distributions to model uncertainty.
5. Statistical Analysis
Techniques to analyze simulation outputs, including:
- Confidence intervals
- Hypothesis testing
- Variance reduction techniques
- Warm-up period determination
- Run length determination
Practical Example: Bank Simulation
Scenario: A bank has two tellers. Customers arrive according to a Poisson process with a mean of 20 per hour. Service times follow an exponential distribution with a mean of 5 minutes.
Simulation Approach:
- Generate random inter-arrival times using an exponential distribution with mean 3 minutes (60/20)
- Generate random service times using an exponential distribution with mean 5 minutes
- Track the system state (queue length, teller status) as customers arrive and depart
- Collect statistics on waiting times, queue lengths, and teller utilization
Pseudocode for Discrete-Event Simulation:
Initialize: Clock = 0 TellerStatus = [IDLE, IDLE] Queue = empty EventList = [first customer arrival] Statistics = initialize all counters While simulation time not reached: Get next event E from EventList Advance Clock to E.time If E is an arrival: Schedule next arrival If any teller is IDLE: Assign customer to idle teller Schedule a departure Else: Add customer to Queue If E is a departure: Mark teller as IDLE If Queue not empty: Get next customer from Queue Assign to freed teller Schedule a departure Update statistics Calculate final statistics and results
Sample Results:
- Average waiting time: 4.2 minutes
- Maximum queue length: 7 customers
- Teller utilization: 83%
Conclusion: With two tellers, the system appears stable but has moderate waiting times. Management might consider adding a third teller during peak hours.
Applications of Simulation:
- Manufacturing systems design and analysis
- Supply chain optimization
- Healthcare systems (emergency rooms, operating rooms)
- Call center staffing and operations
- Transportation systems (airports, highways)
- Financial risk analysis
- Military operations planning
- Computer network performance
8. Decision Theory
Definition: Decision Theory is a framework for making optimal choices under conditions of uncertainty. It provides structured methods for evaluating alternatives based on their expected outcomes and the decision maker's preferences.
Types of Decision Environments:
- Decision Making Under Certainty: All outcomes of each alternative are known with certainty
- Decision Making Under Risk: Multiple possible outcomes with known probabilities
- Decision Making Under Uncertainty: Multiple possible outcomes with unknown probabilities
Decision Making Under Risk:
1. Expected Value Criterion
Select the alternative with the highest expected value (or lowest expected cost).
EV(Alternative i) = Σ P(j) × V(i,j) for all states of nature j
Where P(j) is the probability of state j, and V(i,j) is the value of alternative i in state j.
2. Expected Utility Criterion
Incorporates the decision maker's risk attitude by using utility functions instead of monetary values.
EU(Alternative i) = Σ P(j) × U(V(i,j)) for all states of nature j
Where U() is the utility function.
3. Mean-Variance Analysis
Considers both the expected return and the variance (risk) of each alternative.
Decision Making Under Uncertainty:
1. Maximin (Pessimistic) Criterion
Select the alternative with the best worst-case outcome.
Maximin value = max[min V(i,j) over all j] over all i
2. Maximax (Optimistic) Criterion
Select the alternative with the best best-case outcome.
Maximax value = max[max V(i,j) over all j] over all i
3. Hurwicz Criterion
A weighted average of the Maximin and Maximax values, with α representing the optimism index.
Hurwicz value = α × max V(i,j) + (1-α) × min V(i,j) for alternative i
4. Minimax Regret Criterion
Select the alternative that minimizes the maximum regret (opportunity loss).
- Compute the regret matrix: R(i,j) = max V(k,j) over all k - V(i,j)
- Find the maximum regret for each alternative: max R(i,j) over all j
- Select the alternative with the minimum maximum regret
5. Laplace Criterion (Principle of Insufficient Reason)
Assume all states of nature are equally likely and compute the expected value.
Laplace value = (Σ V(i,j) over all j) / n for alternative i, where n is the number of states
Decision Trees
A graphical representation of decision problems with sequential decisions and uncertain events:
- Decision Nodes: Points where the decision maker chooses among alternatives (represented by squares)
- Chance Nodes: Points where nature determines the outcome (represented by circles)
- Terminal Nodes: Final outcomes with associated payoffs
Decision trees are analyzed by backward induction (folding back), starting from the terminal nodes and working backward to find the optimal decision strategy.
Practical Example: Investment Decision
Scenario: An investor is considering three investment options: Stock A, Bond B, or Mutual Fund C. The payoff depends on the economic condition (Boom, Normal, or Recession).
Investment / Economy | Boom (30%) | Normal (50%) | Recession (20%) |
---|---|---|---|
Stock A | $20,000 | $12,000 | -$5,000 |
Bond B | $8,000 | $8,000 | $8,000 |
Mutual Fund C | $15,000 | $10,000 | $2,000 |
Analysis with Expected Value Criterion:
- E[Stock A] = 0.3 × $20,000 + 0.5 × $12,000 + 0.2 × (-$5,000) = $6,000 + $6,000 - $1,000 = $11,000
- E[Bond B] = 0.3 × $8,000 + 0.5 × $8,000 + 0.2 × $8,000 = $8,000
- E[Mutual Fund C] = 0.3 × $15,000 + 0.5 × $10,000 + 0.2 × $2,000 = $4,500 + $5,000 + $400 = $9,900
Decision: Stock A has the highest expected value at $11,000, so it would be the optimal choice under the expected value criterion.
Analysis with Maximin Criterion:
- Worst case for Stock A: -$5,000
- Worst case for Bond B: $8,000
- Worst case for Mutual Fund C: $2,000
Decision: Bond B has the best worst-case scenario at $8,000, so it would be the optimal choice for a risk-averse investor using the maximin criterion.
Applications of Decision Theory:
- Investment and portfolio management
- New product development decisions
- Capital budgeting and project selection
- Insurance pricing and risk assessment
- Medical diagnosis and treatment selection
- Marketing strategy development
- Environmental policy making
9. Game Theory
Definition: Game Theory is the study of mathematical models of strategic interaction among rational decision-makers. It analyzes situations where each participant's success depends on the choices of others.
Key Components of a Game:
- Players: The decision-makers
- Strategies: The actions available to each player
- Payoffs: The outcomes or utilities for each player based on strategy combinations
- Information: What players know when making decisions
- Rules: How the game is played
Types of Games:
- Zero-Sum vs. Non-Zero-Sum: In zero-sum games, one player's gain is another's loss. In non-zero-sum games, mutual gains are possible.
- Simultaneous vs. Sequential: Players move simultaneously or in a specific order.
- Perfect vs. Imperfect Information: Whether players know all previous moves.
- Complete vs. Incomplete Information: Whether players know all payoffs and preferences.
- Cooperative vs. Non-Cooperative: Whether binding agreements are possible.
- Finite vs. Infinite: Number of times the game is played.
Non-Cooperative Game Theory:
1. Strategic Form (Normal Form) Games
Represented as a matrix showing players, strategies, and payoffs.
Nash Equilibrium
A set of strategies where no player can benefit by changing their strategy while others keep theirs unchanged. Finding Nash equilibria:
- Pure Strategy Nash Equilibrium: Each player selects a single strategy with certainty
- Mixed Strategy Nash Equilibrium: Players randomize among strategies with specific probabilities
Dominant and Dominated Strategies
- Strictly Dominant Strategy: Yields higher payoff than any other strategy, regardless of opponent's choices
- Weakly Dominant Strategy: Yields at least as high a payoff as any other strategy
- Strictly Dominated Strategy: Always yields lower payoff than some other strategy
- Iterated Elimination of Dominated Strategies: A method to simplify games and find equilibria
2. Extensive Form Games
Represented as a tree showing the sequence of moves and information sets.
- Subgame Perfect Equilibrium: Nash equilibrium that represents rational play in every subgame
- Backward Induction: Method for finding subgame perfect equilibria in finite games of perfect information
3. Repeated Games
The same game played multiple times, allowing for strategies based on past behavior.
- Finite Repetition: Game played a known, finite number of times
- Infinite Repetition: Game played indefinitely, allowing for cooperation through the threat of future punishment
- Folk Theorem: In infinitely repeated games, any individually rational outcome can be sustained as an equilibrium
Cooperative Game Theory:
- Transferable Utility Games: Players can transfer utility between themselves
- Coalition Formation: Groups of players working together
- Core: Set of allocations that cannot be improved upon by any coalition
- Shapley Value: Fair distribution of gains from cooperation
- Bargaining Solutions: Nash bargaining solution, Kalai-Smorodinsky solution
Practical Example: Prisoner's Dilemma
Scenario: Two suspects are separated and offered a deal. If one confesses and the other doesn't, the confessor goes free while the other receives a severe sentence. If both confess, they receive moderate sentences. If neither confesses, they receive light sentences for a lesser charge.
Prisoner 2: Cooperate (Silent) | Prisoner 2: Defect (Confess) | |
Prisoner 1: Cooperate (Silent) | (-1, -1) 1 year each |
(-10, 0) 10 years, goes free |
Prisoner 1: Defect (Confess) | (0, -10) Goes free, 10 years |
(-5, -5) 5 years each |
Analysis:
- For Prisoner 1:
- If Prisoner 2 stays silent, Prisoner 1 is better off confessing (0 > -1)
- If Prisoner 2 confesses, Prisoner 1 is better off confessing (-5 > -10)
- Confessing is a dominant strategy for Prisoner 1
- Similarly, confessing is a dominant strategy for Prisoner 2
- Nash Equilibrium: (Confess, Confess) with payoff (-5, -5)
- Pareto Optimal Outcome: (Silent, Silent) with payoff (-1, -1)
Conclusion: This illustrates the tension between individual rationality and collective optimality. Even though both prisoners would be better off cooperating (staying silent), the Nash equilibrium is for both to defect (confess).
Business Application: This game structure applies to many business scenarios like:
- Pricing competition between duopolists
- Advertising spending decisions
- Research and development investments
- Environmental compliance
Applications of Game Theory:
- Competitive pricing strategies
- Auction design and bidding strategies
- Market entry and exit decisions
- Labor negotiations
- Military and defense strategy
- Political campaigns and voting
- Resource allocation and bargaining
- Network formation and social interactions
10. Dynamic Programming
Definition: Dynamic Programming (DP) is a method for solving complex problems by breaking them down into simpler subproblems and solving each subproblem only once, storing the solutions to avoid redundant computations.
Key Principles:
- Optimal Substructure: An optimal solution to the problem contains optimal solutions to subproblems
- Overlapping Subproblems: The same subproblems are solved multiple times when using a recursive algorithm
- Bellman's Principle of Optimality: An optimal policy has the property that whatever the initial state and initial decision are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision
Approaches to Dynamic Programming:
1. Top-Down Approach (Memoization)
- Formulate the problem recursively
- Implement the recursive solution
- Add memoization (caching) to store results of solved subproblems
- Retrieve results from cache when subproblems are encountered again
2. Bottom-Up Approach (Tabulation)
- Identify the order of subproblems from smallest to largest
- Create a table to store solutions to subproblems
- Fill the table in a bottom-up manner (from smallest to largest subproblems)
- Construct the final solution from the completed table
Common Dynamic Programming Patterns:
1. 1D DP (Linear State)
Problems where the state can be represented with a single variable.
Examples: Fibonacci sequence, climbing stairs problem
2. 2D DP (Matrix State)
Problems where the state needs two variables.
Examples: Grid traversal, edit distance, longest common subsequence
3. Interval DP
Problems involving intervals or subarrays.
Examples: Matrix chain multiplication, optimal binary search tree
4. Tree DP
Problems involving tree structures.
Examples: Maximum independent set in trees
5. State Compression DP
Using bit manipulation to represent states efficiently.
Examples: Traveling salesman problem, subset sum problems
Recursive Formulation
The heart of dynamic programming is finding a recursive relation. For example:
- Fibonacci: F(n) = F(n-1) + F(n-2) with F(0) = 0, F(1) = 1
- Longest Common Subsequence: LCS(i,j) = 1 + LCS(i-1,j-1) if X[i] = Y[j], else max(LCS(i-1,j), LCS(i,j-1))
- Knapsack Problem: DP[i][w] = max(val[i-1] + DP[i-1][w-wt[i-1]], DP[i-1][w]) if wt[i-1] ≤ w, else DP[i-1][w]
Practical Example: Knapsack Problem
Scenario: A thief has a knapsack with capacity W = 10 kg. There are n = 4 items with values [20, 30, 15, 25] and weights [2, 5, 3, 4] kg. The thief wants to maximize the value of items stolen without exceeding the knapsack capacity.
Dynamic Programming Approach:
- Define subproblem: DP[i][w] = maximum value that can be obtained using a subset of first i items with a knapsack of capacity w
- Recursive relation:
- If w < weight[i-1], item i cannot be included: DP[i][w] = DP[i-1][w]
- Otherwise, choose maximum of:
- Include item i: value[i-1] + DP[i-1][w-weight[i-1]]
- Exclude item i: DP[i-1][w]
- Base case: DP[0][w] = 0 for all w, DP[i][0] = 0 for all i
Implementation:
// Create DP table with n+1 rows and W+1 columns DP = new array[5][11] initialized with 0 // Fill DP table bottom-up for i from 1 to 4: for w from 1 to 10: if weight[i-1] <= w: DP[i][w] = max(value[i-1] + DP[i-1][w-weight[i-1]], DP[i-1][w]) else: DP[i][w] = DP[i-1][w] // Final answer is in DP[n][W] // DP[4][10] = 60
Solution: The maximum value is 60, achieved by taking items 1, 2, and 4 (values 20, 15, and 25) with weights 2, 3, and 4 kg, totaling 9 kg.
Reconstructing the Solution:
i = 4, w = 10 while i > 0 and w > 0: if DP[i][w] != DP[i-1][w]: // Item i was included print "Include item", i w = w - weight[i-1] i = i - 1
Applications of Dynamic Programming:
- Resource allocation problems
- Production planning and inventory management
- Equipment replacement scheduling
- Portfolio optimization
- Sequence alignment in bioinformatics
- Shortest path algorithms
- Optimal control theory
- String matching and text processing
- Speech recognition and natural language processing
11. Quiz & Practice Problems
Operations Research Quiz
Test your knowledge with this interactive quiz covering key OR concepts!
Quiz Results
© 2025 Operations Research Notes | Comprehensive Guide to Mathematical Decision Making