How to find GCD of two numbers?

I am reading Scott Aaronson’s lecture notes on Great Ideas in Theoretical Computer Science to get inspiration and overview of the field. The notes encompass logic, math, computational complexity, cryptography, quantum computing and more. If we are given two numbers A and B, how do we find the greatest common divisor (GCD)? This is a … Continue reading How to find GCD of two numbers?

Introduction to Data Science: Assignment 1 (Twitter Sentiment Analysis in Python)

This is a fun assignment, as we get to deal with real data: twitter’s live stream, that is real-time tweets on twitter.com.This is done by accessing the twitter Application Programming Interface(API) using python. This assignment requires some python programming knowledge. Get Twitter live stream data First, we have to get the data from twitter to … Continue reading Introduction to Data Science: Assignment 1 (Twitter Sentiment Analysis in Python)

Introduction to Data Science (University of Washington): Introduction

Big data is the new trend in computer science, there is even a term for people who do big data – “data scientist”. To find out what is this big data, I am now taking Introduction to Data Science by University of Washington instructed by Bill Howe. Data science is a new field, and as … Continue reading Introduction to Data Science (University of Washington): Introduction

Stanford ML Week 2: Linear Regression with Multiple Variables

It’s been a tough week, I needed some time to comprehend the formulas and get used to it. I am not alone in this, surprisingly phd student also had a hard time with this course. Last week, we learnt how to find a best fit line for graph with one variable, this week, we find … Continue reading Stanford ML Week 2: Linear Regression with Multiple Variables

Stanford ML Week 1: Linear Regression with One Variable

This is the start of Stanford’s Machine Learning instructing by Andrew Ng. Andrew Ng is the director of Stanford AI lab and the cofounder of Coursera where I will be getting the course resources. Notes is not provided in Coursera version of the course, but it can be found at Stanford’s website. Introduction Machine learning grew out … Continue reading Stanford ML Week 1: Linear Regression with One Variable

CS50x Week 12: Final Project!

Finally, I have reached the end of CS50x, this week we did our final project. There are many projects on display here. The projects are divided into several categories. You can use any skills your learnt in CS50x to aid in making your final project. Students are also encouraged to buy a domain for their final project. … Continue reading CS50x Week 12: Final Project!

CS50x Week 10

Javascript – Allows interaction with user. E.g. onclick, add html via .html(“string”), change CSS, etc. JQuery – library based on Javascript. Use Google chrome’s console log to debug when programming, can check for variable value or play with Javascript. To recap, HTML gives structure, CSS gives style, PHP gives logic, Javascript + JQuery gives dynamic/ … Continue reading CS50x Week 10

6.00.1x Week 5 (Incomplete)

Efficiency How much time it takes for our program to run.

The function iterates elements in list L, if the element is equals to x, it returns true. This function continues to iterate until x is found, or if not found, returns false. There are two extreme cases here, if x happens to be … Continue reading 6.00.1x Week 5 (Incomplete)

CS50x Week 8: Mispellings (Problem Set)

This week’s problem set requires us to implement a spell-checker. The usage is speller [dictionary] text, where speller is our program, dictionary is optional, text is a file that contains the paragraphs that need to be spell-checked. If user does not specify a dictionary, a default dictionary will be used. The main body of the … Continue reading CS50x Week 8: Mispellings (Problem Set)

CS50x Week 8

Trees We learned trie last week, trie is a type of data structure called tree. Tree has a node at the top, called root, then it has 0 or more nodes, called children. If a node does not have any child, it is called leaf. Binary tree When each node of a tree has at … Continue reading CS50x Week 8