Uploaded by helenabenatar

hw1

advertisement
Helena Benatar
Homework 1
CS 61
September 13, 2021
Part I
1. (a) Section 1: I really enjoyed reading about how mathematics is central to so many
topics since I have always loved the subject for relating to every aspect of our
world. I also felt very identified by reading about the agony and ecstasy of doing
mathematics. For the national mathematic olympics in my country everyone in our
school was required to complete the initial test, and while most of my friends hated
the puzzles and just put random answers, I loved completing all the challenges,
more for the joy of completing them rather than to qualify. I also really enjoyed
the puzzle at the end of the section, since it literally put a smile on my face (as
the book says) when I realized the answer.
(b) Section 2: I found this section really interesting because the reason I like math is
because of its definitive answers and clarity, which I think appeals to people who
think very rationally. However, I am not the best at writing and sometimes have
clear ideas on problems but struggle to communicate them clearly or get them
across to the reader. The tips that are given in this section on writing clearly are
really helpful in correcting some of those mistakes that I often make.
(c) Section 3: In this section I learned the definition of b ”divides” a. It’s a concept
I hadn’t thought about in that way before. It’s also really interesting to start
thinking about definitions and the need to prove each concept that hasn’t been
clearly explained yet. I also learned the definition of ”Composite” and how it
relates to the definition of ”Prime”.
(d) Section 4: I learned about the difference between theorems and conjectures. I
found it interesting since before this I would have thought that a theorem meant
the same as a theory, and it could be proven or not yet proven. I also enjoyed how
it points out the difference between a statement that is a mistake and a statement
that is simply nonsense. I also found it interesting to analyze the word ”Truth”,
and the way it is absolute in mathematics in comparison even to other sciences
where many statements are true within a certain scope. Another thing I learned
and found interesting is the concept of ”If A, then B” being true when A is false
and B is true, where the statement is then ”vacuously true” which is a new term
I hadn’t heard before.
2. I didn’t use any resources apart from the textbook and the pre-recorded lecture videos.
1
CS 61
September 13, 2021
Homework 1
Helena Benatar
Part II
Here is a table showing which days the Lion and Unicorn are lying and which days they are
telling the truth, to aid in the following questions:
Lion
Unicorn
Mon Tue
L
L
T
T
Wed
L
T
Thu Fri
T
T
L
L
Sat Sun
T
T
L
T
1. According to the table above, which shows the days that the Lion and Unicorn are
lying and telling the truth, there are 3 possible sets. Either the Lion is lying and the
Unicorn is telling the truth, or vice versa, or they are both telling the truth. They both
claimed that the previous day was a lying day for them. Based on these 3 possible sets,
we can find out if the previous day was a actually a lying or truth day for both the
Lion and the Unicorn.
That Day
Previous Day
Lion Unicorn Lion Unicorn
L
T
T
L
T
L
L
T
T
T
L
L
Now, we can check the initial table to find consecutive days that satisfy the combinations we have found. For example, if both were telling the truth then the previous day
they would both be lying. The only day where they both tell the truth is Sunday, and
the previous day they were not both lying, so it couldn’t be Sunday. Evaluating the
other options, the only day it could be is Thursday, since it was a truth day for the Lion
and a lying day for the Unicorn, which means on Wednesday it would be vice versa.
2. There are two options: either it is a lying day or a truth day for the Lion.
• If it’s a lying day, then the previous day he was telling the truth and in 3 days he
will be telling the truth
• If it’s a truth day, then the previous day he was lying and in 3 days he will be
lying
With these options, we check which days satisfy these conditions and find that it could
only be Monday since Monday is a lying day, and the previous day (Sunday) he was
telling the truth and in 3 days (Thursday) he will be telling the truth.
2
Helena Benatar
Homework 1
CS 61
September 13, 2021
3. There are two options: either it is a lying day or a truth day for the Lion.
• If it’s a lying day, then the previous day he was telling the truth and the next day
he will be telling the truth
• If it’s a truth day, then the previous day he was lying and the next day he will be
lying
With these options, we check which days satisfy these conditions and find that there is
no day of the week where it would be possible for the Lion to make those two statements,
because there are no consecutive days which are L T L or T L T, where T is a truth
day and L is a lying day.
4. There are two options: either it is a lying day or a truth day for the Lion.
• If it’s a lying day, then either the previous day he was telling the truth or the next
day he will be telling the truth or both. This differs from the previous question
because it’s not necessary for both of the statements to hold. As long as one of
them is a lie, then the Lion is lying.
• If it’s a truth day, then the previous day he was lying and the next day he will be
lying
With these options, we check which days satisfy these conditions and find that it could
be Monday or Wednesday, since they are both lying days for the Lion.
• On Monday he says that he was lying on Sunday AND he will lie on Tuesday.
Since he wasn’t lying on Sunday this means he is lying.
• On Wednesday he says that he was lying on Tuesday AND he will lie on Thursday.
Since he will not lie on Thursday, this means he is lying.
Part III
3.1 (a) False. 3 does not divide 100 because there is no integer c such that 3c = 100.
(b) True. 3 divides 99 because there is an integer c = 33 such that 3c = 99.
(c) True. -3 divides 3 because there is an integer c = -1 such that -3c = 3.
(d) True. -5 divides -5 because there is an integer c = 1 such that -5c = -5.
(e) False. -2 does not divide -7 because there is no integer c such that -2c = -7.
(f) False. 0 does not divides 4 because there is no integer c such that 0c = 4.
(g) True. 4 divides 0 because there is an integer c = 0 such that 4c = 0.
(h) True. 0 divides 0 because there are many integers c such that 0c = 0, for example
c = 0.
3
CS 61
September 13, 2021
Homework 1
Helena Benatar
3.3 (a) 21 fails Definition 3.5 because the only positive divisors of 21 are not 1 and 21,
since 3 and 7 are also divisors of 21. 21 is composite since it is a positive integer
and there are two integers b = 3 and b = 7 such that 1 ¡ b ¡ a and b—a.
(b) 0 fails Definition 3.5 because it is not a positive number (not ¿ 1). 0 is not
composite either since it is not a positive integer.
(c) pi fails Definition 3.5 because it is not an integer, it is a decimal. pi is not composite
either since it is not an integer.
(d) 1/2 fails Definition 3.5 because it is not an integer, it is a fraction. 1/2 is not
composite either since it is not an integer.
(e) -2 fails Definition 3.5 because it is not a positive number (not ¿ 1). -2 is not
composite either since it is not a positive integer.
(f) -1 fails Definition 3.5 because it is not a positive number (not ¿ 1). -1 is not
composite either since it is not a positive integer.
4.1 (a) If x is an odd integer and y is an even integer, then the product of x and y is even.
(b) If an integer it odd, then its square is also odd.
(c) If a number is prime, then its square is not prime.
(d) If x and y are both negative integers, the product of x and y is negative.
4.3
A. a and b are odd integers
B. a + b is an even integer
If a and b are odd integers, then a + b is an even integer. But is a + b is an even
integer, then a and b are not necessarily odd integers, they could be both even.
4.4 The following tables show under what circumstances these statements are true or false:
Condition A
T
T
F
F
Condition B
T
F
T
F
If A, then B
T
F
T
T
Condition A
T
T
F
F
Condition B
T
F
T
F
(not A) or B
T
F
T
T
If A, then B is only false when A is true and B is false. The same is true for (not A) or
B. Since the result is the same for each possible situation, this means the statements, in
essence, are identical and could be used interchangeably as they give the same result.
4
CS 61
September 13, 2021
Homework 1
Helena Benatar
4.5 The following tables show under what circumstances these statements are true or false:
Condition A
T
T
F
F
Condition A
T
T
F
F
Condition B
T
F
T
F
Condition B
T
F
T
F
If A, then B
T
F
T
T
If (not B), then (not A)
T
F
T
T
If A, then B is only false when A is true and B is false. The same is true for If (not
B), then (not A). Since the result is the same for each possible situation, this means
the statements, in essence, are identical and could be used interchangeably as they give
the same result. They are also technically identical because the statements are in the
same format. The (not) before each condition reverses the statement, but the order of
the conditions is also switched so this reverses them again, leading it to be the same
exact statement.
Final Question
I spent around 4 hours completing this homework.
5
Download