SlideShare a Scribd company logo
1 of 15
DIVIDE AND CONQUER ALGORITHM
CHESS BOARD PROBLEM-
DIVIDE AND CONQUER
The Defective Chessboard Problem
GIVEN CONDITIONS:-
1. We have a chessboard of size n x n , where n =2k
2. Exactly on square is defective in the chessboard.
3. The tiles(trominoes) are in L-shape i.e. 3 squares.
OBJECTIVE
Cover all the chessboard with L-shape tiles(trominoes), except the defective square.
Is it possible to solve this?
Absolutely, it is possible to cover all non-defective squares.
Let’s see how
• As the size of the chessboard is n x n and n=2k
• Therefore, Total no. of squares =2k x2k =22k
• No. of non-defective squares = 22k-1
• Now, for the value of K,22k-1 is divisible by 3.
• For E.g. K=1 , 22(1)-1 =3 is divisible by 3.
• K=2, 22(2) -1 =15 is divisible by 3.
Defective chessboards.
1x1 2 x2 2 x2 2 x2 2 x2
As the Size of these chessboards displayed here, 1x1 and 2x2 we don’t have to place any L-shape tile in the first and
rest can be filled by just using 1 L-shaped tile.
For 4x 4 chessboard.
8X8 DEFECTIVE CHESS BOARD
Step-1 One of the cell is
defective
Step- 2 We divide the chess board
into equal sub half's.
Creation of defective box
Step- 3 Trick to cover the chess
board with tiles
Step -4 Again creation of defective boxes
as we divide the chess board
DIVISION OF
PROBLEM INTO SUB
PROBLEM
Step-5 As we have finally
divided the problem into 2x2
board we will put the tiles.
Step-6 The procedure will
continue until all the sub board
are covered with the tiles.
Step-7 The final chess board covered
with all the titles and only left with the
defectives which we created.
Step-7 Here we will cover the
defectives which we have created as in
the last, there should be only one
defective left.
COMBINIG OFALL SUB
PROBLEMS
8x8
4x4 4x4
4x44x4
2x2
2x2
2x2
4x4
2x2
1x1 2x2 4x4 8x8
ALGORITHIM
1. For a 2x2 board with defective cell we just need to
add the single tile to it.
2. We will place a L shape tile in the middle such that
it does not cover the sub square in which there is
already defective. All the cell have a defective cell.
3.Repeat this process recursively till we have a 2x2
board.
Time Complexity For Defective Chess Board
Problem
T(n) =4T(n/2) +C
By Using Master Theorem,
T(n) =a T(n/b) + Theta(n k log p n ),a>=1,b>1,k>=0 & p is real number.
a=4,b=2,k=0,p=0
a>bk => 4 >20
Case1: If a>bk , then T(n) =Theta(nlog b a).
After putting the values of a and b the Time complexity for this problem
= n2.

More Related Content

What's hot

0/1 knapsack
0/1 knapsack0/1 knapsack
0/1 knapsackAmin Omi
 
Analysis modeling & scenario based modeling
Analysis modeling &  scenario based modeling Analysis modeling &  scenario based modeling
Analysis modeling & scenario based modeling Benazir Fathima
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler designSudip Singh
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithmMohd Arif
 
Importance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML DesigningImportance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML DesigningABHISHEK KUMAR
 
Algorithm and pseudocode conventions
Algorithm and pseudocode conventionsAlgorithm and pseudocode conventions
Algorithm and pseudocode conventionssaranyatdr
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy methodhodcsencet
 
Boyer moore algorithm
Boyer moore algorithmBoyer moore algorithm
Boyer moore algorithmAYESHA JAVED
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Data Integration and Transformation in Data mining
Data Integration and Transformation in Data miningData Integration and Transformation in Data mining
Data Integration and Transformation in Data miningkavitha muneeshwaran
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignmentKarthi Keyan
 
Allocation of Frames & Thrashing
Allocation of Frames & ThrashingAllocation of Frames & Thrashing
Allocation of Frames & Thrashingarifmollick8578
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGJothi Lakshmi
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmGaurav Kolekar
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazationSiva Sathya
 

What's hot (20)

Merge sort algorithm
Merge sort algorithmMerge sort algorithm
Merge sort algorithm
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
0/1 knapsack
0/1 knapsack0/1 knapsack
0/1 knapsack
 
