0% found this document useful (0 votes)
37 views

PS Assignment 2

The document presents solutions to four problems: covering a grid with triominoes, solving knights and knaves puzzles, the Tower of Hanoi, and identifying a counterfeit coin. Each problem includes definitions, base cases, inductive steps, and formulas for calculations. The document provides logical reasoning and methods for solving each problem effectively.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

PS Assignment 2

The document presents solutions to four problems: covering a grid with triominoes, solving knights and knaves puzzles, the Tower of Hanoi, and identifying a counterfeit coin. Each problem includes definitions, base cases, inductive steps, and formulas for calculations. The document provides logical reasoning and methods for solving each problem effectively.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment – 2

Samarth Bahuguna

Batch-68

590017956

Problem 1: Covering a Grid with Triominoes

The task is to fill a grid of size 2n×2n2^n \times 2^n2n×2n with L-shaped tiles (triominoes),
leaving one square uncovered.

1. What’s a Triomino?
A triomino is an L-shaped tile that covers exactly 3 squares.
2. Base Case:
For n=0n = 0n=0, the grid is 1×11 \times 11×1. Since it’s already just one square, no
triominoes are needed.
3. Inductive Step:
Let’s assume that for any grid of size 2n×2n2^n \times 2^n2n×2n, we can cover all but
one square using triominoes. Now, let’s prove it for 2n+1×2n+12^{n+1} \times
2^{n+1}2n+1×2n+1:
o Divide the large grid into four smaller grids of size 2n×2n2^n \times 2^n2n×2n.
o One of these smaller grids has the pre-filled square (the uncovered square).
o Place one triomino at the center to cover one square from each of the other three
smaller grids.
o Now, each smaller grid can be solved individually using the assumption.
4. Conclusion:
By repeating this process, any 2n×2n2^n \times 2^n2n×2n grid with one square
uncovered can be completely filled with triominoes.

How Many Triominoes Are Needed?


The total number of squares in a grid is 2n×2n2^n \times 2^n2n×2n. Subtract 1 for the uncovered
square, and divide by 3 (since each triomino covers 3 squares):

Triominoes needed=(2n×2n)−13.\text{Triominoes needed} = \frac{(2^n \times 2^n) -


1}{3}.Triominoes needed=3(2n×2n)−1.
Problem 2: Knights and Knaves

Knights always tell the truth. Knaves always lie. Let’s solve some puzzles to figure out who is
who.

1. Rohan and Sahil:


o Sahil says: "Rohan lies."
o Rohan says: "Sahil is not my kind of person."
o If Sahil is a Knight (truthful), then Rohan must be a Knave (liar).
o Sahil’s statement fits, so Sahil is a Knight, and Rohan is a Knave.
2. A, B, C, and D:
o After analyzing their statements step by step:
 A and D are Knaves (liars).
 B and C are Knights (truth-tellers).
3. Ram and Shyam:
o Ram says: "We are both Knaves."
o If Ram were a Knight, his statement would contradict itself.
o So, Ram must be a Knave, and Shyam must be a Knight.
4. Two People (Same or Different):
o The first person says: "We are the same type."
o The second person says: "We are different types."
o If the first person were truthful, the statements would contradict.
o So, the first person is a Knave (lying), and the second is a Knight (truthful).
Problem 3: Tower of Hanoi

Move all disks from a source tower to a destination tower, following these rules:

1. Only one disk can be moved at a time.


2. A larger disk can’t go on top of a smaller one.
3. You can use a support tower.
4. Base Case:
With 1 disk, just move it directly to the destination. This takes 1 step.
5. For More Disks:
o Move n−1n-1n−1 disks to the support tower.
o Move the largest disk to the destination tower.
o Move the n−1n-1n−1 disks from the support tower to the destination.
6. How Many Moves Are Needed?
The formula is:

T(n)=2n−1.T(n) = 2^n - 1.T(n)=2n−1.

For example, if n=3n = 3n=3, the minimum moves needed are 23−1=72^3 - 1 = 723−1=7.
Problem 4: Counterfeit Coin

You have coins, and one is counterfeit (either heavier or lighter). Use a balance scale to find the
fake coin.

1. 8 Coins:
o Divide into three groups: 3, 3, and 2.
o Weigh the two groups of 3:
 If balanced, the fake coin is in the group of 2. Weigh those to find the
counterfeit.
 If unbalanced, the fake coin is in the lighter or heavier group. Narrow it
further by weighing 2 coins from the suspicious group.
2. Larger Groups (e.g., 55 Coins):
o Divide the coins into three groups of roughly equal size.
o Use the balance to eliminate 2/32/32/3 of the coins at each step.
o Repeat until only the fake coin remains.

Formula for Minimum Weighings:


The minimum number of weighings is approximately:

w=⌈log⁡3(n)⌉w = \lceil \log_3(n) \rceilw=⌈log3(n)⌉

For 55 coins, it would take about 4 weighings.

You might also like