Governor’s School for the Sciences Mathematics Day 2.
-
Upload
eleanor-shelton -
Category
Documents
-
view
212 -
download
0
Transcript of Governor’s School for the Sciences Mathematics Day 2.
![Page 1: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/1.jpg)
Governor’s School for the Sciences
MathematicsDay 2
![Page 2: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/2.jpg)
“The more things stay, the more they change the sane.”
-khaosworks
![Page 3: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/3.jpg)
MOTD: Joseph Fourier
• 1768-1830 (French)• Partial Differential
Equation for Heat Conduction
• Solution by Infinite Trigonometric Series (Fourier Series)
• “Mathematics compares the most diverse phenomena and discovers the secret analogies that unite them.”
![Page 4: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/4.jpg)
Where are you from?
Give us the Good, the Bad or the Ugly!
Tnmap.gif
![Page 5: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/5.jpg)
Periodic PatternsWhat comes next?
Sound Signal
Stock Price History
![Page 6: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/6.jpg)
AsideWhen we have real data we may not want to predict the pattern exactly. (Why? Noisy or too much data)Instead we may wish to find an approximation to the pattern: A(n) = f(n) + e(n)Where |e(n) | is ‘small’ and ‘random’Finding f is slightly different but the tools we are using still work.
![Page 7: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/7.jpg)
Trignometric Polynomial Interpolation
• Recall: Polynomial of degree n p(x) = a0 + a1x + a2x2 + … + anxn
• Trig poly of degree n t(x) = a0 + a1 cos(x) + a2 cos(2x) + … + an cos(nx) + b1 sin(x) + b2 sin(2x) + … + bn sin(nx)
• Finding t means finding a0, a1, a2, …, an , b1, b2, …, bn
• The process of changing from the data to the coefficients is called the Fourier Transform
• Computed using: Fast Fourier Transform (FFT)
![Page 8: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/8.jpg)
Example: 0.1sin(x)-0.3cos(x)+0.4sin(2x)+0.2cos(2x)
![Page 9: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/9.jpg)
Why Trig Polynomial?
• Euler’s formula: eicos() + i sin() (Cool: 1 + ei0)• (ei)n = cos(n) + i sin(n)
• Rewrite t(x) = c-n-n + … + c-1 + c0 + c1 + c22 + … + cnn, where = eix
• Coefficients ck are complex but t is real!
![Page 10: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/10.jpg)
How To Find t
• Always modify the x-range so it covers from 0 to 2for unique part of sequence
• M points in unique part -> spacing of 2/M• Vandermode approach using ‘nice’ values
for x (/6, /4, /3, /2, , …)• Clever work can find each coefficient
directly! (idea of FFT)• For large data sets, use a program
![Page 11: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/11.jpg)
Time for Boardwork!
Consider this sequence:
1, 2, 0, 2, 1, 2, 0, 2, 1, 2, …
![Page 12: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/12.jpg)
Solution
Consider this sequence:
1, 2, 0, 2, 1, 2, 0, 2, 1, 2, …
T(n) = 5/4 + 1/2 cos(n/2) – 3/4 cos(n)
![Page 13: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/13.jpg)
Your turn …
Find the trig polynomial for these sequences:
2, 3, 2, 3, 2, 3, 2, …
-1, 0, 4, 3, -1, 0, 4, 3, -1,…
![Page 14: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/14.jpg)
Your turn …
Find the trig polynomial for these sequences:
2, 3, 2, 3, 2, 3, 2, … t(n) = 5/2 – 1/2 cos(n) -1, 0, 4, 3, -1, 0, 4, 3, -1,…
t(n) = 3/2 – 5/2 cos(n/2) – 3/2 sin(n/2)
![Page 15: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/15.jpg)
Break Time
![Page 16: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/16.jpg)
Programming in MATLAB
• Put the commands you want to use together in a file, save the file and then call it from the command window.
• Two types: Scripts and Functions• Called ‘M-Files’ as file name is
something.m• Run it by typing: something
![Page 17: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/17.jpg)
First Script
• Up/Down Pattern A(n+1) = A(n)/2 if A(n) is even 3A(n)+1 if A(n) is odd
• Example: 5, 16, 8, 4, 2, 1, 4, 2, 1, …
• Does it always get to …, 4, 2, 1, …?• How long does it take to get to 1?
![Page 18: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/18.jpg)
MATLAB Script: updown.m
x(1) = input(‘Enter initial value:’);k = 1;while (x(k) ~= 1) if (mod(x(k),2) == 0) x(k+1) = x(k)/2; else x(k+1) = 3*x(k)+1; end k = k + 1;end
![Page 19: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/19.jpg)
MATLAB Function: updownf.m
function x = updownf(a)x(1) = a;k = 1;while (x(k) ~= 1) if (mod(x(k),2) == 0) x(k+1) = x(k)/2; else x(k+1) = 3*x(k)+1; end k = k + 1;end
![Page 20: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/20.jpg)
Modifications
• Display the results (use disp(x) )• Plot the results (use plot(x,’o’))• Save the results (use diary updown)• Stop at 500 terms (if never reach 1)• Look for a repeated value• Compute statistics
![Page 21: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/21.jpg)
MATLAB Demo
![Page 22: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/22.jpg)
Field Trip
• Pickup behind Reese at 9:45AM• Hike/Lunch/Stream Play• Back by 5:00PM
![Page 23: Governor’s School for the Sciences Mathematics Day 2.](https://reader035.fdocuments.us/reader035/viewer/2022070401/56649f1b5503460f94c30b0b/html5/thumbnails/23.jpg)
TeamsTeam 2• Austin Chu• Michelle Sarwar• Jennifer Soun• Matthew Zimmerman
Team 1• Sam Barrett• Clay Francis• Michael Hammond• Angela Wilcox
Team 3• Charlie Fu• Scott McKinney• Steve White• Lena Zurkiya
Team 4• Stuart Elston• Chris Goodson• Meara Knowles• Charlie Wright