Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
BSCS1001 · Computational Thinking
End Term · 13 Apr 2025 (Forenoon)
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
- Q1MCQ5 Marks·Choose one option

- ADictionary with words as keys mapped to the number of sentences in which the word is present.
- BDictionary with words as keys mapped to the frequency count of the word in the dataset.
- CDictionary with words as keys mapped to the maximum frequency of the word in a sentence.
- DDictionary with words as keys mapped to the number of sentences in which the word is present more than one time.
- Q2MCQ5 Marks·Choose one option

- AA = Number of cities where students score the highest marks in Mathematics B = The highest marks in Mathematics
- BA = Number of cities where students score the lowest marks in Mathematics B = The highest marks in Mathematics
- CA = Cities where students score the lowest marks in Mathematics B = The lowest marks in Mathematics
- DA = Number of cities with the highest Mathematics scores B = The lowest marks in Mathematics
- Q3MCQ5 Marks·Choose one option

- A0
- B2
- C4
- D6
- Q4MCQ5 Marks·Choose one option

- AA dictionary where each city maps to the highest total marks scored and the corresponding student's name.
- BA dictionary where each city maps to the lowest total marks scored and the corresponding student's name.
- CA dictionary where each city maps to the lowest total marks recorded in that city.
- DNone of these
- Q5MCQ6 Marks·Choose one option

- Athey are from different cities/towns
- Bthey have the same gender
- Cthey are from the same cities/towns or have the same gender
- Dthey are from the same cities/towns but have different genders
- Q6MCQ6 Marks·Choose one option

- Aj scored at most 20 and at least 30 more marks in Chemistry than i
- Bi scored at most 20 and at least 30 more marks in Chemistry than j
- Ci scored at least 20 and at most 30 more marks in Chemistry than j
- Dj scored at least 20 and at most 30 more marks in Chemistry than i
- Q7MSQ5 Marks·Choose all correct options

- AoutList represents a list of lists
- BEach element in outList represents a list containing words and their parts of speech from a sentence except for the nouns
- CEach element in outList corresponds to one character from the paragraph
- DEach element in outL ist represents the words from a sentence that have part of speech 'noun'
- Q8MSQ5 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q9MSQ4 Marks·Choose all correct options
Let D be a non-empty dictionary defined as: D = { "x": [10, 20, 30], "y": [5, 15, 25], "z": { "a": 100, "b": 200 }, "w": "a" } Choose the correct option(s). It is a Multiple Select Question (MSQ).
- AThe expression first(D["x"]) + last(D["y"]) evaluates to 35.
- BThe expression init(D["z"]) returns "a":100.
- CThe expression length(keys(D)) returns 4.
- DThe expression first(rest(D["x"])) returns 30.
- Q10MSQ6 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q11NAT5 Marks·Write the number
Your answer: - Q12NAT5 Marks·Write the number
Your answer: Read the passage below, then answer Q13–Q14

Based on the above data, answer the given subquestions.
Q13MCQ4 Marks·Choose one option
- ARevenue generated by item j for shop i
- BRevenue generated by item i for shop j
- CCost of item i in shop j
- DCost of item j in shop i
- Q14MCQ4 Marks·Choose one option
What will costD[i] represent at the end of the execution?
- AList of item(s) which generated highest revenue for shop i
- BList of item(s) which generated lowest revenue for shop i
- CList of cost of most sold item(s) in shop i
- DList of cost of least sold item(s) in shop i
Read the passage below, then answer Q15–Q16
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].
Based on the above data, answer the given subquestions.
Q15MCQ5 Marks·Choose one optionThe following pseudocode generates a graph G from books. Each node corresponds to an author. There is an edge between two different authors j and k 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.

- A

- B

- C

- D

- A
- Q16MCQ5 Marks·Choose one option
The following pseudocode creates adjacency matrix matrix2 of another graph H from books. For two different authors j and k, what does the value matrix2[j] [k] represent at the end of the execution?

- AList of authors who have co-authored a book with both j and k
- BList of authors who have co-authored a book with either j or k
- CList of authors who have co-authored at least two book with both j and k
- DList of authors who have co-authored at least two book with either j or k
Read the passage below, then answer Q17–Q18
Let M be an adjacency matrix of a graph G given below, where M[i][j] = 1 if there is an edge from i to j, otherwise 0.
ListV represents the list of vertices of the graph G.

Based on the above data, answer the given subquestions.
Q17MCQ5 Marks·Choose one option
- Ap = 0, q = 0
- Bp = 1, q = 0
- Cp = 0, q = 1
- Dp = 1, q = 1
- Q18MCQ5 Marks·Choose one option

- A1
- B2
- C3
- D4
Read the passage below, then answer Q19–Q20
The following pseudocode is executed using the “Scores” dataset. Two students form a study pair if their difference in Mathematics marks are at most 10. Assume that Pile P1 is always restored back after calling studyPair(Pile P1).

Based on the above data, answer the given subquestions.
Q19MCQ5 Marks·Choose one optionWhat will count1 represent at the end of execution?
- ANumber of study pairs
- BNumber of pairs of study pair
- CNumber of students who formed study pairs
- DNumber of study pairs from the same city
- Q20MCQ5 Marks·Choose one option
What will count3 represent at the end of execution?
- ANumber of study pairs where at least one student in the pair is not from the cities Chennai, Bengaluru, and Vellore
- BNumber of study pairs where both students in the pair are not from the same city among Chennai, Bengaluru and Vellore
- CNumber of study pairs where both students in the pair are from the same city among Chennai, Bengaluru and Vellore
- DNone of these