mat 4830 mathematical modeling
DESCRIPTION
MAT 4830 Mathematical Modeling. Section 1.3 Conditional Statements. http://myhome.spu.edu/lauw. Questions. What is the purpose of a conditional statement?. Questions. Describe a conditional statement in Maple. Preview. Review Poisson Distribution Introduces the conditional statements - PowerPoint PPT PresentationTRANSCRIPT
MAT 4830Mathematical Modeling
Section 1.3
Conditional Statements
http://myhome.spu.edu/lauw
Questions
What is the purpose of a conditional statement?
Questions
Describe a conditional statement in Maple.
Preview
Review Poisson Distribution Introduces the conditional statements Allow the flow of control to branch into
two or more sections of codes based on the truth values of a control expressions
Example 0
On average, random customers per hour come into a local Starbucks during the morning rush hours.
customers per hour
Example 0
What is the probability that exactly k customers come in within a time period of length T?
customers in a period of length k T
Idea: Approximate the scenario by a binomial model
Divide T into n subintervals with equal length. Each interval is small enough such that only at most one customer comes in within the subinterval.
0 T
Consider this as a binomial model.
(a customer walks in within a subinterval) ?p P
Idea: Approximate by a binomial model
r.v. X=no. of customers comes in within a
time period of length T
0 T
( ) (1 )
lim (1 )
k n k
k n k
n
nP X k p p
k
np p
k
Idea: Approximate by a binomial model
r.v. X=no. of customers comes in within a
time period of length T
0 T
( ) (1 )
lim (1 )
k n k
k n k
n
nP X k p p
k
np p
k
Theorem 1
( ) lim (1 )
!
k n k
n
k
T
nP X k p p
k
Te
k
Proof of Theorem 1
Poisson Distribution P(,T)
( , )
Prob. Density Fun. ( ) ( ) , 0,1,...!
Mean
Std. D.
k
T
X P T
Tf k P X k e k
kEX T
T
Expectation: You should be able to prove this without
looking at a reference.
Poisson Distribution
Model arrival process Approximate binomial dist. when n is
large
(1 ) Vs
!
k
k n k Tn Tp p e
k k
Team Homework
A newsboy sells newspapers outside Grand Central Station. He has on average 100 customers per day. He buys papers for 50 cents each, sells them for 75 cents each, but cannot return unsold papers for a refund. How many papers should he buy?
To maximize the expected profit
Zeng Section 1.3
Example 1 Consider the piecewise defined function
2 0( )
0
x xf x
x x
For each interval, we need a different formula to compute the function values
Example 1 Consider the piecewise defined function
2 0( )
0
x xf x
x x
For each interval, we need a different formula to compute the function values
Q: Input=? , Output=?
Example 1 Version 12 0
( )0
x xf x
x x
Example 1 Version 12 0
( )0
x xf x
x x
Structure of the if-block
Example 1 Version 22 0
( )0
x xf x
x x
Example 1 Version 2
> fun(-2);fun(2);42
2 0( )
0
x xf x
x x
Structure of the if-block
Example 2
We need 3 branches
2
2
2
1 2 if 0
( ) 2 1 if 0 2
5 if 2x
x x
f x x x
e x
Example 2
2
2
2
1 2 if 0
( ) 2 1 if 0 2
5 if 2x
x x
f x x x
e x
Example 2
> fun(-3);fun(1);fun(3);-143
5e(-1)
Structure of the if-block
Homework
Read 1.6 for formatting with printf See webpage