Class 9: Chapter 2 Long Question Answers

Detailed solutions on Computational Thinking long questions for exam preparation.

Back to Chapter 2 Exercises

Class 9: Long Question Answers - Computational Thinking

Q1. Identify whether the given problems are Decision Problems, Counting Problems, or Search Problems. Write your answer in front of each problem given below:

  • a. Does a given binary string have an even number of zeros?
    Answer: Decision Problem (This requires a Yes or No answer).
  • b. Flipping a coin results in Heads or Tails. Flip a coin 20 times; how many different sequences of Heads and Tails are possible?
    Answer: Counting Problem (We are counting the total number of possible sequences).
  • c. Does a certain Java program say “yes” to an empty input?
    Answer: Decision Problem (The program will either say Yes or No).
  • d. How many ways can the letters of the word TRIANGLE be arranged?
    Answer: Counting Problem (We are determining the total number of ways to arrange the letters).
  • e. N-queens problem: where the goal is to place eight queens on a chessboard such that no queen attacks any other.
    Answer: Search Problem (We are searching for a suitable arrangement that satisfies all given constraints).

Q2. A student has to take one course of physics, one of science, and one of mathematics. He may choose one of 3 physics courses (P1, P2, P3), one of 2 science courses (S1, S2), and one of 2 mathematics courses (M1, M2). In how many ways can this student select the 3 courses he has to take?

Answer:

Total Number of Ways:

  • The student has 3 choices for physics, 2 choices for science, and 2 choices for mathematics.
  • Therefore, the total number of ways to choose the courses is:
  • 3 × 2 × 2 = 12 ways

Q3. Create an IPO chart which will accept the ages of four boys and calculate their total age and average age. The program must display both the total age and the average age.

Answer:

Input (I) Process (P) Output (O)
Ages of four boys (Age1, Age2, Age3, Age4) Calculate total age = Age1 + Age2 + Age3 + Age4
Calculate average age = Total Age / 4
Display total age
Display average age

Q4. Create an IPO chart of a scenario that allows a user to enter in two numbers. The operation to be performed is either addition, subtraction, multiplication, or division and accordingly the output should be given to the user.

Answer: In this question, we are required to create an IPO chart for a calculator-like scenario where the user inputs two numbers and selects an operation (addition, subtraction, multiplication, or division). The program will then give the output based on the selected operation.

Input (I) Process (P) Output (O)
Two numbers (A, B)
Operation (+, -, *, /)
Perform the selected operation:
- If addition, A + B
- If subtraction, A - B
- If multiplication, A × B
- If division, A ÷ B
Display the result

Q5. The child wants to plan a birthday party for their friend.

a) Draw an IPO chart of this situation.

Input (I) Process (P) Output (O)
Theme of the party, Guest list, Venue, Date, Decorations, Food & Drinks Plan the guest list, venue, and party
Arrange food and drinks
Organize activities
Successfully planned party

b) Write down properties on computational thinking.

  1. Decomposition: Break the problem into smaller parts, such as decorations, food management, guest invitations, etc.
  2. Abstraction: Ignore unnecessary details, such as minor decor arrangements, and focus on what is essential.
  3. Pattern Recognition: Use past experiences from other events or parties to make better decisions.
  4. Algorithm Design: Create a step-by-step plan to manage the entire event, from decorations to activities.