Tuesday 4 December 2012

Circle Problem

Hey everyone!

As the semester is almost over, I have finally found an interesting problem to share with you.

The question goes as follows:

Place 10 points equidistant from each other along the circumference of a circle. Color 5 points red and 5 points blue in such a way that it is not possible to find two triangles, one with blue vertices and one with red vertices, that are identical (they can perfectly overlap each other).

As it turns out, this is actually not possible – you can always find two triangles, one with blue vertices and one with red vertices, that will perfectly overlap each other.

The great thing about this problem is that it extends into other more interesting problems. For example, we could try varying the amount of points we take (like 12, or 20). We could also change the shape (instead of a triangles, we could pick a quadrilateral).

Let’s change the above problem to its most general case: Place 2N (N > 0) points equidistant from each other along the circumference of a circle. Color N of the points blue and N of the points red. Can this be done in a way such that no two K-sided identical polygons (one with red vertices and one with blue) can be found?

The answer: if N is large enough, this is impossible (you can always find two identical K-sided polygons).

Proof:

When I first started thinking about this problem, it seemed intuitive to try to prove it by contradiction. Here is one approach:

Let’s consider a circle with 2N equidistant points along its circumference. We will assume that we have found a way to color N of the points red and N of the points blue in such a way that there are no two K-sided polygons (one red and one blue) that are identical. Let’s now imagine that while the blue points remain in their position, the red points will start moving clock-wise around the circle in equal steps. The steps are chosen in such a way that the points will end up in their original position after 2N steps (one step is equal to the distance between two points).

Obviously, as the red points move they will at times overlap the blue points. Upon the completion of the 2N steps, it is clear that each of the red point must have overlapped all of the N blue points one by one. How many of such overlaps happen? Well, exactly N2 since each of the red points overlaps each of the N blue points.

Now, at each step, there will be some red points overlapping blue points. This is not a fixed number as sometimes there could be more overlaps and sometimes there may be none.

However, if at a certain step at least K points overlap, it means that we have actually found two K-sided polygons (one red and one blue) that are identical. Since we have assumed that this cannot happen, this means that at any step there cannot be more than K-1 overlaps. Since there are 2N steps, this means that the number of overlaps should be less than or equal to 2N(k – 1). In fact, because at the last step the red points return to their original position (i.e. no overlaps), the total number should be no greater than (2N-1)(K-1)

Since we know that the actual number of overlaps is N2 this means:

N2 £  (2N-1)(K-1)                                               (1)

The above inequality does not stand if N is big enough. For example if N = 2K then

N2 = 4K2 > (4K - 1)(K - 1) = 4K2 – 5K + 1

Note: 4K2 > 4K2 – 5K + 1 Þ 5K > 1 (always true when K > 0 and since we are considering polygons, K will never be 0)

This proves that given a big enough N, we are always going to find two K-sides polygons that are equal no matter how the red and blue points are chosen.

Now, going back to the original problem, for triangles we have K = 3. This means (1) becomes:

N2 £   2(2N-1)                                                     (2)

Taking N = 2K = 6, we can see that N2 = 36 >  22 = 2(2N-1)

We can also see that for any N > 6 the inequality will not stand (in fact any N  > 3 will work).

So, that’s the end of the solution. I hope you found this problem interesting.

Good luck to everyone on their exams!  
 

Monday 26 November 2012

Assignment 3 Again!

Hey everyone!

I can’t believe that the fall semester is almost over. Mostly, I can’t believe that exams are just two weeks away. As planned, I had finished a rough draft of the third assignment this past weekend. Today, I went to office hours to ask for all the clarifications I needed. Like with the second assignment, it was very informative and I found out where I was going wrong for the questions I was struggling with. When I first read through the assignment, I thought that I would have the most trouble with questions on finite state automata as it is our newest topic. However, I found that I actually had the most trouble with the questions requiring proving correctness or termination of iterative programs. I think the reason why is that I have only really had practice proving recursive correctness. During office hours, I asked general questions about the approach to proving iterative correctness so that I could better understand the process involved and apply it to the assignment. I'm glad that the assignment helped me realize what I had not truly understood in the course. Now, I am ready to start writing up a good copy and hopefully start preparing for exams as well.

I hope everyone has a great week!  

Monday 19 November 2012