Analysis modeling & scenario based modeling
Analysis modeling &  scenario based modeling Analysis modeling &  scenario based modeling
Analysis modeling & scenario based modeling
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler design
 
Backtracking
Backtracking  Backtracking
Backtracking
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
 
Importance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML DesigningImportance & Principles of Modeling from UML Designing
Importance & Principles of Modeling from UML Designing
 
Algorithm and pseudocode conventions
Algorithm and pseudocode conventionsAlgorithm and pseudocode conventions
Algorithm and pseudocode conventions
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
 
Boyer moore algorithm
Boyer moore algorithmBoyer moore algorithm
Boyer moore algorithm
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Data Integration and Transformation in Data mining
Data Integration and Transformation in Data miningData Integration and Transformation in Data mining
Data Integration and Transformation in Data mining
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
Allocation of Frames & Thrashing
Allocation of Frames & ThrashingAllocation of Frames & Thrashing
Allocation of Frames & Thrashing
 
N queens using backtracking
N queens using backtrackingN queens using backtracking
N queens using backtracking
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithm
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
 

Similar to Chess board problem(divide and conquer)

ICPC 2015, Tsukuba : Unofficial Commentary
ICPC 2015, Tsukuba: Unofficial CommentaryICPC 2015, Tsukuba: Unofficial Commentary
ICPC 2015, Tsukuba : Unofficial Commentaryirrrrr
 
Alg 2 completing the square
Alg 2 completing the squareAlg 2 completing the square
Alg 2 completing the squareR Thomas
 
Applications of ode and matrices soluti0n
Applications of ode and matrices soluti0nApplications of ode and matrices soluti0n
Applications of ode and matrices soluti0nFaizan Shabbir
 
7.12 notes a
7.12 notes a7.12 notes a
7.12 notes ambetzel
 
completing_the_square.pptx
completing_the_square.pptxcompleting_the_square.pptx
completing_the_square.pptxJenilynEspejo1
 
(8) Lesson 2.2 - Solve Two-Step Equations
(8) Lesson 2.2 - Solve Two-Step Equations(8) Lesson 2.2 - Solve Two-Step Equations
(8) Lesson 2.2 - Solve Two-Step Equationswzuri
 
Math Short Tricks ( english)
Math Short Tricks ( english)Math Short Tricks ( english)
Math Short Tricks ( english)Exam Affairs!
 
Mathematics high school level quiz - Part I
Mathematics high school level quiz - Part IMathematics high school level quiz - Part I
Mathematics high school level quiz - Part IITfC-Edu-Team
 
Backtracking Basics.pptx
Backtracking Basics.pptxBacktracking Basics.pptx
Backtracking Basics.pptxsunidhi740916
 
Introduction to Invariance Principle
Introduction to Invariance PrincipleIntroduction to Invariance Principle
Introduction to Invariance PrincipleFreeman Cheng
 
10) Equations with Brackets.ppt
10) Equations with Brackets.ppt10) Equations with Brackets.ppt
10) Equations with Brackets.pptBalvinder4
 
MATH 6-Q1-WEEK_7.pptx
MATH 6-Q1-WEEK_7.pptxMATH 6-Q1-WEEK_7.pptx
MATH 6-Q1-WEEK_7.pptxLuisSalenga1
 
Fourth level block 1 formal homework
Fourth level block 1 formal homeworkFourth level block 1 formal homework
Fourth level block 1 formal homeworksjamaths
 

Similar to Chess board problem(divide and conquer) (20)

ICPC 2015, Tsukuba : Unofficial Commentary
ICPC 2015, Tsukuba: Unofficial CommentaryICPC 2015, Tsukuba: Unofficial Commentary
ICPC 2015, Tsukuba : Unofficial Commentary
 
Alg 2 completing the square
Alg 2 completing the squareAlg 2 completing the square
Alg 2 completing the square
 
Applications of ode and matrices soluti0n
Applications of ode and matrices soluti0nApplications of ode and matrices soluti0n
Applications of ode and matrices soluti0n
 
7.12 notes a
7.12 notes a7.12 notes a
7.12 notes a
 
completing_the_square.pptx
completing_the_square.pptxcompleting_the_square.pptx
completing_the_square.pptx
 
(8) Lesson 2.2 - Solve Two-Step Equations
(8) Lesson 2.2 - Solve Two-Step Equations(8) Lesson 2.2 - Solve Two-Step Equations
(8) Lesson 2.2 - Solve Two-Step Equations
 
