Programming Mathematics as an Advanced Math...

33
Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling [email protected] MAA Mathfest Portland, OR L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 1 / 16

Transcript of Programming Mathematics as an Advanced Math...

Page 1: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Programming Mathematics as anAdvanced Math Course

Lisa Oberbroeckling

[email protected]

MAA MathfestPortland, OR

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 1 / 16

Page 2: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Motivation

In 2002-2003, we realized our math/stat majors needed more:

programming experience

exposure to topics already seen

Examples: Numerical integration, Taylor polynomials

Also gave us the opportunity to expose students to additional topics.Examples: complex numbers, Fractals

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 2 / 16

Page 3: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Motivation

In 2002-2003, we realized our math/stat majors needed more:

programming experience

exposure to topics already seen

Examples: Numerical integration, Taylor polynomials

Also gave us the opportunity to expose students to additional topics.Examples: complex numbers, Fractals

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 2 / 16

Page 4: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Motivation

In 2002-2003, we realized our math/stat majors needed more:

programming experience

exposure to topics already seen

Examples: Numerical integration, Taylor polynomials

Also gave us the opportunity to expose students to additional topics.Examples: complex numbers, Fractals

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 2 / 16

Page 5: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Motivation

In 2002-2003, we realized our math/stat majors needed more:

programming experience

exposure to topics already seenExamples: Numerical integration, Taylor polynomials

Also gave us the opportunity to expose students to additional topics.Examples: complex numbers, Fractals

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 2 / 16

Page 6: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Motivation

In 2002-2003, we realized our math/stat majors needed more:

programming experience

exposure to topics already seenExamples: Numerical integration, Taylor polynomials

Also gave us the opportunity to expose students to additional topics.

Examples: complex numbers, Fractals

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 2 / 16

Page 7: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Motivation

In 2002-2003, we realized our math/stat majors needed more:

programming experience

exposure to topics already seenExamples: Numerical integration, Taylor polynomials

Also gave us the opportunity to expose students to additional topics.Examples: complex numbers, Fractals

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 2 / 16

Page 8: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Design

Started in 2004 as a 1 credit course

In 2011 became 3 credits (50 minute classes in computer lab).

Required of all math majors, elective for statistics majors

Ideally taken as one of their first upper levels (before analysis)

Is a pre-req for Numerical Analysis courses

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 3 / 16

Page 9: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Design

Started in 2004 as a 1 credit course

In 2011 became 3 credits (50 minute classes in computer lab).

Required of all math majors, elective for statistics majors

Ideally taken as one of their first upper levels (before analysis)

Is a pre-req for Numerical Analysis courses

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 3 / 16

Page 10: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Design

Started in 2004 as a 1 credit course

In 2011 became 3 credits (50 minute classes in computer lab).

Required of all math majors, elective for statistics majors

Ideally taken as one of their first upper levels (before analysis)

Is a pre-req for Numerical Analysis courses

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 3 / 16

Page 11: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Design

Started in 2004 as a 1 credit course

In 2011 became 3 credits (50 minute classes in computer lab).

Required of all math majors, elective for statistics majors

Ideally taken as one of their first upper levels (before analysis)

Is a pre-req for Numerical Analysis courses

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 3 / 16

Page 12: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Design

Started in 2004 as a 1 credit course

In 2011 became 3 credits (50 minute classes in computer lab).

Required of all math majors, elective for statistics majors

Ideally taken as one of their first upper levels (before analysis)

Is a pre-req for Numerical Analysis courses

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 3 / 16

Page 13: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Design

MATLAB

M,W: discuss mathematics and/or MATLAB syntax

F: lab day and/or quiz day

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 4 / 16

Page 14: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Design

MATLAB

M,W: discuss mathematics and/or MATLAB syntax

F: lab day and/or quiz day

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 4 / 16

Page 15: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Design

MATLAB

M,W: discuss mathematics and/or MATLAB syntax

F: lab day and/or quiz day

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 4 / 16

Page 16: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Syllabus

Prerequisite: Intro to CS course

Co-requisite: Intro. to Linear Algebra

Quizzes (about every two weeks) 30%Assignments (about 10 total) 40%

Final Project 30%

Final project: program(s), written report, and short presentation

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 5 / 16

