Sort the Words: Languages as Sets
Practice languages as sets: sort the 15 words of length at most 3 into the regions of a Venn diagram of two or three languages, or choose the words of a set expression, and get an explanation for every mistake.
Last updated:
Where does each word belong?
A language over is a set of words, so two languages can be compared the way two sets are compared.
In this tool each language is given by a condition, such as “words that start with ”, and the universe is the words of length at most (the empty word is one of them).
The universe is the set of words that the diagram shows; it is finite so that every word can be seen, and the complement of a language is the words of the universe that are not in it.
A Venn diagram draws every language as a circle. A word belongs to the region that records which circles it is inside:
only , both and , or none of them.
The tool draws a new random question each time. It checks your answer at once, and for every wrong word it says, in words, which conditions the word satisfies and where it should have been placed.
How to use the tool
- Choose a task type: sorting into two sets, sorting into three sets, or choosing the words of a set expression.
- In a sorting task, drag a word to a region of the diagram or to one of the region boxes under it. On a keyboard or a touch screen, choose a word and then press the button of its region; the next word that is not placed yet is chosen for you.
- In an expression task, tap every word that belongs to the set expression shown.
- Press “Check”. Words marked with ✓ are right, and words marked with ✗ come with the reason. “Show the solution” fills in the answer, and “New question” draws another question. The question number can be added to the page address as
?seed=to get the same question again.
The tool needs JavaScript. Use the questions below on paper instead.
Figure of one question
Questions
In these questions is the language of the words that start with , and is the language of the words that end with , inside the words of length at most .
Question 1. In which region of the diagram is the empty word , and why?
Hint
Does have a first letter? Does it have a last letter?
Answer
The empty word has no letters, so it does not start with and does not end with .
It is in neither circle, in the region outside both and , together with , and .
Question 2. Write the words of (the symmetric difference: the words that are in exactly one of the two languages, see Languages: Operations and Equalities), and check that this set equals .
Hint
List and first, then (the words in both lists) and (the words in at least one list).
Count: the number of words in is the number in , plus the number in , minus the number in both.
Answer
has words and has words. Three words are in both:
. So has words. Removing the three words of from leaves words:
. These are exactly the words that are in one language and not in the other, which is the definition of .
Question 3. Find the words of and the words of , and explain in one sentence why they are the same.
Hint 1
What does “not ( or )” say in words?
Hint 2
A word is in when it is not in and not in .
Compare this sentence with the meaning of .
Answer
The words that are in neither language are . For :
the words that do not start with are , and of these the ones that do not end with are , the same four words.
The reason: the statement “the word is in or in ” is false exactly when the word is in neither language, that is, when it is not in and also not in .
This is one of De Morgan’s laws.