9 Problems on Foundation in Programming - Assignment 2 | CS 160, Assignments of Computer Science

Material Type: Assignment; Professor: Boese; Class: Foundations in Programming; Subject: Computer Science; University: Colorado State University; Term: Spring 2009;

Typology: Assignments

Pre 2010

Uploaded on 03/11/2009

koofers-user-wj7
koofers-user-wj7 ๐Ÿ‡บ๐Ÿ‡ธ

5

(2)

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Last Name: First Name: Section (circle): 1:MWF 2:TuTh
CS 160 Spring 2009: Homework Assignment 2 โ€” Sets and Functions
Due: 11AM Friday February 6, 2009
Turn in hardcopy of your solutions in class, or slide it under your instructorโ€™s office door by the deadline.
(Sec. 1 MW - Liz Boese: 242 CS Bldg., Sec. 2 TTh - Jim Bieman: 462 CS Bldg.)
Do all nine (9) problems. Print this out on one sheet of two-sided paper and put your answers in the space
provided after each problem.
1. Use set builder notation to give a description of the following set:
๎˜€
6, 7, 8, 9, 10
๎˜
.
2. Suppose that A =
๎˜€
3, 5, 7
๎˜
, B =
๎˜€
3, 7
๎˜
, C =
๎˜€
5, 7
๎˜
, and D =
๎˜€
5, 7, 9
๎˜
. Which of these sets are proper subsets of
which other sets?
3. Use a single Venn diagram to illustrate the relationships X
๎˜‚
Yand Y
๎˜‚
Z.
4. Let A=
๎˜€
x, y, z
๎˜
,B=
๎˜€
0, 1
๎˜
, and C=
๎˜€
a, b
๎˜
. Show the result of B
๎˜ƒ
A
๎˜ƒ
C.
5. Let A=
๎˜€
1, 2, 3, 4, 5
๎˜
and B=
๎˜€
1, 2, 3, 4, 5, 6, 7, 8
๎˜
. Write out the following sets:
(a) A
๎˜„
B
(b) A
๎˜…
B
(c) A
๎˜†
B
(d) B
๎˜†
A
Your eName: ____________________
pf2

Partial preview of the text

Download 9 Problems on Foundation in Programming - Assignment 2 | CS 160 and more Assignments Computer Science in PDF only on Docsity!

Last Name: First Name: Section (circle): 1:MWF 2:TuTh

CS 160 Spring 2009: Homework Assignment 2 โ€” Sets and Functions

Due: 11AM Friday February 6, 2009

Turn in hardcopy of your solutions in class, or slide it under your instructorโ€™s office door by the deadline. (Sec. 1 MW - Liz Boese: 242 CS Bldg., Sec. 2 TTh - Jim Bieman: 462 CS Bldg.)

Do all nine (9) problems. Print this out on one sheet of two-sided paper and put your answers in the space provided after each problem.

  1. Use set builder notation to give a description of the following set:
  1. Suppose that A =

3, 5, 7 , B =

3, 7 , C =

5, 7 , and D =

5, 7, 9 . Which of these sets are proper subsets of

which other sets?

3. Use a single Venn diagram to illustrate the relationships X  Y and Y  Z.

  1. Let A =

x, y, z , B =

0, 1 , and C =

a, b. Show the result of B  A  C.

  1. Let A =

1, 2, 3, 4, 5  and B =

1, 2, 3, 4, 5, 6, 7, 8. Write out the following sets:

(a) A  B

(b) A  B

(c) A  B

(d) B  A

  1. Is f (as defined below) a function from Z to R? Give a yes or no answer. If your answer is no, give a brief justification.

(a) f  x  x^2

(b) f  x  x 21  9

  1. Give the domain and range of a function that assigns to each pair of positive integers the first integer of the pair.
  2. Determine whether each of the following functions from Z to Z is one-to-one. Give a yes or no answer. If your answer is no, give a brief justification.

(a) f  x  x  1

(b) f  x  x^2

9. Draw a graph of the function f  x   x^2