<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=211L6Solutions</id>
	<title>211L6Solutions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=211L6Solutions"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=211L6Solutions&amp;action=history"/>
	<updated>2026-05-19T09:02:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=211L6Solutions&amp;diff=278&amp;oldid=prev</id>
		<title>Mark: 1 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=211L6Solutions&amp;diff=278&amp;oldid=prev"/>
		<updated>2008-03-08T22:35:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision(s)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:35, 8 March 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key mediawiki-mw_:diff:1.41:old-277:rev-278 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=211L6Solutions&amp;diff=277&amp;oldid=prev</id>
		<title>Mark at 01:24, 25 August 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=211L6Solutions&amp;diff=277&amp;oldid=prev"/>
		<updated>2006-08-25T01:24:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Exercises==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;1. For each of the pair of sets A and B below, determine whether A is a subset of B or B is a subset of A or A = B.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(a) A = {1, 2}, B = {2, 3, 4}.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
A != B&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(b) A = {a, c}, B = {c, d, a}.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
a is a subset of b (proper subset)&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(c) A = {3, 2, a}, B = {2, 3, a}.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
A = B&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(d) A = {4, 7,−1}, B = {7, 3, 4}.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
A != B&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2. For any two sets A and B prove the equalities A U A = A and A n B = B n A are true.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* If x is from a A U A then x is from A and is also x is from A. {x | x is a member of A or x is a member of A}. Thus A U A = A.&lt;br /&gt;
&lt;br /&gt;
* For any set, if {x | x is a member of A and x is a member of B}, then it follows that x is a member of B and x is a member of A. Thus A n B = B n A.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;3. Let A, B, C be sets. Prove that (A U B) U C = A U (B U C) and (A n B) n C = A n (B n C).&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*Let A = {a,b} B = {b,c} C = {c,d}.&lt;br /&gt;
** (A U B) U C = {a,b,c} U {c,d} = {a,b,c,d}&lt;br /&gt;
** A U (B U C) = {a,b} U {b,c,d} = {a,b,c,d}&lt;br /&gt;
** Thus (A U B) U C = A U (B U C)&lt;br /&gt;
&lt;br /&gt;
*Let A = {a,b} B = {a,c} C = {a,d}.&lt;br /&gt;
** (A n B) n C = {a} n {a,d} = {a}&lt;br /&gt;
** A n (B n C) = {a,b} n {a} = {a}&lt;br /&gt;
** Thus (A n B) n C = A n (B n C)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;4. Give examples of sets A and B such that A \ B != B \ A.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
let A = {a,b,c} and B = {c,d,e}. Then A\B = {a,b} and B\A = {d,e}&lt;br /&gt;
&lt;br /&gt;
{a,b} does not equal {d,e} and thus A\B is not the same as B\A.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;5. Let A and B be sets. Prove or disprove the following equalities:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(a) P(A n B) = P(A) n P(B).&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
e.g. &lt;br /&gt;
* P({a b} n {b c}) =  P{(b)} = b&lt;br /&gt;
* P(a b) n P{b c}  =  {(a,a), (a,b), (b,a), (b,b)} n {(b,b), (b,c), (c,b), (c,c)} = (b,b)&lt;br /&gt;
b does not equal (b,b).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(b) P(A U B) = P(A) U P(B).&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*P({a} U {a}) = a &lt;br /&gt;
*P({a}) U P({a}) = a&lt;br /&gt;
&lt;br /&gt;
Therefore, in at least one instance this does hold true.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;6. Find the cross products A × B, A × A, and A × B × A for the following sets:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(a) A = {1, 2}, B = {2, 3, 4}.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*#A × B = {{1,2},{1,3},{1,4},{2,2},{2,3},{2,4}}&lt;br /&gt;
*#A × A = {{1,1},{1,2},{2,2}}&lt;br /&gt;
*#A × B × A = {{1,2,1},{1,2,2},{1,3,1},{1,3,2},{1,4,1},{1,4,2},{2,2,2},{2,3,2},{2,4,2}}&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(b) A = N, B = {1, 2}.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*#A × B = {{N,1},{N,2}}&lt;br /&gt;
*#A × A = {{ N,N },}&lt;br /&gt;
*#A × B × A = {{N,1,N},{N,2,N}}&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(c) A = {c, d}, B = 0.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*#A × B = {{c,0},{d,0}}&lt;br /&gt;
*#A × A = {{c,c},{c,d},{d,d}}&lt;br /&gt;
*#A × B × A = {{c,0,c},{c,0,d},{d,0,d}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;7. For sets A, B and C prove A × (B U C) = A × B U A × C.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Let A = {a,b} B = {b,c} C = {c,d}.&lt;br /&gt;
** A × (B U C) = A × {b,c,d} = {{a,b},{a,c},{a,d},{b,b},{b,c},{b,d}}&lt;br /&gt;
** A × B U A × C = {{a,b},{a,c},{b,b},{b,c}} U {{a,c},{a,d},{b,c},{b,d}} = {{a,b},{a,c},{a,d},{b,b},{b,c},{b,d}}&lt;br /&gt;
** Thus A × (B U C) = A × B U A × C&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;8. Consider the set A = {x, y}. List down all unary and binary relations on this set. How many ternary relations are there on this set? How many 4-place relations are there on this set?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{x,y,(x,x),(x,y),(y,x),(y,y)} //and empty&lt;br /&gt;
There are no ternary or 4-place relations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;9. Consider the set A = {a, b, c}. Do the following:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(a) Find a relation on A that is symmetric and reflexive but not transitive.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{(a,a),(a,b),(b,b),(b,a),(c,c)}&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(b) Find a relation on A that is symmetric and transitive but not reflexive.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{(a,b),(b,a),(a,c),(c,a),(b,c),(c,b)}&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(c) Find a relation on A that is reflexive and transitive but not symmetric.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{(a,a),(a,b),(b,b),(b,c),(c,c),(c,a)}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;10. Let R be a binary relation on A. Call a relation R0 the minimal symmetric cover of R if the following are true:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(a) R0 is a symmetric relation.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(b) R � R0.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(c) If S is a symmetric relation containing R then R0 � S.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Design a method that builds the minimal symmetric cover for any given binary relation R.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For all (x,y) which exist in R, if (y,x) does not exist, create it.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;11. Let R be a binary relation on A. Call a relation R0 the transitive closure of R if the following are true:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(a) R0 is a transitive relation.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(b) R � R0.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(c) If T is a transitive relation containing R then R0 � T.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Design a method that builds the transitive closure for any given binary relation R.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Wherever (x,y) exist in R and (y,z) exist in R, if there isn&amp;#039;t already a path from x,z then create one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;12. Give an example of a symmetric relation which is antisymmetric.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
R={(1,1),(2,2),(3,3)}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;13. Give an example of antisymmetric relation which is symmetric.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
R={(1,1),(2,2),(3,3)}&lt;br /&gt;
&lt;br /&gt;
==Programming exercises==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;1. Write a program that for input finite sets A and B outputs A [ B.&amp;#039;&amp;#039;&lt;br /&gt;
*Done&lt;br /&gt;
&amp;#039;&amp;#039;2. Write a program that for input finite sets A and B outputs A \ B.&amp;#039;&amp;#039;&lt;br /&gt;
*Done&lt;br /&gt;
&amp;#039;&amp;#039;3. Write a program that for input finite sets A and B outputs A \ B.&amp;#039;&amp;#039;&lt;br /&gt;
*Done&lt;br /&gt;
&amp;#039;&amp;#039;4. Write a program that as input takes a binary relation on a finite set and determines &amp;#039;&amp;#039;&lt;br /&gt;
*a)&amp;#039;&amp;#039; if the relation is reflexive; &amp;#039;&amp;#039;&lt;br /&gt;
Done&lt;br /&gt;
*b)&amp;#039;&amp;#039; if the relation is symmetric; &amp;#039;&amp;#039;&lt;br /&gt;
Done&lt;br /&gt;
*c) if the relation is transitive; &lt;br /&gt;
*d)&amp;#039;&amp;#039;if the relation is antisymmetric.&amp;#039;&amp;#039;&lt;br /&gt;
Done&lt;br /&gt;
&lt;br /&gt;
5. Write a program that given a finite set A and a binary relation R on A outputs the minimal symmetric cover of R (see Exercise 10).&lt;br /&gt;
&lt;br /&gt;
6. Write a program that given a finite set A and a binary relation R on A outputs the transitive closure of R (See Exercise 11)&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>