[CS@TUK] Questions and Answers - Recent questions and answers in * Other Teaching Fields
https://q2a.cs.uni-kl.de/qa/other-teaching-fields
Powered by Question2AnswerAnswered: S-invariants
https://q2a.cs.uni-kl.de/3587/s-invariants?show=3588#a3588
<p>Well, it is a linear equation system with five variables and three linear independent equations so the solutions form a two-dimensional vector space that can be described as the set of linear combinations of two vectors. These vectors are not unique, and can be easily found as usual in linear algebra:</p><pre> 2a-s = 0 ==> a = 1/2s
6b-5s-4t = 0 ==> b = (5s+4t)/6
2c+4t =0 ==> c = -2t</pre><p>Hence, the solutions are</p><pre> (a,b,c,s,t) = (1/2,5/6,0,1,0)*s + (0,4/6,-2,0,1)*t
which could alternatively also represented as follows
(a,b,c,s,t) = (3,5,0,6,0)*s' + (0,2,-6,0,3)*t'
</pre>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/3587/s-invariants?show=3588#a3588Mon, 20 Mar 2023 17:16:36 +0000Answered: Finding S-invariant
https://q2a.cs.uni-kl.de/2811/finding-s-invariant?show=2812#a2812
<p>To determine the S-invariants, you have to solve a linear equation system, i.e., transpose(M)*x=0 where M is the incidence matrix. The matrix of the mentioned exercise is</p><pre> 2 0 0 −1 0
-5 3 1 0 0
0 −6 0 5 4
0 0 −1 0 −2 </pre><p>Every solution to the linear equation system is an s-invariant. You may proceed as follows using the Gaussian algorithm:</p><pre> 10 0 0 −5 0
-10 6 2 0 0
0 −6 0 5 4
0 0 −1 0 −2
10 0 0 −5 0
0 6 2 −5 0
0 −6 0 5 4
0 0 −1 0 −2
10 0 0 −5 0
0 6 2 −5 0
0 0 2 0 4
0 0 −1 0 −2
10 0 0 −5 0
0 6 2 −5 0
0 0 2 0 4
0 0 −2 0 −4
10 0 0 −5 0
0 6 2 −5 0
0 0 2 0 4
0 0 0 0 0
2 0 0 −1 0
0 6 0 −5 -4
0 0 2 0 4
0 0 0 0 0
</pre><p>From here you can get two solution vectors:</p><p> x1 = (3,5,0,6,0) x2 = (0,2,-6,0,3)</p><p>Now, any linear combination of these two vectors is an S-invariant. Hence, there are infinitely many s-invariants, and all of them can be obtained, e.g., as a linear combination of the above two ones (or the ones mentioned in the example solution). If you compute x1-x2 = (3,3,6,6,-3), you find your vector multiplied by 3, so yes, your vector is also an s-invariant.</p><div>I don't see a simpler way than solving the linear equation system, albeit the cycles in the dataflow graph correspond with the s-invariants.</div>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/2811/finding-s-invariant?show=2812#a2812Sun, 31 Jul 2022 20:05:07 +0000Answered: Sequent Calculus
https://q2a.cs.uni-kl.de/1868/sequent-calculus?show=1872#a1872
<p>The solution is correct. Where did you get this table from? It is fixed in the new version of the exercise slides:</p><p><a rel="nofollow" href="https://es.cs.uni-kl.de/teaching/vrs/exercises/01-Solutions.pdf">https://es.cs.uni-kl.de/teaching/vrs/exercises/01-Solutions.pdf</a> (slide 20)</p><p>You can also derive this rule on your own as a→b = ¬a ∨ b.</p><p>See also lecture slide 96 <a rel="nofollow" href="https://es.cs.uni-kl.de/teaching/vrs/slides/VRS-02-PropLogic-1.pdf">https://es.cs.uni-kl.de/teaching/vrs/slides/VRS-02-PropLogic-1.pdf</a></p><p></p>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/1868/sequent-calculus?show=1872#a1872Mon, 24 Aug 2020 10:45:11 +0000Answered: Exam ss14 4b
https://q2a.cs.uni-kl.de/1780/exam-ss14-4b?show=1781#a1781
Your solutions are shorter and can therefore be considered to be even better! Note, however, that it was not required to find the simplest solutions.* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/1780/exam-ss14-4b?show=1781#a1781Sat, 22 Aug 2020 11:04:15 +0000Answered: Automat (Automatentheorie)
https://q2a.cs.uni-kl.de/1739/automat-automatentheorie?show=1740#a1740
<blockquote><p>does it matter if we model a deterministic or non-deterministic automat</p></blockquote><p>Any exercise will state whether you should build a deterministic or non-deterministic automaton. If not, please ask and we will clarify this in the exam on the blackboard.</p><hr><blockquote><p>Is ending in a wrong state (not a final state) equivalent to reading letter σi in state si where no si+1 for this letter exists?</p></blockquote><p>No that are two different things: If a deterministic automaton is not in a final state after reading an input sequence, it simply means, that the input was "not accepted". That is a valid computation, since the automaton's job is to tell us whether an input sequence is accepted or not (is part of the described language or not). That is different from having no successor state. If there is no successor state (e.g. you read <em>'a'</em>, but there is no outgoing transition with <em>'a'</em>) then this is not a valid computation.</p><p>In deterministic automata this can't happen, since we must have exactly one outgoing transition for each symbol, for each state (take a look at the transition function \delta).</p><p>In non-deterministic automata this is ok, since the transition function \delta maps to a set of possible successors (which can be the empty set), and acceptance is defined via "exists a path ... " rather than one path.</p>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/1739/automat-automatentheorie?show=1740#a1740Fri, 21 Aug 2020 13:18:25 +0000Answered: Radix to Complement
https://q2a.cs.uni-kl.de/1729/radix-to-complement?show=1731#a1731
<blockquote><p>they add a 0 to the Radix-4 number and add a 'Z'</p></blockquote><p>The radix number is non-negative, but a complement number starting with 3 in base-4 is negative. By adding the leading zero we make sure that it is still non-negative. In general radix numbers can be extended with leading zeroes, without changing their value. Complement numbers that are non-negative can be extended with leading zeroes. And complement numbers that are negative can be extended with B-1.</p><hr><blockquote><p>Is this solution sufficient?</p></blockquote><p>If it says <em><strong>"give the computation steps"</strong> </em>and <strong><em>"don't use base-10 as intermediate"</em></strong>, you would need to provide more. But if not, then this solution is ok. In any case it is useful to write some of the computation steps. That way you can gain partial points even if the final answer is wrong.</p>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/1729/radix-to-complement?show=1731#a1731Fri, 21 Aug 2020 08:57:13 +0000Answered: Radix Subtraction
https://q2a.cs.uni-kl.de/1630/radix-subtraction?show=1633#a1633
<p>When i=2, we compute the following in the mentioned example:</p><pre> sm = +x[2] - (y[2] + c[2]) = +1 - (3 + 0) = +1 - 3 = -2</pre><p>Now, we have do compute division with remainder for computing q := sm / B and r := sm % B. These numbers are defined as those uniquely defined numbers that satisfy the following</p><pre> sm = q * B + r & 0 <= r < B</pre><p>Note that the division is an integer division, so the result is not 0.5</p><p>For sm = -2 and B = 4, we get -2 = -1 * 4 + 2, and hence, we have q=-1 and r=2, which then leads to</p><pre> c[3] = -(sm / B) = 1
s[2] = sm % B = 2</pre><p>For i=4, we compute</p><pre> sm = +x[4] - (y[4] + c[4]) = +1 - (1 + 1) = +1 - 2 = -1</pre><p>Again, we have to compute the integer division, and get q = -1 and r = 3 since we have sm = -1 = -1 * 4 + 3 & 0 <= 3 < 4. Hence, it continues with </p><pre> c[5] = -(sm / B) = 1
s[4] = sm % B = 3
</pre><p>Hint: You should have a look at the next slide, i.e., slide 40, where the problem with integer division is explained. Unfortunately, neither programming languages nor microprocessors did agree on a unique solution. </p>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/1630/radix-subtraction?show=1633#a1633Tue, 18 Aug 2020 12:54:33 +0000Answered: First digit of Radix number
https://q2a.cs.uni-kl.de/1628/first-digit-of-radix-number?show=1631#a1631
<p>The radix-10 number <[33]>10 is 33 in decimal and it is the radix-4 number <[201]>4. Radix-B numbers never need leading zeros unless you have to extend them to a certain number of digits. Leading zeros don't change the value of Radix-B numbers.</p><p>However, 33 in decimal is the 4-complement number <[0201]>4. Here, we need a leading zero, since otherwise, the number <[201]>4 would be -31. With 4-complement numbers leading digits 0,1 denote non-negative numbers, and leading digits 2,3 denote negative numbers.</p><div></div>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/1628/first-digit-of-radix-number?show=1631#a1631Tue, 18 Aug 2020 12:31:06 +0000Answered: KV- Diagram
https://q2a.cs.uni-kl.de/1609/kv-diagram?show=1613#a1613
<p>You are right. This is a mistake. for a=1, b=0, c=0, d=0 the formula should be false. You can also double check with the tools.</p><pre> ((d|a?d:(c->a))|((a?c:c)?d<->d:!b)->c)
⇔((0|1?0:(0->1))|((1?0:0)?0<->0:!0)->0)
⇔((1?0:1)|(0?0<->0:1)->0)
⇔(0|1->0)
⇔(1->0)
⇔0
</pre>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/1609/kv-diagram?show=1613#a1613Tue, 18 Aug 2020 09:38:34 +0000Answered: [DiRa] Shannon Normal Form
https://q2a.cs.uni-kl.de/1439/dira-shannon-normal-form?show=1440#a1440
Yes. Any notation is allowed that we can understand. Writing "if a then b else c" instead of "(a?b:c)" or (a=>b|c)" is fine. But you also need to understand the notation used in the given problems (but you may ask at the beginning if there should be unclarities).* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/1439/dira-shannon-normal-form?show=1440#a1440Fri, 14 Aug 2020 07:48:12 +0000Answered: Exercise 5.3 Graph Coloring
https://q2a.cs.uni-kl.de/954/exercise-5-3-graph-coloring?show=956#a956
<p>I think you are trying to encode a specific colouring directly into a formula. That is not the goal here. Instead we want a formula such that every satisfying assignment of that formula corresponds to a valid colouring and vice versa.</p><p>In order to successfully colour a graph we need to satisfy the following constraints:</p><ol><li>Each node gets exactly one colour</li><li>Adjacent nodes get different colours</li></ol><p>Try to break these constraints down into smaller chunks, translate each to a formula and combine them with conjunctions.</p><hr><p>For example if we have a node <strong>1</strong> and colours <strong>a b c </strong>we have the variables <strong>a1 b1 c1</strong>. The formula</p><p style="text-align:center"><strong>(a1 | b1 | c1)</strong></p><p>Enforces that at least one of <strong>a1 b1 c1</strong> must be true, meaning <strong>1</strong> gets at least one colour. The formulas</p><p style="text-align:center"><strong>(a1 -> !b1 & !c1) &<br>(b1 -> !a1 & !c1) &<br>(c1 -> !a1 & !b1) </strong></p><p>mean <em>"If one of <strong>a1 b1 c1 </strong>is true, then the other two must be false"</em>, meaning <strong>1</strong> gets at most one colour.</p><p>Now try to combine them and think which of the above constraints (1. or 2.) this is. For the other constraint you will have to consider the graph's structure (try adding some constraints for each edge).</p>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/954/exercise-5-3-graph-coloring?show=956#a956Wed, 03 Jun 2020 16:33:02 +0000Answered: Exercise Sheet5-A4-operator bases
https://q2a.cs.uni-kl.de/940/exercise-sheet5-a4-operator-bases?show=943#a943
Right! I guess you are confused as to what the problem is. Refer to slide 17/146 in propositional logic. There it is shown how the operators ! (negation), | (disjunction) and & (conjunction) are formulated using the entities in the set {(=>|), true, false} (i.e if-then-else operator (=>|) and boolean constants true and false). This proves that the set is a complete base (i.e. capable of formulating any boolean function).<br />
<br />
Similarly you have to construct ! (negation), | (disjunction) and & (conjunction) using the set F = {<->, false, |}, thus proving that F is a complete base too.<br />
<br />
Note that negation, disjunction and conjunction (denoted by ¬, v and ^ in slides) are denoted respectively by !, | and & in the exercise.* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/940/exercise-sheet5-a4-operator-bases?show=943#a943Wed, 03 Jun 2020 08:10:04 +0000Answered: Normalized Numbers on Sheet 3-39
https://q2a.cs.uni-kl.de/776/normalized-numbers-on-sheet-3-39?show=812#a812
<p>The goal of normalization is to give each number a unique representation. We achieve this by shifting the mantissa until the left most digit is not zero. At the same time the exponent is decrement to preserve the value. So for B=2 the mantissa must start with 1. Unfortunately this leaves a gap around 0. To fill this gap we allow denormalized numbers.</p><p>Imagine you are trying represent a number smaller than the smallest normalized number. You start off with a mantissa and should normalize it. You are going to shift it left while decrementing the exponent. At some point you can't decrement the exponent any more, because it has already reached 0, but the mantissa is still not starting with 1. Now you have a denormalized number.</p><hr><blockquote><p>Are all numbers with exp = 0 denormalized?</p></blockquote><p>That depends. In the process above (shift and decrement) you might reach exponent zero at the same time when the first bit of the mantissa is 1. Then you have a normalized mantissa and exponent zero. This becomes a problem when we make use of a hidden bit. Normalized numbers will have a hidden 1, while denormalized numbers will have a hidden 0. So we need some way of spotting denormalized numbers. IEEE 754 (slide 44, 45, 46) deals with this by reserving exponent zero for denormalized numbers. So there, yes, exponent zero means denormalized. But without a hidden bit you might have a normalized number with exponent zero.</p><hr><blockquote><p>[..] that the black numbers on Sheet 3-39 are denormalized</p></blockquote><p>If the representation makes use of a hidden bit, then yes all the black ones are denormalized. If this is a representation without hidden bit, then only the two innermost (left and right of zero) are denormalized.</p>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/776/normalized-numbers-on-sheet-3-39?show=812#a812Sat, 23 May 2020 22:43:17 +0000Answered: Frage zu Folie 2-26
https://q2a.cs.uni-kl.de/575/frage-zu-folie-2-26?show=577#a577
<p>You are right, the mentioned formula is not correct. The correct formula is as follows: </p><p><img alt="" src="https://q2a.cs.uni-kl.de/?qa=blob&qa_blobid=4318344371126846847" style="height:156px; width:760px"></p>* Other Teaching Fieldshttps://q2a.cs.uni-kl.de/575/frage-zu-folie-2-26?show=577#a577Sat, 09 May 2020 08:49:35 +0000