<?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=211L11Solutions</id>
	<title>211L11Solutions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=211L11Solutions"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=211L11Solutions&amp;action=history"/>
	<updated>2026-04-29T08:47:14Z</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=211L11Solutions&amp;diff=260&amp;oldid=prev</id>
		<title>Mark: 1 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=211L11Solutions&amp;diff=260&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-259:rev-260 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=211L11Solutions&amp;diff=259&amp;oldid=prev</id>
		<title>Mark at 08:58, 11 October 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=211L11Solutions&amp;diff=259&amp;oldid=prev"/>
		<updated>2006-10-11T08:58:22Z</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;==Lecture 11==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;1. Suppose that the set of all propositions PROP is the set of all symbols of the Latin alphabet. Design an algorithm that given a string over the alphabet PROP [ {&amp;amp;,^,_,¬, ), (} detects if the string is a formula.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For the last &amp;#039;(&amp;#039; in the string, take the substring between that ( and the first &amp;#039;)&amp;#039;. If that is of the form p ^ q or p V q or p -&amp;gt; q, or any combination, where p or q are ¬p or ¬q. Then replace everything between and including the brackets with a new proposition p&amp;#039;. Repeat this process until such stage where it is reduced to one proposition, in which case it is a formula, else it is not a formula.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2. Let Φ be formula. Prove that with every occurrence of ( in Φ there is a sub-formula of Φ uniquely associated with (. For example, in the formula Φ = ((p ^ q) V (q -&amp;gt; ¬(p ^ q))) the sub-formula associated with the first occurrence of ( is the Φ itself, the sub-formula associated with the second occurrence of ( is (p ^ q), and the formula associated with the third occurence of ( is (q -&amp;gt; ¬(p ^ q)).&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
For every formula there is a set of parentheses for every sub formula within that formula. This can be demonstrated by how a formula can be built. Any formula can be created by inductivly building on a the base cases of (p ^ q) or (p V q) or (p -&amp;gt; q) for each possible combination of p or ¬p and q or ¬q. In each of these base cases there is a unique &amp;#039;(&amp;#039; associated with the formula. Any formula can be built up by substituting a formula for a proposition. The cardinality of the ( always matches the number of sub-formulas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;3. Prove that the following formulas are equivalent:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(a) (Φ -&amp;gt; Ψ) and (¬Φ V Ψ).&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(b) (Φ ^ (a V B)) and ((Φ ^ a) V (Φ ^ B)).&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(c) Φ and ¬¬Φ.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(d) ¬(Φ _  ) and (¬Φ ^ ¬ ).&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(e) ¬(Φ ^  ) and (¬Φ _ ¬ ).&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;(f) (Φ ^ (Φ ^ )) and ((Φ ^ Φ) ^ ).&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 		(Φ -&amp;gt; Ψ) and (¬Φ V Ψ).		&lt;br /&gt;
 &lt;br /&gt;
 Φ	Ψ	(Φ -&amp;gt; Ψ)	 (¬Φ V Ψ)	&lt;br /&gt;
 0	0	1	1	&lt;br /&gt;
 0	1	1	1	&lt;br /&gt;
 1	0	0	0	&lt;br /&gt;
 1	1	1	1	&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 		(Φ ^ (a V B)) and ((Φ ^ a) V (Φ ^ B))		&lt;br /&gt;
 &lt;br /&gt;
 Φ	a	B	(Φ ^ (a V B))	 ((Φ ^ a) V (Φ ^ B))&lt;br /&gt;
 0	0	0	FALSE	FALSE&lt;br /&gt;
 0	0	1	FALSE	FALSE&lt;br /&gt;
 0	1	0	FALSE	FALSE&lt;br /&gt;
 0	1	1	FALSE	FALSE&lt;br /&gt;
 1	0	0	FALSE	FALSE&lt;br /&gt;
 1	0	1	TRUE	TRUE&lt;br /&gt;
 1	1	0	TRUE	TRUE&lt;br /&gt;
 1	1	1	TRUE	TRUE&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 Φ	¬¬Φ			&lt;br /&gt;
 1	1			&lt;br /&gt;
 0	0			&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 		¬(� ΦV ψ) and (¬Φ ^ ¬ψ)		&lt;br /&gt;
 Φ	ψ	¬(� ΦV ψ)	(¬Φ ^ ¬ψ)	&lt;br /&gt;
 1	1	0	0	&lt;br /&gt;
 1	0	0	0	&lt;br /&gt;
 0	1	0	0	&lt;br /&gt;
 0	0	1	1	&lt;br /&gt;
  &lt;br /&gt;
 &lt;br /&gt;
 		¬(� Φ^ ψ) and (¬Φ V ¬ψ)		 &lt;br /&gt;
 &lt;br /&gt;
 Φ	ψ	¬(� Φ^ ψ)	(¬Φ V ¬ψ)	&lt;br /&gt;
 1	1	0	0	&lt;br /&gt;
 1	0	1	1	&lt;br /&gt;
 0	1	1	1	&lt;br /&gt;
 0	0	1	1	&lt;br /&gt;
 &lt;br /&gt;
 		(a^(B^g)) and ((a^B)^g)		&lt;br /&gt;
 				&lt;br /&gt;
 a	B	g	(a^(B^g))	((a^B)^g)&lt;br /&gt;
 0	0	0	0	0&lt;br /&gt;
 0	0	1	0	0&lt;br /&gt;
 0	1	0	0	0&lt;br /&gt;
 0	1	1	0	0&lt;br /&gt;
 1	0	0	0	0&lt;br /&gt;
 1	0	1	0	0&lt;br /&gt;
 1	1	0	0	0&lt;br /&gt;
 1	1	1	1	1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;4. Prove that a formula Φ is a contradiction if and only if ¬Φ is valid.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*If Φ is a contradiction, then ¬Φ is valid.&lt;br /&gt;
&lt;br /&gt;
If Φ is a contradiction, then it must be true that the proposition is false. For example a contradiction is the statement &amp;quot;one is an even number&amp;quot;. This is the same as saying it is false that &amp;quot;one is an even number&amp;quot;, i.e. ¬Φ.&lt;br /&gt;
&lt;br /&gt;
*If ¬Φ is valid, then Φ is a contradiction.&lt;br /&gt;
Similarly, if it is false that &amp;quot;one is an even number&amp;quot;. Then it is true that &amp;quot;one is an even number&amp;quot; is a contradiction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;5. Convert each of the following formulas into disjunctive normal form: (p -&amp;gt; ¬q), ¬(p -&amp;gt; (s -&amp;gt; ¬(q V p))), ((¬p ^ (s -&amp;gt; p)) ^ (q V ¬s)), ¬(((p V ¬s) ^ (q V ¬p)) -&amp;gt; (p -&amp;gt; q)). &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*(p -&amp;gt; ¬q)&lt;br /&gt;
*¬(p -&amp;gt; (s -&amp;gt; ¬(q V p)))&lt;br /&gt;
*((¬p ^ (s -&amp;gt; p)) ^ (q V ¬s))&lt;br /&gt;
*¬(((p V ¬s) ^ (q V ¬p)) -&amp;gt; (p -&amp;gt; q))&lt;br /&gt;
&lt;br /&gt;
 (p -&amp;gt; ¬q)							&lt;br /&gt;
 		A:(¬p^¬q)V(¬p^q)V(p^¬q)					&lt;br /&gt;
 p	q	¬q	(p -&amp;gt; ¬q)				&lt;br /&gt;
 FALSE	FALSE	TRUE	TRUE				&lt;br /&gt;
 FALSE	TRUE	FALSE	TRUE				&lt;br /&gt;
 TRUE	FALSE	TRUE	TRUE				&lt;br /&gt;
 TRUE	TRUE	FALSE	FALSE				   &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ¬(p -&amp;gt; (s -&amp;gt; ¬(q V p)))							&lt;br /&gt;
 					A: (p^q^s)V(p^¬q^s)		&lt;br /&gt;
 p	q	s	q V p	¬(q V p))	s -&amp;gt; ¬(q V p))	(p -&amp;gt; (s -&amp;gt; ¬(q V p)))	¬(p -&amp;gt; (s -&amp;gt; ¬(q V p)))&lt;br /&gt;
 TRUE	TRUE	TRUE	TRUE	FALSE	FALSE	FALSE	TRUE&lt;br /&gt;
 TRUE	TRUE	FALSE	TRUE	FALSE	TRUE	TRUE	FALSE&lt;br /&gt;
 TRUE	FALSE	TRUE	TRUE	FALSE	FALSE	FALSE	TRUE&lt;br /&gt;
 TRUE	FALSE	FALSE	TRUE	FALSE	TRUE	TRUE	FALSE&lt;br /&gt;
 FALSE	TRUE	TRUE	TRUE	FALSE	FALSE	TRUE	FALSE&lt;br /&gt;
 FALSE	TRUE	FALSE	TRUE	FALSE	TRUE	TRUE	FALSE&lt;br /&gt;
 FALSE	FALSE	TRUE	FALSE	TRUE	TRUE	TRUE	FALSE&lt;br /&gt;
 FALSE	FALSE	FALSE	FALSE	TRUE	TRUE	TRUE	FALSE &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ((¬p ^ (s -&amp;gt; p)) ^ (q V ¬s))							&lt;br /&gt;
 					A: (¬p^q^¬s)V(¬p^¬q^¬s)		&lt;br /&gt;
 p	q	s	(q V ¬s)	(s -&amp;gt; p)	(¬p ^ (s -&amp;gt; p))	((¬p ^ (s -&amp;gt; p)) ^ (q V ¬s))	&lt;br /&gt;
 TRUE	TRUE	TRUE	TRUE	TRUE	FALSE	FALSE	&lt;br /&gt;
 TRUE	TRUE	FALSE	TRUE	TRUE	FALSE	FALSE	&lt;br /&gt;
 TRUE	FALSE	TRUE	FALSE	TRUE	FALSE	FALSE	&lt;br /&gt;
 TRUE	FALSE	FALSE	TRUE	TRUE	FALSE	FALSE	&lt;br /&gt;
 FALSE	TRUE	TRUE	TRUE	FALSE	FALSE	FALSE	&lt;br /&gt;
 FALSE	TRUE	FALSE	TRUE	TRUE	TRUE	TRUE	&lt;br /&gt;
 FALSE	FALSE	TRUE	FALSE	FALSE	FALSE	FALSE	&lt;br /&gt;
 FALSE	FALSE	FALSE	TRUE	TRUE	TRUE	TRUE		 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ¬(((p V ¬s) ^ (q V ¬p)) -&amp;gt; (p -&amp;gt; q))								&lt;br /&gt;
 					A: Always False			&lt;br /&gt;
 p	q	s	(p -&amp;gt; q)	(p V ¬s)	 (q V ¬p)	((p V ¬s) ^ (q V ¬p))	(((p V ¬s) ^ (q V ¬p)) -&amp;gt; (p -&amp;gt; q))	¬(((p V ¬s) ^ (q V ¬p)) -&amp;gt; (p -&amp;gt; q))&lt;br /&gt;
 TRUE	TRUE	TRUE	TRUE	TRUE	TRUE	TRUE	TRUE	FALSE&lt;br /&gt;
 TRUE	TRUE	FALSE	TRUE	TRUE	TRUE	TRUE	TRUE	FALSE&lt;br /&gt;
 TRUE	FALSE	TRUE	FALSE	TRUE	FALSE	FALSE	TRUE	FALSE&lt;br /&gt;
 TRUE	FALSE	FALSE	FALSE	TRUE	FALSE	FALSE	TRUE	FALSE&lt;br /&gt;
 FALSE	TRUE	TRUE	TRUE	FALSE	TRUE	FALSE	TRUE	FALSE&lt;br /&gt;
 FALSE	TRUE	FALSE	TRUE	TRUE	TRUE	TRUE	TRUE	FALSE&lt;br /&gt;
 FALSE	FALSE	TRUE	TRUE	FALSE	TRUE	FALSE	TRUE	FALSE&lt;br /&gt;
 FALSE	FALSE	FALSE	TRUE	TRUE	TRUE	TRUE	TRUE	FALSE&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;6. We say that   is in a conjunctive normal form if it is written as (�1^�2^. . .^�k), where each � is a disjunction of literals. Prove that for every formula � there exists an equivalent formula   in a conjunctive normal form.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;7. Consider the Evaluate(�,A) algorithm. Find a loop invariant of the algorithm and prove that the algorithm is correct.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;8. Finish the inductive step in the proof of Theorem 5&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>