Thursday, May 25, 2023

Some perspective for students on these times and how to reflect about life in the classroom

Sometimes when we think about teaching, we imagine this very serious professor on a podium or a blackboard dictating a very technical lesson. The professor is the only one speaking. If this is a math professor, he or she will only talk about math. Now in this era of multiple distrations and instant gratification, we need to go the extra mile and make students reflect about where are they going in life and if their habits are helping towards achieving their dreams. I mentioned to them that I read books in the subwway or the bus and do some grading or prepare the lesson of the day. The I asked them if they could count how many people in the wagon are looking at their cellphone: texting, playing a game, looking at some social media platform (the picture of someone eating pasta), etc. They smiled at me because they knew this is common. I did not want to sound like a broken record or that mom who is giving unsolicited advise. However, I suggested for them to take advantage of those moments of solitude to read a book, journal or reflect about an idea. We do not need to be making videos to gain approval from other people. Do it if you like but be careful with what is motivation behind it. I remembered sending and assignement where they had to take a picture of a proof of a proposition in the subway or other place outside campus or a classroom...a place where it is not common to see people writing proofs. I got pictures of people working on stairways in the city, a laundroamat, at the subway station while waiting for a train, the beach and during a subway ride. I hope this connected them with their own thoughts. At least they did not look at their cellphone screen for a few minutes :) We need independent thinkers, not that person who is competing in social media to post better pictures or catchy phrases than his/her friends. Dare to be different, it does not matter how you look, what is your financial situation, your life circumstances. Many things in life are ephemeral but your essence as a human being and as an intellectual is unique and can persist through time.

Algorithms, big-O and number theory

It has been a while since last time I published in this blog. Today I posted final grades and started to reflect about what we learn during the semester. We talked about big-O. We did an example where we found that a fucntion was O(x^2) by finding an upper bound for the orginal function when c is greater of equal for some real number k. We showed some plots to illistrate this point. We then moved to talked about module m atithmetic, reminders, Euclidean algoritm, etc. I was surpised to see that students really liked this part of the course. I wish I would have spent more time on it. We gave simple examples of how to ecrypt messages. Also, we showed propositions related to the greated common divisor between two numbers and how to find it using the Euclidean algorithm. Perhaps students will never forget about this french mathematician, Bezout (I'll add the tilda later.) With Bezout's identity, they can find the Bezout's coefficients of them is the inverse of one of the numbers involved in the greatest common divisor. Finding the inverse help us solve equations involvinf arithmetic module m. So every time we needed to find an inverse modul m, I would ask: "Do you remember the french name we need?" It makes me so happy to say "Bezout, Bezout!!!" at loud.

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! 

Wednesday, March 29, 2023

More sets...math in our minds during the Spring break!

So today I was on the bus and the subway reflecting about the best review exercises for the exam I was supposed to give this coming Monday...right before the long Spring break. I noticed that we have just discussed the basics of sets. So today I decided that the exam will be on Wednesday after Spring break. 

I wanted to give students the opportunity to mature the different methods to prove a proposition, and also finish with the section of sets to then start such an important topic as functions. The student felt relieved after I made this announcement (I did not have big expectations since sometimes they don't want to study during breaks.) 

We had a simple class activity where two sets A and B were given (as well as a specific universal set U) and the questions consisted of finding intersections, complements, differences, etc. 

I was able to at least introduce functions and examples of a function mapping the set of students in a class to the set of final grades. They agreed that we can't assign two different grades to any particular student we choose. 

Well, this is taking the classic path: domain, range, one-to-one, onto, bijections, etc., etc. 

It brings so peace of mind to know that the class will have math preset during the Spring break. 


https://www.vecteezy.com/vector-art/16059920-easter-educational-quiz-for-kids-how-many-game-with-chicks-flowers-spring-holiday-theme-on-green-background-printable-math-activity-for-children-search-game

Monday, March 27, 2023

End of induction..."it's cold or hot, not lukewarm", sets and "The Fly in the Ceiling"

 Another Monday. Many of us were on campus before 7:30 am. The subway was not bad, I enjoyed my reading. 

Some students arrived with a cup of coffee in hand. 

We continued discussing mathematical induction. I asked them what they remember about proving by induction. Phrases such as basis step and inductive hypothesis were heard. 

We picked up on the example we left of proving the formula for the geometric series. Everyone got that P(0) was true. 

The step of using the inductive hypothesis P(k) to show P(k+1) was explained several times. We wrote the inductive step on a green box and what we needed to prove P(k+1) on a pick box (yes, with my colorful Japanese chacks.) I then stressed that if they really understand that they need to use the inductive hypothesis to show P(k+1), they pretty much got the concept.  I encouraged them vehemently to ask questions now, in the present. One student said that he was trying to understand how I used the formula of the inductive hypothesis on the sum involved in P(k+1).  I explained it, and he said "ok, so so".  I replied that "this step has to be hot or cold in terms of understanding, not lukewarm" This is something that you either understand or you don't. I believe this shocked them somehow, but in a good way. I also asked: "would be able to reproduce this proof in the future without memorizing it?". Once I got an affirmative answer from the class, I did not move on. 

I started introducing the basic definition of sets and then:

  • empty set
  • power set
  • size of a set or cardinality
  • finite and infinite sets
  • Venn diagrams
  • Cartesian products. Mentioned Rene Descartes (sorry for missing the accents), yes! Remember this book for children's book "The Fly on Ceiling"...it would be nice if I can get some copies for them!
  • Operation of sets (unions and intersections)
The class was 100% chalk board...no a single slide projected, such a pleasure!
Spring break is approaching (they have an exam right before the break) and I told them that I felt so sad they would be so many days without math. Should I send homework for Spring break? 

https://www.mathsthroughstories.org/the-flying-on-the-ceiling-reneacute-descartes.html


Swimming, Statistics, and the Normal Distribution

As we enter the final stretch of our accelerated summer statistics course, I find it hard to believe that there are only seven class mee...