R = {( (a1,b1), (a2,b2) ) | abs(a1) = abs(a2) and abs(b1) = abs(b2) }
where abs(x)
is the absolute value of x.
Is R a symmetric relation on S?
Prove P = (P - Q) ∪ (P ∩ Q) for all sets P and Q. (You don't get to choose P and Q; your proof has to work for all choices of P and Q.) Hint: Split the proof into two parts.
To show that X = Y for two sets X and Y, it is enough to show X ⊆ Y and Y ⊆ X. To show that X ⊆ Y, you must show that for any a, if a ∈ X, then it is also true that a ∈ Y.
Also note that A - B = { x | (x in A) and (x not in B) }
As an example of the kind of proof that is acceptable, here is a
proof that
A ∩ (B ∪ C) ⊆ (A ∩ B) ∪ (A ∩ C):
For any x, x ∈ A ∩ (B ∪ C) => x ∈ A and x ∈ (B ∪ C) => x ∈ A and (x ∈ B or x ∈ C) => (x ∈ A and x ∈ B) or (x ∈ A and x ∈ C) => x ∈ (A ∩ B) or x ∈ (A ∩ C) => x ∈ (A ∩ B) ∪ (A ∩ C) So A ∩ (B ∪ C) ⊆ (A ∩ B) ∪ (A ∩ C)
Prove the following statement.
y = 6 * x % 31 (where % is the mod operator)has a solution x in R.
For example, for y = 11, there must be an x such that
11 = 6*x % 31 (The answer is x = 7.)
However, you don't get to choose y. You are trying to show this is true for every y in R. Hint: You may use the following fact.
Since 31 is prime, for any x1 and x2 in R = {0,1,2,...,30}, if
x1 ≠ x2
then
6*x1 % 31 ≠ 6* x2 % 31
For example, for x = 0,1,2,...,7, the corresponding values of 6 * x % 31 are all distinct:
x | 6*x % 31 |
---|---|
0 | 0 |
1 | 6 |
2 | 12 |
3 | 18 |
4 | 24 |
5 | 30 |
6 | 5 |
7 | 11 |
Give an NFA for L = { w: w has an even number of 0's or exactly two 1's }. E.g. L contains 0010110 and 01001, but not 00101100 or 0100
Give a regular expression for the language L of the previous problem.
Show that the following set is not regular. You may use the pumping lemma and the closure of the class of regular languages under union, intersection, and complement.
Use the pumping lemma to show that the following language is not regular.