Math blocks
Math blocksMath blocks
Math blocks
 
Ch07 linearspacealignment
Ch07 linearspacealignmentCh07 linearspacealignment
Ch07 linearspacealignment
 
Completing the square
Completing the squareCompleting the square
Completing the square
 
Maths trick
Maths trickMaths trick
Maths trick
 
Ca 1.6
Ca 1.6Ca 1.6
Ca 1.6
 
Math Short Tricks ( english)
Math Short Tricks ( english)Math Short Tricks ( english)
Math Short Tricks ( english)
 
Mathematics high school level quiz - Part I
Mathematics high school level quiz - Part IMathematics high school level quiz - Part I
Mathematics high school level quiz - Part I
 
Backtracking Basics.pptx
Backtracking Basics.pptxBacktracking Basics.pptx
Backtracking Basics.pptx
 
Introduction to Invariance Principle
Introduction to Invariance PrincipleIntroduction to Invariance Principle
Introduction to Invariance Principle
 
Topic 1.1
Topic 1.1Topic 1.1
Topic 1.1
 
10) Equations with Brackets.ppt
10) Equations with Brackets.ppt10) Equations with Brackets.ppt
10) Equations with Brackets.ppt
 
Tiling
TilingTiling
Tiling
 
MATH 6-Q1-WEEK_7.pptx
MATH 6-Q1-WEEK_7.pptxMATH 6-Q1-WEEK_7.pptx
MATH 6-Q1-WEEK_7.pptx
 
Fourth level block 1 formal homework
Fourth level block 1 formal homeworkFourth level block 1 formal homework
Fourth level block 1 formal homework
 

Recently uploaded

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Chess board problem(divide and conquer)

  • 1. DIVIDE AND CONQUER ALGORITHM
  • 3. The Defective Chessboard Problem GIVEN CONDITIONS:- 1. We have a chessboard of size n x n , where n =2k 2. Exactly on square is defective in the chessboard. 3. The tiles(trominoes) are in L-shape i.e. 3 squares. OBJECTIVE Cover all the chessboard with L-shape tiles(trominoes), except the defective square.
  • 4. Is it possible to solve this? Absolutely, it is possible to cover all non-defective squares. Let’s see how • As the size of the chessboard is n x n and n=2k • Therefore, Total no. of squares =2k x2k =22k • No. of non-defective squares = 22k-1 • Now, for the value of K,22k-1 is divisible by 3. • For E.g. K=1 , 22(1)-1 =3 is divisible by 3. • K=2, 22(2) -1 =15 is divisible by 3.
  • 5. Defective chessboards. 1x1 2 x2 2 x2 2 x2 2 x2 As the Size of these chessboards displayed here, 1x1 and 2x2 we don’t have to place any L-shape tile in the first and rest can be filled by just using 1 L-shaped tile.
  • 6. For 4x 4 chessboard.
  • 7. 8X8 DEFECTIVE CHESS BOARD Step-1 One of the cell is defective Step- 2 We divide the chess board into equal sub half's.
  • 8. Creation of defective box Step- 3 Trick to cover the chess board with tiles Step -4 Again creation of defective boxes as we divide the chess board DIVISION OF PROBLEM INTO SUB PROBLEM
  • 9. Step-5 As we have finally divided the problem into 2x2 board we will put the tiles. Step-6 The procedure will continue until all the sub board are covered with the tiles.
  • 10. Step-7 The final chess board covered with all the titles and only left with the defectives which we created. Step-7 Here we will cover the defectives which we have created as in the last, there should be only one defective left. COMBINIG OFALL SUB PROBLEMS
  • 13. 1x1 2x2 4x4 8x8
  • 14. ALGORITHIM 1. For a 2x2 board with defective cell we just need to add the single tile to it. 2. We will place a L shape tile in the middle such that it does not cover the sub square in which there is already defective. All the cell have a defective cell. 3.Repeat this process recursively till we have a 2x2 board.
  • 15. Time Complexity For Defective Chess Board Problem T(n) =4T(n/2) +C By Using Master Theorem, T(n) =a T(n/b) + Theta(n k log p n ),a>=1,b>1,k>=0 & p is real number. a=4,b=2,k=0,p=0 a>bk => 4 >20 Case1: If a>bk , then T(n) =Theta(nlog b a). After putting the values of a and b the Time complexity for this problem = n2.