Tuesday, April 25, 2023

Sequences, series, Zeno's Paradox and Donald Duck

This week I am a little behind with my journaling. We had exam last week and this week we switched gears to discuss sequences and series. We started by stating that a sequence is a list of objects. It can be thought as the image of a map from natual numbers to a set S of objects. The set S can be made of numbers, characters, etc Some examples where discussed. Students figured out how to obtain the sequence from plugging in a general formula such as a(n)=1/n. We them moved to dicuss recurrence and did some examples with recurrent formulas and how to obtain the terms of the sequence using their previous values. Also obatined a general formular for the recurrence formulation examples. We then mentioned the famous Fibonacci sequence. Suddenly "Donald Duck in Mathmagic land" came to my mind and I juped to YouTotbe to search for an extract of the movie. I tried to look for the part where Donald plays with Fibonnacci numbers, but we ended up watching the part about the Pythagorians and how their mathematics "gave the basis of the music of today" Before moving to series, I stressed that we already discussed geometric series when we discussed mathematical induction. Anothe fun video came to my mind..the one from Ted Ed and the Zeno's Paradox This was provocative...Is the toatal time that Zeno takes to get to the tree finite or infinite? I asked: "Who thinks is infinite?" Just a few hands raised. They were amzazed...They made my day with their smiles when they saw that this was an example of a infinite series which reculting sum is a finite number (in this case, exactly 1.)

Friday, April 14, 2023

Cross Validation lecture for joint BYU-City Tech undergraduate data science seminar

 Today, I delivered a lecture on cross-validation and Bootstrap, which are resampling methods used to evaluate machine learning algorithms' test error. I based my lecture on a resampling chapter from Gareth James, Daniela Witten, Trevor Hastie, and Robert Tibshirani's book, "An Introduction to Statistical Learning: with Applications in R" (2013).

During the lecture, we first discussed the bias-variance trade-off and how the training error cannot accurately predict the testing error as the model's complexity increases. We then explored the performance of various ways of spltting the data, such as splitting the data into two equal parts and performing leave-one-out splitting.

Next, we discussed k-fold cross-validation, which involves splitting the data into K subsets of equal size, and iteratively selecting a validation set and training on the remaining folds K times. The cross-validation score is the weighted average of the mean squared error (MSE) for each fold. We demonstrated an experiment with 10-fold MSE and found that K=5 or 10 is a good compromise in terms of the variance-bias trade-off.

Finally, we discussed an example of two-class classification with 5000 predictors and 50 samples, where the wrong way to perform K-fold CV was to apply it after filter 1, while the right way was to apply CV on both filter 1 and filter 2. We stressed the importance of understanding the correlation between each K-fold split and the variance-bias trade-off in determining the optimal choice of K for the CV folds.

Overall, the lecture was well-received, and there were many interesting questions from colleagues and students. This is a topic that is frequently discussed in data science forums, and it is important to emphasize the importance of balancing the variance-bias trade-off and the impact of data splitting on the results of cross-validation.

Gareth James, Daniela Witten, Trevor Hastie, and Robert Tibshirani's book, "An Introduction to Statistical Learning: with Applications in R" (2013).




Thursday, April 6, 2023

Functions before Spring break!

 So here we are, a few days since our last class in the middle of Spring break. I announced that I was pushing the exam to the Wednesday after Spring break. I could perceive the joy after the news. 

This Monday 4/3, we continued talking about functions. We stressed key definitions related to functions such as: 

  • domain 
  • codomain 
  • range
  • image
  • preimage
  • one-to-one functions
  • onto functions
  • bijection 
  • inverse functions
I kept stopping to check if students were getting the basics. We worked on examples where a subset A of the domain was given and we needed to determine f(A). 

We also discussed that functions should come with the domain and codomain. I used lots of Venn diagrams to explain one-to-one and onto functions. Can we have a one-to-one function that is not onto and vice-versa?  Bijections were easy to grasp for students and we introduced the inverse of a function and why bijective functions are guaranteed to possess an inverse. 

Next class, we might review how to find the inverse of a function (provided it exists) and review for the exam. 

https://www.teacherspayteachers.com/Product/Spring-Break-Math-Practice-Packet-Common-Core-Aligned-622786



Wishing you a happy and mathematical Spring break! 

It has been a while: from Yoda to trigs

Our SIAM student chapter recently hosted an insightful talk by a mathematician from Brigham Young University. They delved into the mathemati...