Docsity

Homework 1 Problems - Set Theory and Logic | MATH 340, Assignments of Mathematics

Toggle sidebar
bg1
Math 340, Homework 1.
The purpose of this homework is to get you acquainted with some very basic set operations, and to introduce the online
set theory system (setCraft) which we will be using frequently. Some of the learning will be set-theoretical, but some of the
learning will be adjustment to syntax and usage of our course tool setCraft.
SetCraft is an online exploratory tool built to understand the material of this course, but it is not a homework submis-
sion system. Work you do on setCraft will be submitted by simple copy-paste into email to your professor (howaldja at
potsdam.edu).
First thing’s first. Go to the site: http://www2.potsdam.edu/howaldja/set theory/setThing.html
Read the user input, particularly where it says “Let S={1,2,3,4,5,6}.” That defines a set. Notice on the right hand
pane, the computer has read the definition and knows about the set. This system expects you to make several set definitions,
on different lines of the input window. Try adding a line of your own, following the example. I suggest “Let A={5,3,1}.”
Click run. Not very impressive, right?
Define a set by listing its elements, as above. Alternatively, you can also say for example {4..9}, meaning all numbers
between 4 and 9. Use the “..” notation to define a set that’s a bit large, say {1..100}. Notice that the result window says
“click for value” – because the value is huge, setCraft is choosing to display it below rather than clutter the results window.
It doesn’t matter what variable names you give your sets, but you have to name them something in order to tell the system
you want to see their values on the righthand pane (and in order for me to easily check your work). This means every line
you write will begin with “Let”.
Define a third set having some fruits in it. For example, Let C={“kiwi”,“banana”}. Since fruits are abstract objects
(unknown to setCraft), they should be in quotes1. Make sure to include “tomato” as a fruit. Define a fourth set having some
vegetables. Make sure to include “tomato” also as a vegetable as well2. Check these by looking at them in the righthand
pane. (If the value takes up too much space, it will be say “click for value” and display below.)
Next, use the “intersect”, “union”, and “setminus” commands to define each of the following sets:
(1) The union of the fruits and the vegetables. (e.g. “Let E=Cunion D”)
(2) The intersection of the fruits and the vegetables.
(3) Fruits setminus veggies
(4) Veggies setminus fruits
Now view the resulting sets in the right hand pane. Are they what you expected? Are there any surprises? Did the
computer do the right thing?
Next we want to ask the computer whether the “fruit” set is a subset of the “veggies” set. (Is it? You should know!) If
we simply write, say, “C subset D”, the system understands that, but doesn’t display anything extra, because you haven’t
assigned a new variable. Therefore we say “Let test1 = (C subset D)”. Try it and see what it does. Because the right hand
side is a true/false statement, our assignment gives the variable test1 the value of “false,” which is just what we expected,
right? Define more tests to check whether . . .
(1) The veggies are a subset of the union of the fruits and veggies.
(2) The intersection of the fruits and the vegetables is a subset of the fruits.
(3) {1..5}is a subset of {0..10}
(4) {5,3,1}equals {1,3,5}
When you’re finished, check the computer calculations to see whether they do what you’re expecting. Then copy and
paste the user Input window into an email and send it to me.
1Without the quotes, setCraft will believe that “kiwi” is a variable name.
2It could be debated whether tomatoes are fruits or veggies, but that’s not the point right now.

Partial preview of the text

Download Homework 1 Problems - Set Theory and Logic | MATH 340 and more Assignments Mathematics in PDF only on Docsity!

Math 340, Homework 1.

The purpose of this homework is to get you acquainted with some very basic set operations, and to introduce the online set theory system (setCraft) which we will be using frequently. Some of the learning will be set-theoretical, but some of the learning will be adjustment to syntax and usage of our course tool setCraft.

SetCraft is an online exploratory tool built to understand the material of this course, but it is not a homework submis- sion system. Work you do on setCraft will be submitted by simple copy-paste into email to your professor (howaldja at potsdam.edu).

First thing’s first. Go to the site: http://www2.potsdam.edu/howaldja/set theory/setThing.html

Read the user input, particularly where it says “Let S = { 1 , 2 , 3 , 4 , 5 , 6 }.” That defines a set. Notice on the right hand pane, the computer has read the definition and knows about the set. This system expects you to make several set definitions, on different lines of the input window. Try adding a line of your own, following the example. I suggest “Let A = { 5 , 3 , 1 }.” Click run. Not very impressive, right?

Define a set by listing its elements, as above. Alternatively, you can also say for example { 4 .. 9 }, meaning all numbers between 4 and 9. Use the “..” notation to define a set that’s a bit large, say { 1 .. 100 }. Notice that the result window says “click for value” – because the value is huge, setCraft is choosing to display it below rather than clutter the results window. It doesn’t matter what variable names you give your sets, but you have to name them something in order to tell the system you want to see their values on the righthand pane (and in order for me to easily check your work). This means every line you write will begin with “Let”.

Define a third set having some fruits in it. For example, Let C = {“kiwi”, “banana”}. Since fruits are abstract objects (unknown to setCraft), they should be in quotes^1. Make sure to include “tomato” as a fruit. Define a fourth set having some vegetables. Make sure to include “tomato” also as a vegetable as well^2. Check these by looking at them in the righthand pane. (If the value takes up too much space, it will be say “click for value” and display below.)

Next, use the “intersect”, “union”, and “setminus” commands to define each of the following sets:

(1) The union of the fruits and the vegetables. (e.g. “Let E = C union D”) (2) The intersection of the fruits and the vegetables. (3) Fruits setminus veggies (4) Veggies setminus fruits

Now view the resulting sets in the right hand pane. Are they what you expected? Are there any surprises? Did the computer do the right thing?

Next we want to ask the computer whether the “fruit” set is a subset of the “veggies” set. (Is it? You should know!) If we simply write, say, “C subset D”, the system understands that, but doesn’t display anything extra, because you haven’t assigned a new variable. Therefore we say “Let test1 = (C subset D)”. Try it and see what it does. Because the right hand side is a true/false statement, our assignment gives the variable test1 the value of “false,” which is just what we expected, right? Define more tests to check whether...

(1) The veggies are a subset of the union of the fruits and veggies. (2) The intersection of the fruits and the vegetables is a subset of the fruits. (3) { 1 .. 5 } is a subset of { 0 .. 10 } (4) { 5 , 3 , 1 } equals { 1 , 3 , 5 }

When you’re finished, check the computer calculations to see whether they do what you’re expecting. Then copy and paste the user Input window into an email and send it to me.

(^1) Without the quotes, setCraft will believe that “kiwi” is a variable name. (^2) It could be debated whether tomatoes are fruits or veggies, but that’s not the point right now.