Learning Objectives
With this assignment you will demonstrate:
- An understanding of what the study of programming languages entails
- The ability to write an execute a program on an online programming platform
- A familiarity with the basics of the four major computation theories
- A working knowledge of mathematical sets, relations, and functions
- The ability to translate statements into logic formulas
Readings and Videos
Please:
If you need to see some additional references on mathematical or logical notation or need to brush up on such things, you can look at
this page of basic notation
and these slides by Gabriel Robins
and for fun read Who can name the bigger number by Scott Aaronson.
Problems to Submit
You may work alone or in groups of at most 3 students. If you choose to pair or triple up, DO NOT “partition” the work. Letting a team member do some problems while you do others cheapens your educational experience and leaves you behind. It is best for each student to do all of the problems, then meet as a group to (1) select the “best” answer for submission when more than one exist, and (2) teach each other: that is, if one group member is unable to do one of the problems, another group member can teach that student how it do it. Everyone is responsible for understanding the entire homework submission, so everyone should contribute to the entire assignment.
Submit your answers on a beautiful PDF uploaded to BrightSpace.
-
On the
course notes page entitled “The Study of Programming Languages”
we saw a function written in several programming languages. Write this function in a language
not on this list. Prove that your function works on a tio.run or replit.com page. Include the
link to your code in your answer.
-
In your own words, write one sentence for each of the four major theories of computation,
conveying its central question and its areas of concern. Write as if your job depended on
clarity, accuracy, and solid English writing skills. If you look to Chat GPT for help,
do not just copy what the bot says; but feel free to try so see if it can even get close
on this one. The scope of the four theories are kind of fuzzy, so stick with the definitions
you’ve heard in class rather than Chat-GPT’s training set.
-
In the Theories of Computer Science lecture we saw
how to express the odd-number test in Lambda Calculus notation, Lisp, Python, JavaScript, Java,
Ruby, Clojure, and Swift. Show how, in each of these notations or languages, to express a
function to cube a number. (Research may be required.)
-
Mark each of the following as true or false:
- $\varnothing \in \varnothing$
- $\varnothing \in \{ \varnothing \}$
- $\varnothing \subseteq \varnothing$
- $\varnothing \subseteq \{ \varnothing \}$
- $\{ x, y \} \subseteq \mathcal{P}(\{ x, y, \{x,y\} \})$
- $\mathcal{P}(\varnothing) = \{ \varnothing \}$
- $\{ x, y, z\}^3 - \{ s \;\mid\; |s| \leq 3 \} \neq \varnothing$
- $\bigcup \{ \mathbb{N}, \mathbb{B}, \mathbb{Q} \} - \mathbb{B} = \mathbb{Q}$
-
$(9, 3, F) \in \mathbb{Z} \times \mathbb{B} \times \mathbb{R} \wedge (1,2)\!\downarrow\!1 =
2$
- $|\mathcal{P}(\{a,b,c\}) - \mathcal{P}(\{a,b\})| = 5$
-
Is the intersection of two partial orders a partial order? If so, prove it. If not, give a
counterexample.
-
Let $f = \lambda x. 2x + 1$ and $g = \lambda x. \lambda y. 3xy$. Reduce each of the following
expressions (or if they cannot be reduced, say why):
- $f^5(20)$
- $f \circ f$
- $g(f[5/3](3) - f[5/3](2))$
- $(\lambda w. (f^{-1}(71), w(5), w(1)))(f \circ (g\:1)) $
- $(\lambda x. (x\:x))(\lambda x. (x\:x))$
-
Simplify each of the following as much as possible without introducing any roundoff errors—your simplified expressions must still be exact:
- $3 \uparrow \uparrow 2$
- $2 \uparrow \uparrow \uparrow 3$
- $790912853^{3892359} \;\mathtt{mod}\; 90277$
- $(3 + 2i - 8k) \times (8i + 2j -k)$ (quaternion multiplication)
- $\log_8{2^{333333333}}$
-
Translate the following sentences into logical notation.
- If you don't leave now, you will not win the prize.
- Ani or her sisters might have been late.
- Some dogs like cats who live in the capital of Turkey.
- The person who won the race prefers orange juice to tea.
- 3 will never be greater than 7.
- Not every odd number is greater than its own square.
- Something evil caused all evil things except itself.
- Some day, it will be possible that all players will have the same score.
- War is peace, freedom is slavery, and ignorance is strength.
- All that was once true will someday necessarily be forever false.
-
In classical logic, $\exists$ and $\forall$ are duals of each other, because $(\neg \exists x.P)
\equiv \forall x. \neg P$ and $(\neg \forall x.P) \equiv \exists x.\neg P$. Are the temporal
operators $\textbf{F}$ and $\textbf{G}$ duals of each other? Why or why not?
-
Suppose that you had a classical, bivalent logistic system powerful enough to express statements
about the provability of its own formulas, for example, “This formula is not provable” or
equivalently “I am not provable.” Show that such a system, if consistent, must be incomplete,
and if complete, must be inconsistent.