home / blog

the waterloo advanced math experience

~ April 19, 2024

Intro

During my orientation week for university, I spent my time wandering the sea of equally excited and bewildered sea of first-time college students with one goal on my mind. I was to make at least one new friend who shared the same interests as me. And what better way to talk to new people on a university campus than the classic two-question introduction:

“Hi, what’s your name? … Nice to meet you too, what’s your major?”

And I was looking for someone who, like me, is majoring in mathematics or computer science. In which case I’d ask the third introductory question:

“What courses are you taking?”

Now, for context, the University of Waterloo (at least at my time of being here) offers two versions of each of the first and second-year general math courses. Some examples are:

  • Math 135: Algebra then Math 145: Algebra (Advanced Level),
  • Math 137: Calculus I then Math 147: Calculus I (Advanced Level),
  • and so on.

I enjoy suffering am always up for a little challenge, so I enrolled in the advanced levels for each of the first-term courses. These were the two listed above and CS 145, the advanced counterpart of CS 135. On top of these courses being invitational only, it takes some level of dedication to not take the easier, credit-equivalent course. Thus, an unforeseen consequence of my taking these courses is that it made it very hard for me to find others in my classes. So when I’d ask:

“What courses are you taking?”

I’d typically get responses like “No, I’m taking [math] 135” or “What’s a [math] 145?”. But one response I got that I found rather comedic was:

“I’d rather have free time.”

This quote encapsulates with an astonishing level of accuracy my experience having taken all advanced level courses for my first year of university. Let me explain.

The first term

I had always thought of my math abilities to be, at the very least, above mediocre. Having done the harder versions of both IB math AA and AP Calculus, I found myself fueled by my ego, sitting in a high chair. So when I was presented with the opportunity to take the advanced level math courses at Waterloo, I accepted without much thought.

In the first term, there are three such courses:

  • Math 145: Algebra,
  • Math 147: Calculus I, and
  • CS 145: Designing Functional Programs.

CS 145

I’ll start with CS 145, as I found that to be the least radical of the three. That is, it covered topics that deviated the least from what one would expect at a first-year university level. The first third of this course was spent covering the entirety of CS 135’s content. We learned how to write Racket, how to implement various types of recursion, and how to work with lists and binary trees in a functional language. Having some experience in programming prior to taking this course, I found the accelerated pace to be nothing more than refreshing. During this bit of the course, we spent more time outlining and implementing practical concepts. Once the professor demonstrated an example, we were expected to generalize it to other algorithms and scenarios. This is opposed to CS 135 where my friends were tracing through recursion step by step (by hand) and writing lines and lines of documentation for each function they wrote. For an example of this:

; task: write a function to return add the elements of a list
; in cs145:
; of course, being able to implement foldl is assumed
(define (sum-list lst)
  (foldl + 0 lst))

; in cs135:
; sum-list: Listof Nat -> Nat
(define (sum-list lst)
  (cond [(empty? lst) 0]
        [else (+ (first lst) (sum-list (rest lst)))]))

The rest of the course was spent going over a few models of computation and how they’d be implemented in Racket. Notably, we first talked about lambda calculus, a model made up of only functions and nothing else. That is, there are no numbers, no lists, no data structures of any type. You are only given functions that look like λx.b\lambda x.b using which you have to construct everything else. And that’s what we did, first defining what true and false would look like, then how linked lists would look like, and finally the pinnacle of it all… how to model recursion using the Y Combinator:

  • Y=λf.(λx.f(x  x))(λx.f(x  x))Y = \lambda f.(\lambda x.f(x \; x)) (\lambda x.f(x \; x)),
  • or in a normal substitution model, Y=λf.(λs.f(λx.(s  s)x))(λs.f(λx.(s  s)x))Y = λf. (λs. f (λx. (s \; s) x)) (λs. f (λx. (s \; s) x))

Certain assignments required us to implement certain (non-trivial) algorithms using only this model. Unsurprisingly, they took ridiculously long amounts of time, but I would still be willing to do them all over again.

The final bit of the course was about register machines. The professor formulated a custom machine language that could be interpreted in Racket, and we explored how real computers used similar instruction sets. We learned about using registers, storing and fetching from memory (RAM), and the fetch-store-execute cycle. We were once again tasked with implementing quite a complicated algorithm in this machine language, for which we were forced to teach ourselves about subroutines.

To finish it all off, the last week of the course was spent talking about the history of computing - of the various notable figures from the past who paved the path for what computing is today. The only bad part about the history portion was that it too was on the final exam.

Overall, this course was an awesome time and I would even go as far as to argue it is less work-intensive than CS 135 on average. Less time was spent on the technicalities of programming, and more time was spent on exploring a broader field of topics.

