1 / 28

MAT 4830 Mathematical Modeling

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

Download Presentation

MAT 4830 Mathematical Modeling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MAT 4830Mathematical 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 What is the probability that exactly k customers come in within a time period of length T?

  7. 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.

  8. Idea: Approximate by a binomial model r.v. X=no. of customers comes in within a time period of length T

  9. Idea: Approximate by a binomial model r.v. X=no. of customers comes in within a time period of length T

  10. Theorem 1

  11. Proof of Theorem 1

  12. Poisson Distribution P(,T) Expectation: You should be able to prove this without looking at a reference.

  13. Poisson Distribution • Model arrival process • Approximate binomial dist. when n is large

  14. 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

  15. Zeng Section 1.3

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

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

  18. Example 1 Version 1

  19. Example 1 Version 1

  20. Structure of the if-block

  21. Example 1 Version 2

  22. Example 1 Version 2 > fun(-2);fun(2); 4 2

  23. Structure of the if-block

  24. Example 2 • We need 3 branches

  25. Example 2

  26. Example 2 > fun(-3);fun(1);fun(3); -14 3 5e(-1)

  27. Structure of the if-block

  28. Homework • Read 1.6 for formatting with printf • See webpage

More Related