Q165: Encoding of a TM

Question 165: Suppose one transition of Turing machine

Encoding_TM_2

for some integers i, j, k, l and m is encoded in binary form as 0i 1 0j 1 0k 1 0l 1 0m. Here, X1 denotes 0, X2 denotes 1 for binary alphabet. Regarding direction, D1 = L and D2 = R. And, the code for entire TM M consists of all of the codes for the transitions C1, C2, … , Cn in some order separated by pairs of 1’s:

C1 1 1 C2 1 1 . . . . Cn-1 1 1 Cn

What will be the encoding of the following Turing machine as per above technique:

Encoding_TM_1

Options:

  1. 0101000101001100010101001001100010010010100110001000100010010
  2. 01001000101001100010101001001100010010010100110001000100010010
  3. 010010001010011000101010010011000100100101001110001000100101010
  4. 01001101001100010101001001100010010010100110001000100010010

Solution: The correct answer is the second one. The first transition is “0100100010100”, second transition is “0001010100100”, third transition is “00010010010100” and fourth is “0001000100010010”. They are all separated by “11”.

 

Q146: File access across machines: Nomenclature

Question #146: In context of distributed systems, file accesses may happen across machines.

The machine containing the files is the _______, and the machine wanting to access the files is the ______.

Options:

  1. Master, Slave
  2. Server, Client
  3. Memory, User
  4. None of these

Solution: The correct answer is the second one. In a distributed system, network file system can be used to access the files from another machine called server.

Q85: Which of the following graphs are planar?

image

Options:
1. Graph A only
2. Graph B only
3. Both the graphs
4. None of the two graphs

Solution: Graph A can be redrawn like this:

image

Hence it can be seen Graph A is planar. But Graph B isn’t planar. In fact this is complete graph on 5 vertices, called K5 and it is the graph with minimum number of vertices which isn’t planar. All graphs with less number of vertices are planar. Correct option is 1.

Q83: Process Control Block

Question 83: Context switches among processes are expensive. Before a process can be switched its process control block (PCB) must be saved by the operating system. Which of the following is not part of PCB?

Options:

  1. Program Counter
  2. CPU Registers
  3. I/O Status Information
  4. Number of kernel level threads in this process.

Solution: Each of the options depict something that is process specific. But notice that kernel level threads are managed by kernel, and the user process is not responsible for these. Hence this information is not needed to be saved by the process. Hence  the correct option is the fourth one.