Harsh
Harsh
(Deemed To Be University)
A
Practical File
On
“Creative Problem Solving”
(270702)
SUBMITTED BY:
Harsh Gupta
0901AD211017
SUBMITTED TO :
Prof. Geetika Hazra
Prof. Khemchand Shakywar
INDEX
1 Dungeon
2 Chocolate
3 Palindromes
4 Leet Speek
5 Pizza Delivery
6 Cities
7 Spiders
8 Lost
9 4 Queens Problem
AIM:
Solution:
2. Initial Observation:
From the diagram, the token starts at position (3, 3) (row 3, column 3 if counted from top-left).
The white squares represent the accessible destinations.
Shaded squares block movement.
3. Strategy:
Identify all reachable white squares step by step.
Find the shortest path to any white square while avoiding shaded squares.
4. Step-by-Step Analysis:
Move 1: The token can move to:
o (3, 1) or (3, 5) (horizontally to the left or right).
o (1, 3) or (5, 3) (vertically up or down).
Each of these positions is on the edge of a group of white squares.
Move 2:
o From (3, 1), the token can reach further white squares on the first column, such as (1,
1).
o From (3, 5), it can reach other white squares in the last column.
o Similarly, from (1, 3) or (5, 3), the token can reach additional white squares.
Move 3:
o Continuing this process, the token can eventually reach white squares further away,
but it must avoid shaded squares.
5. Shortest Path Calculation:
By visually inspecting the grid:
o The minimum number of moves required to navigate from (3, 3) to the furthest
reachable white square is 8.
6. Conclusion:
The token requires a minimum of 8 moves to ensure it can reach any accessible white square
while adhering to the movement rules.
AIM:
Solution:
You and your friend take alternate bites from the block of chocolate.
Each bite consists of a selected square and all squares above and to the right of it.
The goal is to force your friend to take square 1 (the undesirable broccoli flavor square).
2. Objective:
Select a square such that no matter what your friend chooses next, they will eventually be
forced to eat square
9 10 11
5 6 71
The block is reduced after each bite, removing squares from the right and above the chosen
square.
4. Key Observations:
To avoid square 1, your friend will try to leave it as part of an isolated piece.
Your task is to strategically reduce the chocolate block such that square 1 cannot be avoided
in future turns.
(A) Square 5:
9 10 11
5 6 71
9 10 11
5 6 71
You are forced to take square 9, and your friend will take square 1. This does not work as the
optimal choice.
(B) Square 6:
9 10 11
5 6 71
9 10 11
5 6 71
You are forced to take square 9, and your friend will take square 1. This does not work as the
optimal choice.
(C) Square 9:
5 6 71
Your friend can then choose square 6, leaving:
9 10 11
5 6 71
You are forced to take square 5, and your friend will take square 1. This does not work as the
optimal choice.
9 10 11
5 6 71
9 10 11
5 6 71
You then take square 5, forcing your friend to take square 1. This works.
9 10 11
5 6 71
9 10 11
5 6 71
You are forced to take square 9, and your friend will take square 1. This does not work as the
optimal choice.
6. Conclusion:
The optimal choice is square 10 because it guarantees that your friend will eventually be
forced to eat square 1.
AIM:
Solution:
Go through the sequence and see if there are any consecutive three-digit palindromic triplets
in the initial sequence. A palindromic triplet takes the form ABAABAABA, where AAA and
BBB are digits.
In the sequence 294563011, there are no palindromic triplets initially.
We will try to increment certain digits to form palindromic sequences, which we can then
remove using Rule (i).
· Let’s examine each possible segment and determine where a single increment might create a
palindromic triplet:
· Digits 011: If we increment the first 000 to 111, we get 111, which is a palindromic
triplet.
By using Rule (ii) to increment the first 000 in 011 to 1, the sequence becomes 294563111.
Now we have the triplet 111 at the end of the sequence, which is palindromic. We can remove
111 using Rule (i).
The sequence becomes 294563.
Therefore, the minimum number of times Rule (ii) needs to be used to remove all digits from
the sequence 294563011 is 1.
Answer
AIM:
Solution:
To convert the sentence "They ate two great fortune cookies for tea." into leet speak
according to the given rules, let's apply each rule step-by-step and calculate the final count of
letters and digits.
Original Sentence
"Thy": 3 letters
"8": 1 digit
"2": 1 digit
"grt": 3 letters
"cks": 3 letters
"4": 1 digit
"t": 1 letter
Total Count:
Letters: 3 + 3 + 2 + 3 + 1 = 12
Digits: 1 + 1 + 1 + 1 = 4
So, the total count of letters and digits is 12 + 4 = 16.
Answer
AIM:
Solution:
To solve this problem accurately, we need to simulate the delivery route based on each
instruction and check if we end up with 11 unique houses, as intended. We’ll also be looking
for any instruction that might lead to an inconsistency, such as revisiting a house prematurely
or ending up in an invalid position.
Each instruction (F3, B1, F6, etc.) dictates how far to move forward or backward along the
lane of houses.
Since there's an error in one of the instructions, one of them will likely take us off track.
Step-by-Step Solution
We’ll apply each instruction one by one and track our current house. Here are the instructions
provided:
Observation: We have returned to House 2, which was already visited in Step 2. This
suggests an error, as we should be visiting a new house.
Conclusion: The 7th instruction (F1) is likely incorrect, as it leads us back to House 2, a
house we’ve already visited, disrupting the unique visitation requirement.
Answer
Option D: the 7th or 8th instruction (specifically, the 7th instruction F1).
Practical No. 6
AIM:
Solution:
To solve this riddle, let's analyse the distances between cities and try to determine the correct
sequence based on the distances provided.
City P to City Q = 6 km
City P to City R = 2 km
City P to City S = 3 km
City P to City T = 4 km
City Q to City R = 4 km
City Q to City S = 5 km
City Q to City T = 2 km
City R to City S = 6 km
City R to City T = 1 km
City S to City T = 1 km
In a circular layout:
Using the shortest paths between neighbouring cities, we can follow the sequence:
Start at City P
Go to City R
Go to City T
Go to City S
Go to City Q
Conclusion
The sequence is P, R, T, S, Q.
AIM:
Solution:
To solve this problem, let's go through each scenario and find the optimal value for xx that
minimizes classification errors.
Approach
For each possible odd value of xx, separate the spiders into "smaller than xx" (which should
ideally be boys) and "larger than xx" (which should ideally be girls).
Count the misclassifications: girl spiders smaller than xx and boy spiders larger than xx.
Select the value of xx that minimizes these errors for each scenario.
Scenario 1
Possible values of xx: 15, 17, 19, 21, 23, 25, 27, 29, 31
x=15x=15:
Girls > 15: 16, 20, 26, 28, 28, 30, 30, 30, 32 (8 girls correctly identified)
x=17x=17:
Girls > 17: 20, 26, 28, 28, 30, 30, 30, 32 (8 girls correctly identified)
x=19x=19:
Girls > 19: 20, 26, 28, 28, 30, 30, 30, 32 (8 girls correctly identified)
After analysing these and following values similarly, we find x=19x=19 results in the fewest
misclassifications for Scenario 1.
Sizes of boy spiders: 14, 14, 14, 18, 18, 22, 26, 26
Sizes of girl spiders: 16, 20, 20, 24, 24, 28, 28, 28
By analysing each xx value as before, the value x=21x=21 results in the fewest
misclassifications.
Scenario 3
Sizes of boy spiders: 16, 18, 20, 22, 26, 28, 32, 34, 40, 42
Sizes of girl spiders: 24, 26, 30, 36, 38, 42, 46, 48, 50
Possible values of xx: 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49
By analysing each xx value as before, the value x=35x=35 results in the fewest
misclassifications.
Final Answers
Scenario 1: x=19x=19
Scenario 2: x=21x=21
Scenario 3: x=35x=35
Practical No. 8
AIM:
Solution:
For each scenario, calculate the position based on the given directions and identify the
point where the missing R should be inserted.
Scenario 1:
Directions: R F F L F L F F F F F
Scenario 2:
Directions: R F L F R L F L F R F L F F R F R F F L F
Scenario 3:
Directions: R F R F F L F F R F F L F F F F L F F L F L F F F
Final Answers:
The 4 Queens Problem consists in placing four queens on a 4 x 4 chessboard so that no two
queens attack each other. That is, no two queens are allowed to be placed on the same row,
the same column or the same diagonal.
Step 1:
Put our first Queen (Q1) in the (0,0) cell .
‘x‘ represents the cells which is not safe i.e. they are under attack by the Queen (Q1).
Step 2:
Step 3:
Step 4:
Step 6:
Again there is no other safe cell in row 2, So backtrack again and remove queen ( Q2 )
from row 1.
Queen ( Q1 ) will be remove from cell (0,0) and move to next safe cell i.e. (0 , 1).
Step 7:
Step 8:
Step 9:
Step 10:
Step 1:
The set sptSet is initially empty and distances assigned to vertices are {0, INF, INF,
INF, INF, INF, INF, INF} where INF indicates infinite.
Now pick the vertex with a minimum distance value. The vertex 0 is picked, include it
in sptSet . So sptSet becomes {0}. After including 0 to sptSet , update distance values
of its adjacent vertices.
Adjacent vertices of 0 are 1 and 7. The distance values of 1 and 7 are updated as 4 and
8.
The following subgraph shows vertices and their distance values, only the vertices with finite
distance values are shown. The vertices included in SPT are shown in green colour
Step 2:
Pick the vertex with minimum distance value and not already included in SPT (not in
sptSET ). The vertex 1 is picked and added to sptSet .
So sptSet now becomes {0, 1}. Update the distance values of adjacent vertices of 1.
Step 3:
Pick the vertex with minimum distance value and not already included in SPT (not in
sptSET ). Vertex 7 is picked. So sptSet now becomes {0, 1, 7}.
Update the distance values of adjacent vertices of 7. The distance value of vertex 6
and 8 becomes finite ( 15 and 9 respectively).
Step 4:
Pick the vertex with minimum distance value and not already included in SPT (not in
sptSET ). Vertex 6 is picked. So sptSet now becomes {0, 1, 7, 6} .
Update the distance values of adjacent vertices of 6. The distance value of vertex 5
and 8 are updated.
We repeat the above steps until sptSet includes all vertices of the given graph. Finally, we get
the following S hortest Path Tree (SPT).