Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
aa:lab:03 [2020/10/21 12:12]
pdmatei [1. Accepting and deciding a decision problem]
aa:lab:03 [2020/10/23 14:43] (current)
pdmatei
Line 9: Line 9:
 ==== 1. Accepting and deciding a decision problem ==== ==== 1. Accepting and deciding a decision problem ====
  
-**1.1** Can the problem $math[f(w) = 0] (for all w in Sigma*) be accepted by a Turing Machine?+**1.1** Can the problem $math[f(w) = 0] (for all w in $math[\Sigma^*]) be accepted by a Turing Machine?
  
 **1.2** Can a problem be accepted by two different Turing Machines? **1.2** Can a problem be accepted by two different Turing Machines?
Line 15: Line 15:
 **1.3** Can a Turing Machine accept two different problems? **1.3** Can a Turing Machine accept two different problems?
  
-**1.4** Write a Turing Machine which accepts the problem $math[f(x) = 1] iff x (as binary) is odd, but does **NOT** decide it.+**1.4** Write a Turing Machine which accepts the problem $math[f(x) = 1] iff x (encoded ​as binary ​word) is odd, but does **NOT** decide it.
  
 **1.5** ​ Which of the following problems you think can be accepted and which can be decided? Use pseudocode instead of writing a TM. **1.5** ​ Which of the following problems you think can be accepted and which can be decided? Use pseudocode instead of writing a TM.
Line 25: Line 25:
     * $math[x^4+y^4+z^4=w^4]     * $math[x^4+y^4+z^4=w^4]
     * $math[3x^2-2xy-y^2z-7=0]     * $math[3x^2-2xy-y^2z-7=0]
 +  * The decision problem we are interested in is: //Given a diophantine equation, does it have at least one solution//?
 +
 +**Linear Integer Programming**
 +  * You are given a set of arithmetic **constraints** over integers, and try to find if a solution to the constraints exists.
 +  * Example:
 +    * $math[y-x\leq 1]
 +    * $math[3x+2y\leq 12]
 +    * $math[2x+3y\leq 12]
 +
 +**Wang Tiles**
 +  * Wang tiles are squares where each **side** has a specific color. An example is given below.
 +{{ :​aa:​lab:​wang_11_tiles.svg.png?​200 |}}
 +  * Wang tiles can be used to tile surfaces, but each tile must be placed such that adjacent tiles have the **same color side**.
 +  * The wang tiling decision problem is: //Is it possible to tile the plane (an infinite surface) with a given set of tiles//?
 +
 +**k-color**
 +  * You are given a undirected graph and a number of ''​k''​ colors. Is it possible to assign a color to each node such that **no adjacent** (connected by an edge) nodes have the same color?
  
-    * Hilbert undecidable 
-    * Wang Tile 
-    * k-color 
-    * Linear Integer Progra 
-mming 
  
 ==== 2. Complement ==== ==== 2. Complement ====
  
-**2.1** What is the complement of the previous ​problem?+**2.1** What is the complement of the problem ​from Exercise 1.1 ?
  
 **2.2** What is the complement of k Vertex Cover? **2.2** What is the complement of k Vertex Cover?
Line 40: Line 52:
 **2.3** If a problem is decided by some TM, can its complement be decided? **2.3** If a problem is decided by some TM, can its complement be decided?
  
-**2.4** If a problem is accepted by some TM, can its complement be decided?+**2.4** If a problem is accepted by some TM, can its complement be accepted?
  
 ==== 3. Turing Machine pseudocode ==== ==== 3. Turing Machine pseudocode ====
Line 50: Line 62:
 Suppose M is encoded on binary words, and also working on binary words, for simplicity. Suppose M is encoded on binary words, and also working on binary words, for simplicity.
  
 +/* Solution:
 <​code>​ <​code>​
 Pseudocode(M):​ <- input Pseudocode(M):​ <- input
Line 62: Line 75:
         repeat the same process all over         repeat the same process all over
 </​code>​ </​code>​
 +
 +*/
  
 **3.2** Which of the following pseudocode is a proper Turing Machine? Explain why. **3.2** Which of the following pseudocode is a proper Turing Machine? Explain why.