Question: Let A $ epsilon$ $ { 0 , 1 } ^ { n times m } $ be a matrix with

Let A $\epsilon$ $\{0,1\}^{n \times m}$ be a matrix with n rows, m columns, and where every entry is either 0 or 1. We will let $A_{ij}$ denote the entry in ow i and column j, so for example $A_{11}$ is the top left entry, $A_{n1}$ is the bottom-left entry, $A_{1m}$ is the top-right entry, and $A_{nm}$ is the bottom-right entry. Suppose that we want to find the largest integer k such that A contains a k $\times$ k contiguous submatrix consisting of all 0's. In other words, we want to find the largest k such there exists values i, j such that $A_{xy}$ =0 for all i-k $<$ x $\leq$ i and j-k $<$ y $\leq$ j.\\
We will design a dynamic programming algorithm that runs in O(nm) time for this problem.\\
(a) For every i, j $\epsilon$ $\mathbb{N}$ with 1 $\leq$ i $\leq$ n and 1 $\leq$ j $\leq$ m, let S(i, j) denote the maximum value of k such that there is a k $\times$ k contiguous submatrix of A consisting of all 0's whose bottom-right corner is at (i, j)(row i, column j). Write a recursive formula for S(i, j) and prove that the formula is correct.\\
(b) Give a dynamic programming algorithm based on your solution to part (a), and prove that it correctly finds the largest possible value of k and runs in time O(nm).\\

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!