Skip to content

CT Week 10 Graded Assignments IIT Madras

 

Computational Thinking week 10 graded assignment Complete  Solutions Are Discussed In This Blog. We Hope This Might Help You All In Matching Answers . Or For Some Others Reasons If Not Able To Complete Graded Assignments 

1.The following pseudocode is executing using the “Scores” table. At the end of the execution, matrix represents the adjacency matrix of the graph generated from the “Scores” table.

 
 
 

 

 
5 points

If matrixPh[i] [j] = 1, then

i scored at most 10 and at least 20 more marks in Physics than j

 

i scored at least 10 and at most 20 more marks in Physics than j

 

j scored at least 10 and at most 20 more marks in Physics than i

 

j scored at most 10 and at least 20 more marks in Physics than i

 

 
5 points
2.Choose the correct statement based on above pseudocode.

 

For all ij with i 

 jmatrixPh[i][j] + matrixPh[j][i] = 1

 

 

 

For all i, j with i 

 j, if matrixPh[i][j] = 1 then matrixPh[j][i] = 0

 

 

 

For all i, j with i 

 j, if matrixPh[i][j] = 0 then matrixPh[j][i] = 1

 

 

 

For all i, j with i 

 j, if matrixPh[i][j] = 1 then matrixPh[j][i] = 1

 

 

 

For all i, j with i 

 j, if matrixPh[i][j] = 0 then matrixPh[j][i] = 0

 

 

 
5 points
 

3.Consider the dictionary D, and the matrices matrixPhmatrixCh and matrixMa computed in the previous question. The following pseudocode generate the adjacency matrix matrixHelp.

 
 
 

 

Let i and j be indices of two students. Choose the correct statement(s) from the given options. It is a Multiple Select Question (MSQ)

 

0 <= matrixHelp[i][j] <= 3

 

matrixHelp[i][j] + matrixHelp[j][i] <= 3

 

 

matrixHelp[i][j] 

 matrixHelp[j][i]

 

 

if matrixHelp[i][j] = 0, then matrixHelp[j][i] = 3

 

if matrixHelp[i][j] = 3, then matrixHelp[j][i] = 0

 

 
5 points
 

4.At the end of the following pseudocode, A captures the number of distinct pairs of students who can help each other in at least one subject, and B captures the number of distinct pairs of students where one can help the other in all subjects. Choose the correct code fragment to complete the pseudocode.

 
 
 

 

 

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

Question (5-8)
The following table contains information regarding books in a library. Each entry in the table corresponds to a book and is authored by at least two authors. There is a pool of n authors, each author being assigned a unique index between 0 and n − 1. There are M books in total.

The table is represented by a dictionary named books, with the keys as serial numbers and values as the corresponding list of authors. Assume that books has already been computed. For example, we have: books[0] = [0, 2, 3]. Consider the followig question.

 
5 points
 

4.The following pseudocode generates a graph G from books. Each node corresponds to an author. There is an edge between two different authors i and j if they have co-authored a book, and the edge is labeled with the number of books they have co-authored. Choose the correct code fragment to complete the following pseudocode.

 
 
 

 

 

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 
5 points
 

5.The following pseudocode creates adjacency matrix matrix2 of another graph H from books. For two different authors i and j, what does the value matrix2[i][j] represent at the end of the execution?

 
 
 

 

 

List of authors who have co-authored a book with both i and j

 

List of authors who have co-authored a book with either i or j

 

List of authors who have co-authored at least two book with both i and j

 

List of authors who have co-authored at least two book with either i or j

 

 
5 points

6.Which of the following combinations of entries in matrix and matrix2 is possible for two different authors i and j? It is Multiple Select Question (MSQ).

matrix[i] [j] = 0 and matrix2[i] [j] = [ ]

 

 

matrix[i][j] = 0 and matrix2[i][j] 

 [ ]

 

 

matrix[i][j] > 0 and matrix2[i][j] = [ ]

 

 

matrix[i][j] > 0 and matrix2[i][j] 

 [ ]

 

 

 
5 points

Consider the matrices matrix and matrix2 constructed in the previous questions.

findAuthor(matrix) finds an author who has the maximum number of co-authors. Choose the correct implementation of the procedure findAuthor. It is a Multiple Select Question.

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

Question (9-10)

The following pseudocode is executing using the “Shopping bills” dataset. Each customer is being assigned a unique index between 0 and n − 1. Dictionary D has already been computed with keys as index and values as list of distinct shops visited by the corresponding customer. Assume that there exists a procedure intersection which takes two lists as input and outputs another list which contains the common elements in the input lists.

 
 
 

 

 
5 points
 

Consider the adjacency matrix matrix constructed above. Assume that there exists a procedure removeDuplicate which receives a list as input and removes all duplicate elements in the list. When will findGoodSet(matrix) return True?

 
 
 

 

 

If there exists three customers who have visited all three shops.

 

If there exist three customers such that every pair of customers among them have visited only one and the same shop in common.

 

If there exists three customers who have visited exactly one shop.

 

If there exists three customers where each pair among them have visited exactly one shop in common.

 

 
5 points

10.For a pair of customers i and jj is said to be shopping partner of i if i and j have visited at least two shops in common. findTopCustomer(matrix) finds a customer who has the maximum shopping partners. Choose the correct implementation of findTopCustomer.

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

 
 
 

 

 

 

 

 

 

4 thoughts on “CT Week 10 Graded Assignments IIT Madras”

Leave a Reply

Your email address will not be published. Required fields are marked *