Math 145

Math 145 (Algebra) was both the most exhilarating but also the most exhausting of the three courses. In my humble opinion, the first lecture was the only sane moment of the entire term. No baby steps were taken, no hand-holding was done, and no writing out examples for every little concept. We were immediately plunged into the deep end and given a bitterly cold introduction to pure mathematics. This was not the numbers-based math that I became so accustomed to in high school… the only things we dealt with now were mathematical objects, and the theorems and proofs revolving around them. Because my way of thinking had not yet adjusted to this new paradigm, the first month of this class was absolute hell. I still remember the second problem on the first assignment taking me over thirty hours to finish because I had not learned to see real numbers (R\mathbb{R}) and rational numbers (Q\mathbb{Q}) as conceptually different.

While my friends in Math 135 were writing out truth tables for logical expressions (see below), we were introduced to the concept of rings and asked to prove why 1=1-1 = 1 when all elements of a ring are idempotent.

PP QQ PQP \land Q PQP \lor Q
T T T T
T F F T
F T F T
F F F F

As Math 135 began to introduce mathematical induction we were well on our way to deriving it using the well-ordering principle. While Math 135 introduced modular arithmetic by solving systems of linear equations under Z/nZ\mathbb{Z} / n\mathbb{Z}, we went on to prove Z/nZ\mathbb{Z} / n\mathbb{Z} is a field if and only if nn is prime, and that (p1)!1(modp)(p - 1)! \equiv -1 \pmod{p} (Wilson’s theorem) followed by field definitions.

This pattern of always being one concept and several supplementary topics ahead of Math 135 continued. At the start, I was completely overwhelmed. In what whacky, goofy, foolish world were we in that the very building blocks of numbers needed redefining? Everything I seemingly knew about math and was comfortable with was all of a sudden taken away from me, it was clear that I needed something to click in my brain for all of it to make sense.

I reluctantly dragged myself to lecture after lecture, half gaslighting myself into thinking this was what I wanted, half too lazy to figure out the process to drop a course. But I do suppose that perseverance pays off, and sometime before the midterm something finally did click in my brain, and it all started to make sense. Although I’m unable to pinpoint the exact change, I believe there are a few things that contribute to it:

  • Getting used to viewing math from an abstract point of view, accepting that there’s more than just numbers,
  • recognizing the patterns used in proofs (beyond just knowing the proof techniques) and being able to adapt them to my own solutions.

The grand finale of the course was proving that for every field F\mathbb{F}, there exists a field extension K\mathbb{K} for which F\mathbb{F} splits, and thereby the fundamental theorem of algebra. This is something that I could not even have dared touch with a ten-foot stick had I taken Math 135.

By the end of the course, I could not have been more glad that I had pushed myself through the initial misery. Not only did this course introduce me to some beautiful mathematical concepts that are typically seen in a 3rd or 4th year course, but most importantly it completely revamped the way I problem-solve and view math problems.

Math 147

Math 147 (Calculus 1) followed in a similar, albeit less emphasized manner as Math 145. My experience with this course at the start of the term was just as defeating to my morale. I found high school calculus to be rather easy, so I thought I was well-prepared for what was to come. Rather, there was not a single limit, derivative, or even Taylor series on the first assignment. Rather, we were given questions like “prove the AM-GM inequality.” I had only ever used the AM-GM inequality before, and barely understood how it worked, much less how to prove it.

The rest of this story follows similarly to that from Math 145, so I will not repeat it once more. But to list a few notable concepts that were covered in Math 147 but not Math 137:

Before coming into this course, I thought the applications of calculus were limited to physics or engineering, and maybe economics at most. But this course redefined for me what calculus meant in the eyes of a mathematician, and introduced me to the deep world of analysis.

The second term

Having finished my first term of advanced courses gave me the momentum to not quit just yet. This time around, I knew what to expect and was even looking forward to learning more. Like last term, there are three advanced courses again, each a successor to an aforementioned course:

  • Math 146: Linear Algebra 1,
  • Math 148: Calculus 2,
  • CS 146: Algorithm Design and Data Abstraction.

CS 146

The consensus from my classmates after finishing CS 135/145 was an agreed-upon distaste for the Racket programming language. So there was nothing but excitement when it was found out that the successor CS courses would be taught in C. Personally I quite enjoyed Racket and the whole functional paradigm.

To my delight (but everyone else’s dismay) it was announced in the very first lecture of CS 146 that this course, unlike CS 136, would not be leaving Racket in the dust. Although it was to come, C is not going to be the first new language we learn. Rather, Racket is no longer considered pure, so we would be learning Haskell to fulfill our need for a pure functional language. In my humble opinion, this was an excellent choice over C for the main types of data structures that this course would revolve around.

