Monday, 16 November 2020

CS50 Week 3 (16/11/2020)

The mid-semester break has started. It's a bit earlier than normal. Normally there will be 7 weeks of lectures before we get a mid-semester break, but for this semester, due to the COVID-19 that still has not subsided, and also probably in conjunction with Deepavali, our mid-semester break happens after the first 5 weeks of lectures.

I was busy with my Financial Econometrics assignment 4. It was on Cointegration and Toda-Yamamoto causality test. Choosing the appropriate model was hard for me because I was not sure when a model is considered free from autocorrelation. But since Prof said that marks will be given based on efforts and not on precision, I guess it won't hurt too much if I got the model specification wrong (add extra lags, or in short of a few lags). I think the most important thing is to clearly present that you understand what you run on E-Views and then you can express it well in algebra.

I did my Financial Econometrics assignment until Saturday, so I only began doing CS50 Week 3 on Sunday. I also began doing the problem sets on the same day. For Problem Set 3, it was the most challenging Problem Set so far, mainly because both the questions that I needed to complete and submit were new to me. They were nothing like the ones that I did in 2018. Well... the concepts are the same, but the questions are different :P I guess, since essentially, I'm still learning what I've learned before. If I'm not mistaken too, the next topic will be the most challenging one, on Pointers, I think haha~ maybe yes, maybe not. Whatever it is, I'm gonna prepare both my mind and body to endure the difficulties that are to come next.

Screenshot for Question 1 (Plurality) - the wrong code I've written

For Plurality (and also for Runoff), I didn't use any physical writing on a paper (or a tablet) and I did all by mental calculations and logics. I guess I didn't need it since I can just imagine what happens in the programme in my head. Everytime I wrote down a section of the codes, I go through the codes again, and think deeply about what things I may miss out, or what exactly happens to the arrays of variables that I have. I'd find bugs when I think like this, just like the one found above. If you look at the terminal (on the bottom of the screenshot), I purposely input in a way that everyone (Liyana, Syahirah, Amal and Nabila) would have similar votes, so if the programme codes are correct, everyone's name should be printed out. But only the first and the final person's names are printed, showing that there's something wrong with my codes. So I had to work on the codes again, until I get them right.

Screenshot for Question 2 (Runoff) - the wrong code I've written

For Runoff, I faced sooooo many problems. I think almost all of the sections that I worked on didn't work the first time I computed the codes. They just seemed wrong. But after re-thinking of new algorithms over and over, alhamdulillah, I finally finished this question too, completing my submission for Problem Set 3.

Problem Set 3 Complete!


Okay, I'm gonna take a break from CS50 while I work on my Master's Research Proposal. I've been making slow progress on it. Still haven't finished the Literature Review. May I make substantial progress on my Research Proposal over this mid-semester break! Ameen~

No comments:

Post a Comment