Sunday 9 November 2014

Week 8 - Finally Solving a Problem

Second term test..

Was fun, as always. Not much new going on, but I finally got myself to do one of the problems out of the wiki, as we were supposed to do.

Solving Problems!

I chose the line segments problem: Suppose you have a grid made up of uniformly-spaced horizontal and vertical lines. On the grid you draw a square with corners that lie on some of your grid crossings: it may be a 1x1 square, a 2x2 square, or some other size. How many line (of various sizes) segments from the grid that begin and end on grid crossings are contained in the perimeter and interior your square? What is the answer, in general, for an mxm square?
To make sure we have a common understanding of the problem, I claim there are 18 line segments in a 2x2 square.

For this problem, I decided to split the answer into a sum of line segments along the perimeter and within the area, starting with the perimeter. (L is equal to a line segment of length 1, 2L of length 2, etc..)

So any side on the perimeter of the square is going to have m*L lines, since the square itself is m squares in length. Then there will be m-1*2L lines, combining the L lines together, then m-2*3L lines, until we get to 1*mL line. Working backwards, the sum is essentially 1 + 2 + 3 + ... m-2 + m-1 + m. This can also be represented as [m(m+1)]/2, as a partial sum. Since there are 4 sides to a square, the final result for the perimeter would be 2[m(m+1)].

Now for the area, the equation is obviously going to be similar as the segments would be divided the same way along the grid, though with an extra factor due to being 2D. Since we're already counting the perimeter in the sum, we're going to leave out that line from the equation, instead of using the length of the square, m, we'll use m-1. Then the equation for the area, in one direction, would be [m(m+1)(m-1)]/2. Since there's two directions, (2D shape), we can cancel out the 2 in the denominator: m(m+1)(m-1) for the area.

Then just to add it all together, the total segments = perimeter segments + area segments:
Total = 2[m(m+1)] + m(m+1)(m-1)
          = 2m^2 + 2m + m(m^2 - 1)
          = 2m^2 + 2m + m^3 - m
          = m^3 + 2m^2 + m

As a test, plugging in 2 for m gives: 8 + 8 + 2 = 18, which is exactly as the problem states, a 2x2 square has 18 line segments. Q.E.D and all that good stuff.

Sunday 2 November 2014

Week 7 - How Bad Can We Be?

What's the worst that could happen?

While we've still been discussing proving various proofs, we've brought in a little programming and a couple functions to give us a new set of problems.

The functions we've been looking at currently are basically just sorting functions, say you have a list of random numbers and you wish to sort them from least to greatest, find the single biggest number, or find which two adjacent numbers make the greatest sum. You will always have some case where your program/function takes the absolute longest time to complete. We've been concentrating on how to calculate how many steps a function can take, and creating formulas based on the length of the list that tell us the longest possible time/most possible steps the function can take before completing.

Damn well confusing at first, but since we're so lazy we can just overestimate (maybe extremely), it seems like a very simple concept with practice.

Monday 27 October 2014

Week 6 - Messing with Pennies

Still Proofs

Of course, logically, proofs are quite important for logic, so we're still doing them.

We did get another fun problem though, splitting 64 pennies evenly to get any number between 1 and 64. Now I can ensure my friends don't ask me for money because I'll waste way too much time doing it in the most convoluted way possible. 

Friday 17 October 2014

Week Missed-Last-Week

Whoops, midterms 'n' all..

So I'm sure everyone else has about seventy things all due around these times, so I managed to forget this assignment from all the other things cascading down upon my head, oh well..

Moving on

This week and the last has been basically concentrating on proofs, proving statements, and proving proofs, with some disproving and fun adventure along the way. Everything's getting longer and more convoluted and everyone is getting more and more lazy, so the course is definitely working its magic. I'm sure we'll all be the perfect compsci graduates with laziness pouring out of every pore in our bodies soon.

Friday 3 October 2014

Week 4 - Ambiguity

English is really awful..

I know that we technically only talked about ambiguity in the first few days of classes, but the more and more time I learn about the symbolic way to express statements, the more and more English becomes generally ambiguous. On the tutorial exercise, there was one question that could either be read as A and B implies C, or A or B implies C. While the rest of the questions were taken up in relatively short time, this question took maybe 20x longer than the rest, just because of how ambiguous the English statement was.

By this point, I'm predicting that I'll be trying to avoid using as many ambiguous terms as possible in normal conversation, just because of this course. I'm sure people will love talking to me.

Wednesday 24 September 2014

Week 3 - Implying Implications

Onto the second sLOG post..


This week has been rather similar to the last in that we've been learning more and more ways to mess with our implications such as negations or learning the different methods of showing one statement. While we haven't gone into much new material, adding more material onto what we already know is helping me understand how I can read and write the symbolic statements even better. I find that writing the symbolic statement in a sort of verbosy-mathematical way can make it especially easy to translate into the symbolic form.

This week's tutorial was pretty fun though, the difficulty of the exercises caused some discussion to actually arise due to disagreement over how a few statements should be written, if one implies the same implications the other implies. I enjoyed this week's tutorial exercises though, they were pretty fun, and it made the quiz exceptionally easy as well.

Personal stuff

Still not much to go here sadly, although I am enjoying the amount of fun mathematical symbols I can now use to confuse my friends in other, non-math, courses.

Wednesday 17 September 2014

Captain's SLOG - Week 2 (First Post!)

Introduction

Most people don't really know how to structure something new that they are forced to do for the first time, and I fall under a similar category. While I don't really know how this should be structured and worded for an absolute perfect 100%, I'll just state how most of these are going to go.
I'll start off first with the example questions shown on the outline for the SLOG's, questions like:
  • what's something new you learned this week in class?
  • what's something you enjoyed this week in class?
  • how confident do you feel about the material covered this week?
  • etc..
At the end of all that, I'll try to put some sort of personal thought or response as to anything within the week I found interesting/worth discussing. Should be simple enough.

Moving on..

I'm sure everyone knows the basics of logic and expression intuitively as they go through their education and their regular lives, but it was nice to learn how to express them in a mathematical formula, and how it can be shown through the venn diagrams.

While the first week was simple introduction, and this week seems like the basics of logical thinking and mathematical expression, it doesn't seem very difficult to me so far, and I feel quite confident in what we've been learning so far. I hope it gets a little more interesting and difficult in the future, and I look forward to it.

I also liked seeing the connection between this course and CSC108, since both are using Python examples. At first, I didn't completely understand the code examples shown, but after a few days in both classes, the examples are pretty much crystal clear.

Personal Response

There's not going to be much here considering it's only been one and a half weeks so far, but all I can say is that I am super happy that the course material can be very confusing and I understand it quite well, (I believe I do anyway.) I can't wait for this to continue into even more confusing depths.