Unit 2 Computational Thinking & Algorithms
Answer:
Each boy can be paired with any of the 3 girls.
So, using the Multiplication Principle:
→ 3 boys × 3 girls = 9 possible pairings
Total number of ways = 9
Answer:
You are choosing 1 pant (fixed) and 1 out of 3 shirts.
→ 1 × 3 = 3 ways to dress up
Total number of ways = 3
Answer:
Use Addition Principle because you can use only one item at a time.
→ 2 (blue pens) + 1 (black pen) + 2 (pencils) = 5 options
Total number of writing options = 5
Answer:
This is a permutation problem where order matters.
→ Use the formula:
P(n,r) = (n!)/(n-r)!
Where:
n = 20 students, r = 6 selected
P(20,6)= 20!/(20-6)! = 20×19×18×17×16×15=27,907,200
Total number of different orders = 27,907,200
a) Javeria is standing directly behind Ejaz.
b) Zainab is not next to Liaqat.
c) Liagat is not at the end of the line.
d) Zainab is standing in the first position.
In which order are they standing?
Answer:
Based on these, one valid order is:
Zainab, Ejaz, Liaqat, Javeria
Answer:
Answer:
Example problem: Calculate the area of different shapes (circle, rectangle, triangle)
Break it into functions:
This demonstrates modular design and abstraction:
Form Inputs:
> Name: Amjad Ali > Email: amjadali@gmail > Date: 01/01/2024
Answer:
Syntax Error Identified:
Corrected Inputs:
Budget Example:
Rent: $1000
Utilities: $150
Groceries: $200
Total: $1000 + $150 + $200 = $1500
Answer:
Logical Error Identified:
The application logic is flawed — either a calculation error or incorrect value assignment.
1. Identify the activity that is based on personal preferences rather than algorithmic logic.
a) Sorting numbers in a list.
b) Deciding what to eat for dinner.
c) Determining if a number is a prime number.
d) Calculating the square root of a number.
2. Counting Principle Problems could easily be understood by the use of
a) Graph representation
b) Tree representation
c) Clock representation
d) Map representation
3. In how many ways can you choose 2 out of 5 different books to take on a trip? (Order does not matter)
a) 10
b) 20
c) 15
d) 5
4. A committee of 3 members is to be selected from a group of 8 people. How many different committees can be formed?
a) 56
b) 84
c) 28
d) 120
5. You have 5 different shirts and 4 different pants. How many different outfits can you make by choosing one shirt and one pair of pants?
a) 9
b) 20
c) 15
d) 10
6. In how many ways can you select 3 different fruits from a basket of 7 different fruits? (Order does not matter)
a) 35
b) 21
c) 56
d) 84
7. The Pigeonhole Principle states that if more items are placed into containers than the number of containers, then:
a) Some containers must be empty
b) At least one container must hold more than one item
c) All containers will be full
d) Each item will be placed in a different container
8. In a set of 50 students, 30 have completed a math project, 25 have completed a science project, and 15 have completed both. How many students have completed at least one project?
a) 35
b) 40
c) 45
d) 50
9. Which property of an algorithm ensures that it produces at least one output after the calculations?
a) Input
b) Output
c) Definiteness
d) Finiteness
10. Which property ensures that an algorithm will eventually end after a finite number of steps?
a) Input
b) Finiteness
c) Effectiveness
d) Generality
Unit 2: Computational Thinking & Algorithms
Unit 8: Entrepreneurship in Digital Age Write answers of the following short response questions. Q.1.…
Unit 7: Digital Literacy Write answers of the following short response questions. Q.1. Differentiate between…
Unit 6: Impacts of Computing Write answers to the following short response questions. Q1. List…
Unit 5: Applications of Computer Science Write answers of the following short response questions. Q1.…
10th Computer Science Unit 4 Data and Analysis Write answers of the following short response…
10th Computer Unit 3: Programming Fundamentals Unit 3: Programming Fundamentals Write answers of the following…