Page 17: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Syllabus

Prerequisite: Intro to CS course

Co-requisite: Intro. to Linear Algebra

Quizzes (about every two weeks) 30%Assignments (about 10 total) 40%

Final Project 30%

Final project: program(s), written report, and short presentation

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 5 / 16

Page 18: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Course Syllabus

Prerequisite: Intro to CS course

Co-requisite: Intro. to Linear Algebra

Quizzes (about every two weeks) 30%Assignments (about 10 total) 40%

Final Project 30%

Final project: program(s), written report, and short presentation

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 5 / 16

Page 19: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Linear and Affine Transformations

−3 −2 −1 0 1 2 3−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5Rotation Example

−6 −4 −2 0 2 4−5

0

5

−6 −4 −2 0 2 4−5

0

5

−6 −4 −2 0 2 4−5

0

5

−6 −4 −2 0 2 4−5

0

5

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 6 / 16

Page 20: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Fern Fractals and Code Improvement

Fern 1 with n=5000 iterations

took 2.389344 seconds

Fern 2 with n=5000 iterations

took 0.899850 seconds

Fern 3 with n=5000 iterations

took 0.022540 seconds

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 7 / 16

Page 21: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Complex Numbers and the Chaos Game

Chaos Game for n = 30000. Time = 0.162389.

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 8 / 16

Page 22: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Fractal

n = 0, 0.003208 s n = 1, 0.003566 s n = 2, 0.003675 s

n = 3, 0.003483 s n = 4, 0.004863 s n = 5, 0.011567 s

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 9 / 16

Page 23: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Gram-Schmidt Method

−100 −50 0 50 100−100

−50

0

50

100

−100 −50 0 50 100−100

−50

0

50

100

−1 −0.5 0 0.5 1−1

−0.5

0

0.5

1

−1 −0.5 0 0.5 1−1

−0.5

0

0.5

1

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 10 / 16

Page 24: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Gram-Schmidt Method

−100

0

100

−100

0

100

−100

0

100

−100

0

100

−100

0

100

−100

0

100

−1

0

1

−1

0

1

−1

0

1

−1

0

1

−1

0

1

−1

0

1

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 11 / 16

Page 25: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Final Projects

Students can choose from a list:

Ciphers (substitution and columnar transposition)Game of PigVolumes of revolution demoLinearization and Newton’s Method

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 12 / 16

Page 26: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Final Projects

Students can choose from a list:

Ciphers (substitution and columnar transposition)Game of PigVolumes of revolution demoLinearization and Newton’s Method

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 12 / 16

Page 27: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Final Projects

Or come up with their own:

Game simulationsblackjackLCRbaseballhangmanSudoku

RSA EncryptionImage reading and distortionSorting algorithmsPractice game of Set

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 13 / 16

Page 28: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

General Feedback

More interest from employers (internships and job offers)

REUs and summer researchMore programming in other coursesBetter appreciation/understanding of the mathematics

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 14 / 16

Page 29: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

General Feedback

More interest from employers (internships and job offers)REUs and summer research

More programming in other coursesBetter appreciation/understanding of the mathematics

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 14 / 16

Page 30: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

General Feedback

More interest from employers (internships and job offers)REUs and summer researchMore programming in other courses

Better appreciation/understanding of the mathematics

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 14 / 16

Page 31: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

General Feedback

More interest from employers (internships and job offers)REUs and summer researchMore programming in other coursesBetter appreciation/understanding of the mathematics

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 14 / 16

Page 32: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Student Feedback

“Allowed us to use creativity”

“Skills can be used in the future”

“We completed a variety of projects which were relevant to the mathknowledge I have”

“The graphs (especially for Riemann sums, fractals) actually furtheredmy understanding b/c I was able to visualize the concepts”

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 15 / 16

Page 33: Programming Mathematics as an Advanced Math Coursemath.loyola.edu/~loberbro/matlab/Mathfest2014.pdf · Programming Mathematics as an Advanced Math Course Lisa Oberbroeckling loberbro@loyola.edu

Thank you!

Lisa Oberbroeckling

[email protected]

math.loyola.edu/∼loberbro

L. Oberbroeckling (Loyola U MD) MATLAB Course Mathfest, 09 Aug 2014 16 / 16