GATE CSE 2015 SET-2
Q41.
Let X and Y denote the sets containing 2 and 20 distinct objects respectively and F denote the set of all possible functions defined from X to Y. Let f be randomly chosen from F. The probability of f being one-to-one is ________.Q43.
The number of onto functions (surjective functions) from set x={1,2,3,4} to set Y={a,b,c} is __________.Q44.
Suppose you are provided with the following function declaration in the C programming language. int partition(int a[ ], int n); The function treats the first element of a[] as a pivot, and rearranges the array so that all elements less than or equal to the pivot is in the left part of the array, and all elements greater than the pivot is in the right part. In addition, it moves the pivot so that the pivot is the last element of the left part. The return value is the number of elements in the left part. The following partially given function in the C programming language is used to find the k^{th} smallest element in an array a[ ] of size n using the partition function. We assume k \leq n int kth_smallest(int a[], int n, int k) { int left_end = partition(a,n); if ( left_end+1 == k ){ return a[left_end]; } if ( left_end+1 > k ){ return kth_smallest( ________ ); } else { return kth_smallest( ________ ); } } The missing argument lists are respectivelyQ45.
Identify the correct order in which a server process must invoke the function calls accept, bind, listen, and recv according to UNIx socket API.Q46.
Consider a simple checkpointing protocol and the following set of operations in the log. (start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7); (checkpoint); (start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3), (write, T3, z, 7, 2); If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list?Q47.
Consider the following transaction involving two bank accounts x and y. read(x); x:=x-50; write(x); read(y); y:=y+50; write(y) The constraint that the sum of the accounts x and y should remain constant is that ofQ48.
Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU=1500 bytes). Size of UDP header is 8 bytes and size of IP header is 20 bytes. There is no option field in IP header. How many total number of IP fragments will be transmitted and what will be the contents of offset field in the last fragment?Q49.
Assume that the bandwidth for a TCP connection is 1048560 bits/sec. Let \alpha be the value of RTT in milliseconds (rounded off to the nearest integer) after which the TCP window scale option is needed. Let \beta be the maximum possible window size with window scale option. Then the values of \alpha and \beta areQ50.
Consider the following statements. I. The complement of every Turing decidable language is Turing decidable II. There exists some language which is in NP but is not Turing decidable III. If L is a language in NP, L is Turing decidable Which of the above statements is/are true?