Presentation is loading. Please wait.

Presentation is loading. Please wait.

MAT 4830 Mathematical Modeling Section 1.4 Conditional Statements

Similar presentations


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

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

2 Preview Review Binomial Distribution Introduce the first type of repetition statements – the for loop Allow a specific section of code to be executed a number of times Introduces simple arrays

3 Example 0

4

5

6

7

8

9 Binomial Distribution B(n,p)

10

11 Team HW #1

12 Team Homework #1 Use the definition of expected value and the binomial theorem Do not use the moment generating function. You may need to recall how to shift indices in a summation (see the hidden slides below for review).

13 Index Shifting Sigma representation of a summation is not unique

14 Index Shifting Sigma representation of a summation is not unique

15 Index Shifting Sigma representation of a summation is not unique

16 Index Shifting Sigma representation of a summation is not unique

17 Index Shifting Rules

18 decrease the index by 1 increase the i in the summation by 1

19 Index Shifting Rules increase the index by 1 decrease the i in the summation by 1

20 Example

21 Team Homework #2 A campaign staff knows from experience that only one in every three volunteers called will actually show up to distribute leaflets.

22 Team Homework #2 How many phone calls must be made to guarantee at least 20 workers with a confidence of 90%?

23 Team Homework #2 How many phone calls must be made to guarantee at least 20 workers with a confidence of 90%? Minimum

24 Team Homework #2 Use a binomial model to solve the problem. You need to write a Maple program to help you solve the problem. You need to explain your methodologies, arguments, and conclusions carefully. Extra works are welcome – In the past, students had done more than they were asked to get bonus points.

25 Zeng Section 1.4 Introduce the first type of repetition statements – the for loop Allow a specific section of code to be executed/repeated a number of times Introduces simple arrays

26 Zeng Section 1.4 Please listen to the explanations before you type in the program. It takes one minute to explain.

27 Example 1 Print the square of the first 10 positive integers What is the task being repeated?

28 Example 1

29 1210 14100

30 Example 1 > sq(); 1 4 9

31 Structure of the for loop

32 The loop_index increase by the default step size 1 everytime the execution of block of statements to be repeated is finished. Different step size can be used by adding “ by stepsize ” feature.

33 Example 2 Print the square of the first 10 positive odd integers

34 Example 2

35 > sq2(); 1 9 25

36 Example 3

37

38

39

40 > sq3(2); 1, 4 > sq3(5); 1, 4, 9, 16, 25

41 Example 4 Fibonacci sequence is defined by

42 Example 4

43 Why there is no print statement?

44 Example 4

45 Example 5

46 This is to demonstrate the basic form of “accumulation”.

47 Example 5

48

49

50 Homework See course webpage Read 1.3 All HW due next Monday Attempt your HW ASAP Individual HW**


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

Similar presentations


Ads by Google