Thursday 13 November 2014

Problem Solving Question

So it has been a while since my last post. I’m not going to lie, since school has picked up I find the slog constantly being pushed to the back of the line in terms of work priority. Hopefully I can continue to make more frequent posts.

For this post, I’ve decided to take a look at the sub-square problem from the problem-solving wiki:

Suppose you have a 3x3 grid. How many squares (1x1, 2x2, 3x3) are there whose corners correspond to grid intersections? Can you come up with a way of predicting how many sub-squares there are for an mxm grid, for an arbitrary choice of non-negative integer m?

Solution:
First, to try to find a distinct pattern, I found that it was beneficial to draw out each grid and see
how many sub-squares could fit on each square.

1x1 grid:     1 (1x1) sub-square

Total:          1


2x2 grid:     1 (2x2) sub-square
                    4 (1x1) sub-squares

Total:          5



3x3 grid:     1 (3x3) sub-square
                    4 (2x2) sub-squares
                    9 (1x1) sub-squares

Total:         14


4x4 grid:     1 (4x4) sub-square
                    4 (3x3) sub-squares
                    9 (2x2) sub-squares
                    16 (1x1) sub-squares

Total:          30


5x5 grid:
     1 (5x5) sub-square
                     4 (4x4) sub-squares
                     9 (3x3) sub-squares
                     16 (2x2) sub-squares
                     25 (1x1) sub-squares

Total:           55

From what you can see above, there seems to be a pattern developing. The formula can be expressed like this:

Total number of sub-squares in an (m x m) grid = m^2 + (m-1)^2 + (m-2)^2 + .... + (m-m)^2 

So now we can check if this formula works for a 6x6 grid. I drew out the square and figured out that it should result in a total sub-square number of 91.

Now we substitute 6 with m in the formula from above:

(6)^2 + (5)^2 + (4)^2 + (3)^2 + (2)^2 + (1)^2 + (0)^2
= 36 + 25 + 16 + 9 + 4 + 1 + 0
= 91.

This now confirms that the formula checks out.

Tuesday 14 October 2014

SLOG #4

Things have recently started to ramp up since the first assignment has been handed in. The mid-term test was written this past week and overall I think it went well. The past-tests provided were definitely beneficial in preparing for what to expect on our test.

This is the first mid-term where I've been allowed to bring in an aid-sheet to use during the test. At first I was a bit concerned since we were not given any guidelines on to what should be on the sheet, but rather to put whatever we wanted on it. I ended up going through every lab exercise set and quiz that we have done and rewrote the important questions and answers until I felt I had everything I needed on the sheet.

Although I didn't end up using about 70% of the information I squeezed onto that page, I found that being able to make one of these aid-sheets is a very productive way to review information. Even though I may not have used some of the examples I put on the sheet, I believe that going through all of them and making sure I understood what I was putting on the sheet greatly improved my understanding of many of the important topics we have covered. Hopefully the review and studying paid off.

Sunday 5 October 2014

SLOG #3

As the first assignment has been completed and handed in, no time is wasted in preparing for the upcoming mid term. The first assignment has proven to be challenging, engaging and thought provoking. I found that many different times I had to take a step back from the assignment and sleep on my thoughts. Although some concepts are fairly simple to understand, they might be harder to apply in certain situations. Overall I feel I did well on the assignment and am excited to see the results.

Once the assignment was handed in, there was no time to relax, it was time to focus on the upcoming term test. I'm hoping that the first assignment got my head in reasoning mode, but there is still a lot to review before Wednesday.

Friday 26 September 2014

SLOG #2

The third week of class continued to cover and explain several new topics, including conjunction, disjunction, converse, negation, vacuous truth, and a more topics regarding negation. I think the most difficult part about really understanding these concepts is ignoring the habits and thought processes you have developed from using the English language, and being able to think logically in terms of expressing thoughts using symbols. I notice this continually happens since the symbols have different connotations to them then their language counterparts. For example, when we use the word "or" in an sentence, it usually implies you either choose one option or the other, but not both. However, in symbolic representation, "V" implies that either or both options could be true or false depending on the situation.

The concept that made me think the most logically this week was the concept of negation. It is a bit unnatural to try applying negation on English sentences.  However, it helped to think of negation as a sentence used to verify a statement, making sure its negation was false. One of lecture slide used this sentence as an example, "All employees earning over 110,000 are female." This is a universal quantification, so its negation must have one counter example for the negated statement to be true. Therefore, its negated sentence will be "There exists a non-female employee earning over 110,000."

Friday 19 September 2014

SLOG #1

So far, with only two weeks in the books, I already feel that CSC165 will have a strong influence on majoring in computer science. Class started with basic concepts that instantly made me re-think how I approach problem solving.

In the many years of calculus and other math classes, more often than not, I find myself trying to memorize formulas and theorems rather than trying to truly understand them. I know the easy way out is usually to memorize, but I also know that it can be a very dangerous way of learning. I'm very excited to be able to learn and use new techniques to be able to tackle any problem that comes up.

When looking at computer science, or any technical field in general, I believe it is extremely important to be able to communicate your process and ideas in a clean and concise fashion. More often than not, trying to explain technical concepts and ideas to someone, like a family member, who is not in the same program as you can be a difficult task. Being able to think and express yourself in a simple yet precise way will pay off infinitely in the future. I am very excited to see how this course progresses and inevitably helps build and strengthen the foundation needed to think like, and become, a computer scientist.