profile photo

Aromia

Pre-college Life at CMU

Publish data: 08 / 09 / 2024
Last update: 08 / 09 / 2024

Course Thoughts

15-122 Principles of Imperative Computation

A brief introduction to those who didn’t take this course: C0 and C1 lang, languages developed at CMU for education purposes. Contracts are the top language feature, which was used in this course to prove the safety and correctness of the code. Safety proof and correctness proof are the most painful part of this course, and also the part you will probably lose points on during tests. The difference between C0 and C1 is that void pointers can be used in C1 so we can write generic functions. Actually, this is my first time using generic pointers, instead of generic types.

So far these have covered half of the content. The next part is transitioning to the C Programming Language and data structures. In fact, starting from C1, we have been implementing generic hash map dictionaries and doing amortize analysis on unbounded arrays (vectors in cpp). Binary search and AVL trees, undirected graphs, and binary heaps are the easiest parts in this course imo. Perhaps it is becuz of reading the Competitive Programmer’s Handbook.

To sum up, we learnt:

  • C0 and C1
  • sorting and searching algos
  • unbounded array
  • hash dict
  • void * (generic pointers)
  • BST & AVL tree
  • type casting in C
  • graph and binary heaps

This course is quite hardcore tbh. We had 12 written for 10 pages each and 10 programming homework. A typical coding assignment takes 2 hours to finish and 4 more hours to debug. Everyone should have the same fear to debug your code, especially when you firmly believe that you coded it right… That being said, if you are not familiar with ssh, unix system, vscode, vim, coding styles, gdb (optional, for debugging in the C part), and some other well-known programming concepts, you may have a hard time catching up with the assignments and labs, and it might be much harder to get a good score in this course.

But it was a great chance for me to explore C, such a low-level system programming language. I realized how much syntactic sugar other high-level programming languages have provided to us, and in comparison to Cpp, C is even lower leveled. Manually memory management, null pointer dereferences, void pointer castings, integer type convertings, self-implemented data structures… All the ‘guns’ that you may fire and shoot on your feet.

12-127 Concepts of Mathematics

This course taught some basic concepts in pure mathematics, which are the fundamental components that build the entire world of math. You will learn how to prove many EXTREMELY intuitive propositions (like 1 + 1 equals 2, and set A union set B equals set A union set B without set A) using basic components of math in this course.

To sum up, we learnt:

  • proving methods
  • propositions and logical operators
  • logical formulae and quantifiers
  • naive set theory
  • functions, injectivity, surjectivity
  • construction of ℕ
  • finite and infinite sets
  • vectors and Cauchy-Schwarz inequality

The textbook (An Infinite Descent into Pure Mathematics) is really well-written. Reading it and solving practice problems were the most helpful things for understanding the concepts and preparing for the exams. (Else to add on, I found two bugs in the textbook and reported them to the author :3)

If you find this course hard, it’s pretty normal. Just calm down, read the definitions, and try to build connections between them. Actually, sitting there reading the textbook helped me pass the first midterm.

But there are also things I am confused about: homework should be a place where you can explore different solutions and make mistakes. However, this semester, there were only 6 hw each consisting of 4 problems, and they count as 25% of our GPA. What this means is that to get an A, you nearly have to get ALL OF THEM CORRECT.

Add on

I got A’s on both courses!!! I thought I was gonna fail on concepts!

gpa

Diary

Click me to expand

Day -1

Day 00

Day 01

Day 02

Day 03

Day 04

Day 05

Day 06

Day 07

Day 08

Day 09

Day 10

Day 11

Day 12

Day 13

Day 14

Day 15

Day 16

Day 17

Day 18

Day 19

Day 20

Day 21

Day 22

Day 23

Day 24

Day 25

Day 26

Day 27

Day 28

Day 29

Day 30

Day 31

Day 32

Day 33

Day 34

Day 35

Day 36

Day 37

Day 38

Day 39

Day 40

Day 41

Epilogue

Thanks to all professors, teaching assistants, residential assistants, and faculties. It was you who made this pre-college program experience pleasant and wonderful! How awfully I wish I could participate in the program and sit on the lower level of GHC debugging my code in the cafe once again!

© Copyright 2024 Aromia.
All right reserved.