Presentation is loading. Please wait.

Presentation is loading. Please wait.

MAT 4830 Mathematical Modeling Section 1.3 Conditional Statements

Similar presentations


Presentation on theme: "MAT 4830 Mathematical Modeling Section 1.3 Conditional Statements"— Presentation transcript:

1 MAT 4830 Mathematical Modeling Section 1.3 Conditional Statements http://myhome.spu.edu/lauw

2 Questions What is the purpose of a conditional statement?

3 Questions Describe a conditional statement in Maple.

4 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

5 Example 0 On average, random customers per hour come into a local Starbucks during the morning rush hours.

6 Example 0

7 Idea: Approximate the scenario by a binomial model

8 Idea: Approximate by a binomial model

9

10 Theorem 1

11 Why? Calculus Formula:

12 Why?

13 Team HW#1

14 Team Homework #1 Use the definition of expected value and the Taylor expansion Do not use the moment generating function.

15 Poisson Distribution

16 Team Homework #2 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

17 Zeng Section 1.3

18 Example 1 Consider the piecewise defined function For each interval, we need a different formula to compute the function values

19 Example 1 Consider the piecewise defined function For each interval, we need a different formula to compute the function values Q: Input=?, Output=?

20 Example 1 Version 1

21 > fun(-2);fun(2); 4 2

22 Structure of the if-block Statements executed only if the condition is met. Otherwise, the statements will be skipped:

23 Example 1 Version 2

24 > fun(-2);fun(2); 4 2

25 Structure of the if-block There are two cases separated by one condition : the condition is met or else:

26 Example 2 We need 3 branches

27 Example 2

28 > fun(-3);fun(1);fun(3); -14 3 5e (-1)

29 Structure of the if-block

30 Homework Read 1.6 for formatting with printf See webpage


Download ppt "MAT 4830 Mathematical Modeling Section 1.3 Conditional Statements"

Similar presentations


Ads by Google