CSCI 301 L00 Worksheet

Lecture 0 - Exercises

Outcomes:

Overview
Sets 0
Racket 0

Part A

Write down each of the following sets using the roster method:

  1. \(V\), the set of all vowels in the English alphabet.
  2. \(O\), the set of all positive integers less than 10
  3. \(S\), the set of all positive integers less than 100
  4. The set of all integers

Part B

True or false:

  1. \(0 \in \mathbb{Z}\)
  2. \(0 \in \mathbb{N}\)
  3. \(V = \{u, i, a, e, o, u\}\) (using \(V\) as defined above in Part A)
  4. \(\pi \in \mathbb{Q}\)

Part C

  1. Recall that the formula for the volume of a sphere is \(\frac{4}{3}\pi r^3\). Racket has a built-in function expt to calculate exponents; its two arguments are the base and the exponent. Racket also has a built-in variable pi containing the (approximate) value of \(\pi\). Suppose a variable r has been defined, and write a Racket expression to compute the volume of a sphere with radius r.