Assignment 3 and Finite State Automata

This week, I am really hoping that I will be able to finish Assignment 3 by the weekend – or at least a rough draft. For Assignment 2, I found it really beneficial finishing a rough draft about a week before the due date and then spending the rest of the time looking it over and asking for any clarifications that I needed. I have already read over the assignment problems and looked over the sections of the course notes that are relevant to each question. I find that doing these assignments is what really consolidates the concepts we talk about in class. I find the questions to always be more challenging than the ones discussed in lectures and tutorials and that they require a lot of thought – in a good way.

Last week, we started learning about finite state automata. I was actually quite confused in lecture on what a finite state automaton actually is and what they are used for so I did some additional reading on my own to clear things up. As always, the tutorials were very helpful.

I hope everyone has a great week!

Sunday 11 November 2012

Second Test Again!


I am so glad that it’s fall break! I definitely need this time to catch up on work/readings in all of my classes.

I was so stressed leading up to the second term test. Now that it’s done, I think it went pretty well. Like with the first test, I found there was just the right amount of time provided for me to be able to finish both questions and look over my solutions. The proof of correctness question was the one I struggled with the most I think. Luckily, I had spent a lot of time the night before reading over the examples provided in the course notes so I just tried my best to follow the proof outline followed in the notes. I guess I’ll find out if I was on the right track when we get our results back.

Having just finished with both recursive and iterative proofs of correctness in this class, I am looking forward to starting our next topic.
 
I hope everyone enjoys the break!

Sunday 4 November 2012

Second Test

Hey everyone!

I don’t really feel like anything important has occurred or changed since last week. Yesterday, I started studying for our second term test. I’m a little worried since I don’t feel as comfortable with the material as I did for our first tem test. To study, so far, I have been looking at all the past tutorial problems and quiz questions. I have also been looking over examples from class in the lecture slides and reading over the course notes to make sure I understand everything. For out last test, there was a distinct concept, the well-ordering principle, that I was having a lot of problems with. This time around, I don’t think that one thing really stands out to me as something I understand less than everything else. I just find that in general, I feel less comfortable with all the concepts as a whole than I did for the first test. I have been finding that all the practice that I have been getting in tutorials and with the second assignment has been a huge help. I think the big thing for me to prepare will be to just do more problems to get more practice.

I hope everyone is having a good weekend and good luck on the test!

Sunday 28 October 2012

Assignment 2


With Assignment 2 being due this Friday, I had the goal of finishing it this weekend. Unfortunately, this does not look like it’s going to end up happening. I did however spend a lot of time this weekend looking over the lecture slides from the past few weeks (ever since we started the topic of time complexity).  Even though I was mentioning last week that the tutorials and lectures have been very helpful and that I understand the topic much more, I still did not get much of a chance during the week to practice. On Saturday, I sat down and started working through the problems for Assignment 2. For the second question, since it’s similar to questions we have done in class and tutorial, I forced myself to not look at those examples and try it out on my own. Once I did, I looked at the examples and noticed that for the most part, I was on the right track. This is a huge improvement from last week were I didn’t have even the slightest idea of how to do any problems of this type. Question one was where the problems arose. To figure out a recursive definition, I decided to just start listing all of the odd maximal contiguous ones free strings in the set of binary strings of various lengths. Then I started looking to see what happens as the length increases to see if I could find a pattern. I came up with a formula but I have no idea how to get to a closed form. For the most part though, the weekend was quite productive. Getting more practice doing problems has definitely been a big help.

Sunday 21 October 2012

Lecture and Tutorial


Hey!

So, with three midterms last week, I was really worried about the tutorial quiz for this class. I didn’t have much time to look over the slides from last week’s lecture and did not understand how to do the tutorial problems. On Thursday, before class, I went in not understanding anything and was very stressed out. Fortunately, I found both the lecture and tutorial to be very informative. In fact, I found that after, I felt a lot more comfortable with the topic of time complexity. I think I simply need more practice. After tutorial, I understood how to do all three questions on the tutorial handout and therefore understood how to do the question on the tutorial quiz. Looking at Assignment 2, I feel like I now have a general idea of what I need to do. Unlike with Assignment 1, I plan to give myself plenty of time before the due date to start and work through each question.

I hope everyone had a great week!