To put it plainly, this course is an interpreters and compilers course… with a generous serving of C on the side. We would be introduced to an astounding four new (conceived) programming languages for which we’d write interpreters, compilers, and assemblers. Some of them were functional, while others were imperative. For each one, our professor would explain the concepts using Haskell, and it was our job to implement them in Racket for the assignments. We learned about closures, how to interpret recursion, modeling side effects with monads, passing arguments to subroutines, and so much more.

But let’s not forget that we still needed to cover all the C content that is brought up in CS 136. So for this, we learned all the little niches of the C language, like memory management, pointers, abstract data types, etc.

And finally, following in the advanced course fashion we covered some supplementary content. Notably, we talked about proving the correctness of programs, continuations, and how C compilers don’t guarantee tail call optimizations plus how to compensate for that.

Math 146

This course is the first of two linear algebra courses. But what I’ve learned from this course completely deviates from what one would stereotypically think about when talking about linear algebra. I’ve learned that vectors can be 2-dimensional, 3-dimensional, infinite-dimensional, heck, even one-dimensional. That the real numbers can be a space over not just the real numbers, but also the rationals. As a bonus, every vector space having a basis is somehow connected to a real-life duplication glitch. Something I find particularly humorous is that we got a small introduction to functional analysis, as we talked about the set of all bounded sequences over C\mathbb{C} as a vector space… but never once talked about what a dot or cross product is.

But again, would I rather compute the determinant of a 5 by 5 matrix by hand as they were doing in Math 136? Definitely not. Coming out of Math 145 has taught me that I’d much rather learn theorems and proofs rather than do mindless number crunching. (After all, that’s what we have engineers for.)

Although the course was a little challenging at times, it did not hit me as hard as Math 145, possibly because I’ve become accustomed to the pressure. Otherwise, there is not much to say about this course.

Math 148

Multiple sources have stated that Math 148 is the worst of all the 14x courses. Having just finished this experience for myself, I can testify to that statement. While Math 138 is somewhat analogous to the latter half of AP Calculus, where you learn about integrals, series, convergence tests, and core concepts of calculus, Math 148 takes a different approach. You are expected to know how to work with integrals and series coming into this course. I recall my professor purposely skipping over volumes of revolution because it’s “too trivial and there exist better methods in multivariate calculus.”

For this reason, we sped through all of that content in less than a third of the course. Rather, this course is concerned with one key concept: uniform convergence. We learned about its definition, several methods for proving it, and then several results that follow from it.

During the course, I was almost always at a loss for what was going on. But right before the exam, everything came together, and it all made sense why this concept is so important to calculus. It makes you understand some of the things that I have previously taken for granted. For example, before coming into this course I have never questioned the validity of the following:

absin(x)dx=abn=0(1)nx2n+1(2n+1)!dx=n=0ab(1)nx2n+1(2n+1)!dx=[n=0(1)nx2n(2n)!]ab=[cos(x)]ab\int_a^b \sin(x) \, dx = \int_a^b \sum_{n=0}^\infty \frac{(-1)^{n} x^{2n+1}}{(2n + 1)!} \, dx = \sum_{n=0}^\infty \int_a^b \frac{(-1)^{n} x^{2n+1}}{(2n + 1)!} \, dx = [ -\sum_{n=0}^\infty \frac{(-1)^n x^{2n}}{(2n)!} ]_a^b = [ -\cos (x) ]_a^b

But now I know to not take the interchanging of the infinite sum and integral (second step) so lightly. This only works because sin(x)\sin(x) uniformly converges to its Taylor expansion over an interval [a,b]R[a, b] \subseteq \mathbb{R}.

In hindsight

So what is it that I have lost taking these advanced section courses? Friendships that could have been made by taking the mainstream courses? My sanity? What about free time?

It definitely felt that way during my first month of classes, stuck in the library for hours upon end bashing away at a single math problem. It was demoralizing to hear things like

“Hey I got another 100 on my 135 quiz… I studied about 10 minutes for this one.”

There has not been another occurrence in my life that has been a greater testament to my perseverance and obligation to personal morals than finishing two terms of all advanced courses. But with it out of the way, I have a new-found appreciation for the rigor that goes into pure mathematics, and motivation to continue down this pathway.

Others may ridicule the countless hours of “free time” I have lost by pursuing this, but in my eyes, doing something I love is never a waste of time.

~

*I say second because the first-place title would have to go to the other session of the same course, taught by a different professor. I suppose I was shown some mercy.