CAT Exam  >  CAT Questions  >  InstructionsYou are given an n×n square... Start Learning for Free
Instructions
You are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.
Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.
Q. Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?
  • a)
    25
  • b)
    4
  • c)
    16
  • d)
    9
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
InstructionsYou are given an n×n square matrix to be filled with...
It has been given that all the cells adjacent to a cell must have different numerals. Let us start filling the matrix from the central square since the central square has the maximum number of squares adjacent to it (8) and it will be easier to work around the central 9 squares. A minimum of 9 numbers will be required to fill the central 9 squares.

Now we have to fill the remaining squares. Let us start with the top left square. We have to check whether the 9 numbers will be sufficient to fill all the squares such that no 2 squares adjacent to a square have the same number. We can use any of the 3 numbers 4, 5, and 6 to fill the top left square since none of the numbers in the second column are adjacent to these numbers.
Let us assume that we use 4 to fill the top left square. Now, one of the cells with the number 4 has become adjacent to the cell with number 2 and no other cell adjacent to cell with number 2 (in the second row and second column) can have 4 as its neighbour. Similarly, we can fill the first row with numbers 8 and 7.

In essence, we are trying to create a gird around each of the numbers in the corners of the inner 3x3 matrix such that no 2 cells adjacent to a cell have the same number. Filling the other cells similarly, we get the following matrix as one of the possible cases.

We need a minimum of 9 numbers to fill a 5x5 matrix such that for any cell, no 2 cells adjacent to it contain the same value. Therefore, option D is the right answer.
View all questions of this test
Most Upvoted Answer
InstructionsYou are given an n×n square matrix to be filled with...
Max adjacent cells possible are 8 in 5x5 matrix so 8+1(cells whose adjacent are to be made different) is answer
Free Test
Community Answer
InstructionsYou are given an n×n square matrix to be filled with...
Instructions

You are given an n x n 2D matrix representing an image.

Rotate the image by 90 degrees (clockwise).

You need to do this in place.

Note:

You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.

Example:

Input:

[
[1,2,3],
[4,5,6],
[7,8,9]
],

Output:
[
[7,4,1],
[8,5,2],
[9,6,3]
]
Attention CAT Students!
To make sure you are not studying endlessly, EduRev has designed CAT study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in CAT.
Explore Courses for CAT exam

Similar CAT Doubts

InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer?
Question Description
InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer? for CAT 2024 is part of CAT preparation. The Question and answers have been prepared according to the CAT exam syllabus. Information about InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for CAT 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer?.
Solutions for InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for CAT. Download more important topics, notes, lectures and mock test series for CAT Exam by signing up for free.
Here you can find the meaning of InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer?, a detailed solution for InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice InstructionsYou are given an n×n square matrix to be filled with numerals so that no two adjacent cells have the same numeral.Two cells are called adjacent if they touch each other horizontally, vertically or diagonally. So a cell in one of the four corners has three cells adjacent to it, and a cell in the first or last row or column which is not in the corner has five cells adjacent to it. Any other cell has eight cells adjacent to it.Q.Suppose that all the cells adjacent to any particular cell must have different numerals. What is the minimum number of different numerals needed to fill a 5×5 square matrix?a)25b)4c)16d)9Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice CAT tests.
Explore Courses for CAT exam

Top Courses for CAT

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev