Wednesday, 16 January 2013

January 16th, 2013 - "Why is my answer wrong?!?!?!"

CSC165 SLog Post - January 16th, 2013

The first week of CSC165 sneaked by quietly. With no assignments (except this one) having been assigned yet, I had been focusing most of my attention on my other courses. However, contrary to my expectations for a course called "Mathematical expression and reasoning", I now find myself enjoying CSC165. I am planning on taking PHL245, Modern Symbolic Logic, next year, and I really think CSC165 will give me an opportunity to acclimatize myself with the mode of thinking required of courses on logic. This course is surprisingly independent of programming languages and I can already see how I can apply the material learned to other facets of my life. Logic and reasoning play very large roles in my decision making process as well as my personality.

I met Maria, my TA, in tutorial on Tuesday. It feels strange to write about someone when you know they will be reading what you wrote in the near future. After we had worked through the tutorial handout and the answers had been put up, I realized that the answer my partner and I had for the last question was the only one that was different than what was on the board. I tried to find where I went wrong but the more I examined the question the more convinced I became that our answer was right. I asked Maria about the question but our initial discussion did not provide me with a satisfactory answer, and I still did not understand why my answer was different. A friendly colleague sitting in front of me tried to explain to me the answer we were given, and after he explained his reasoning I shared mine. In my argument I made use of counterexamples, quantifiers, and sets and I realized that just a week into the course I had already absorbed enough information for me to verbally illustrate my points using what I learned. After we mulled over the question some more, the other student agreed that my answer was right.

Knowing now that I wasn't crazy or just stupid and emboldened by the support of my fellow student, I approached Maria again to continue our discussion. Another student who had apparently reached the same conclusion I had went up as well and together we debated what the answer to the last question was. Eventually, the three of us agreed that the mistake was not in our answers but in the question itself; it was not phrased the right way.

The question asked for a Venn diagram of the False condition of the statement "There is one of the three python programs that fails all three test suites." However, no set was given for programs that "fail all three test suites." This set is not complementary to the set of programs that pass all three test suites (T), since there exist cases where a program does not fail all three but does not pass all three either, passing either one or two of the test suites. Therefore, in the Venn Diagram of the False condition of that statement, Q can be occupied if some program passes 1 or 2 test suites or empty if all three programs pass all three test suites. T can be occupied or unoccupied as well since there may or may not be programs in set P that pass all three tests and are not in Q. The intersection of Q and T can be occupied if there is a program of Q that passes all three tests (is also in T), or unoccupied if all three programs in Q only pass either 1 or 2 tests. Therefore, it is impossible to know whether any of the three regions of this Venn diagram are occupied, and the identity of all three regions should be "?." My conclusion was later verified when Danny sent the class an email with corrections made to the last question.

In the hours after, I thought more about the question and I now believe that the statement the last question had intended to convey is "There is one of the three python programs that does not pass all three test suites." Thanks to the murky ambiguities of the English language, the meaning of "fails all three test suites" is subtly (but importantly) different from "does not pass all three test suites." To "fail all three test suites" requires that the program fail all three of t1, t2, and t3. To "not pass all three test suites" requires that not all of t1, t2, and t3 are passed by the program, i.e. the program fails at least one test suite. If we use this statement for the question instead, the answer does indeed work out to be the one given, [X - O - ?]

The frustrations of lexical miscommunication aside, I rather enjoyed working through why the question didn't match the answer. Figuring out what the question actually meant was much more difficult of a puzzle than the questions given in tutorial. I think my experience working on this problem made me realize one great thing about CSC165: the material it covers and the language it uses leaves absolutely no room for ambiguity and uncertainty when it comes to writing and grading assignments and exams. So long as you understand the question, you already have everything you need to write down the answer; it's just a matter of putting everything in the right place. I can't believe I'm saying this, but I think I'm actually looking forward to our first test.

1 comment:

  1. First of all, I hope you like the course so far and you have not been discouraged because of the confusion in one of the first!! tutorial's questions.

    Nice thinking and observations! Don't worry your first test even assignment is not going to be so frustrating! In general, when we make use of logic in cs, it's in a more mathematical use, so there are no such confusions.. That was just an introduction to logic.

    ReplyDelete