GATE 2025 Data Science and Artificial Intelligence (DA) Questions with Solutions

GATE 2025

65 questions

MCQ 35 · MSQ 18 · NAT 121-mark 30 · 2-mark 35

Questions 61–65 of 65

Q61Expectation, Variance and Covariance2 marksNAT
A bag contains 5 white balls and 10 black balls. In a random experiment, nn balls are drawn from the bag one at a time with replacement. Let SnS_n denote the total number of black balls drawn in the experiment. The expectation of S100S_{100} denoted by E[S100]=E[S_{100}] = _____ (Round off to one decimal place)

Q62Relational Algebra and Tuple Calculus2 marksNAT
Consider the following tables, Loan and Borrower, of a bank.

Loanloan_numbranch _ nameamountL11Banjara Hills90000L14Kondapur50000L15SR Nagar40000L22SR Nagar25000L23Balanagar80000L25Kondapur70000L19SR Nagar65000\begin{array}{c} \textbf{Loan}\\ \begin{array}{|c|c|c|} \hline \textbf{loan\_num} & \textbf{branch \_ name} & \textbf{amount} \\ \hline L11 & \text{Banjara Hills} & 90000 \\ \hline L14 & \text{Kondapur} & 50000 \\ \hline L15 & \text{SR Nagar} & 40000 \\ \hline L22 & \text{SR Nagar} & 25000 \\ \hline L23 & \text{Balanagar} & 80000 \\ \hline L25 & \text{Kondapur} & 70000 \\ \hline L19 & \text{SR Nagar} & 65000 \\ \hline \end{array}\end{array}

Borrowercustomer_nameloan_numAnandL11KarteekL11KarteekL14AnkitaL15GopalL19KarteekL22KarteekL23SunilL23SunilL25\begin{array}{c} \textbf{Borrower} \\ \begin{array}{|c|c|} \hline \textbf{customer\_name} & \textbf{loan\_num} \\ \hline \text{Anand} & \text{L11} \\ \hline \text{Karteek} & \text{L11} \\ \hline \text{Karteek} & \text{L14} \\ \hline \text{Ankita} & \text{L15} \\ \hline \text{Gopal} & \text{L19} \\ \hline \text{Karteek} & \text{L22} \\ \hline \text{Karteek} & \text{L23} \\ \hline \text{Sunil} & \text{L23} \\ \hline \text{Sunil} & \text{L25} \\ \hline \end{array}\end{array}

  Query: πbranch_name, customer_name(Loan⋈Borrower)÷πbranch_name(Loan)\pi_{\text{branch\_name, customer\_name}}(\text{Loan} \Join \text{Borrower}) \div \pi_{\text{branch\_name}}(\text{Loan})

where ⋈\Join denotes natural join. The number of tuples returned by the above relational algebra query is ________ (Answer in integer)

Q63Programming in Python2 marksNAT
Consider the following Python code snippet.  

    def f(a,b):
        if (a==0):
            return b
        if (a%2==1):
            return 2*f((a-1)/2,b)
        return b+f(a-1,b)
    print(f(15,10))
   
  The value printed by the code snippet is _________ (Answer in integer)

Q64Stacks, Queues and Linked Lists2 marksNAT
Consider the following pseudocode.  

    Create empty stack S
    Set x=0, flag=0, sum=0
    Push x onto S
    while (S is not empty){
        if (flag equals 0){
            Set x = x+1
            Push x onto S}
        if (x equals 8):
            Set flag=1
        if (flag equals 1){
            x = Pop(S)
            if (x is odd):
                Pop(S)
            Set sum = sum + x}
    }
    Output sum
  The value of sum output by a program executing the above pseudocode is ___________ (Answer in integer)

Q65Graph Theory and Graph Algorithms2 marksNAT
Consider a directed graph G=(V,E)G = (V, E), where V={0,1,2,...,100}V = \{0, 1, 2, ..., 100\} and E={(i,j):0<j−i≤2, for all i,j∈V}E = \{(i, j) : 0 < j - i \le 2, \text{ for all } i, j \in V\}. Suppose the adjacency list of each vertex is in decreasing order of vertex number, and depth-first search (DFS) is performed at vertex 0. The number of vertices that will be discovered after vertex 50 is ___________ (Answer in integer)