English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

What is an invariant? - Computer Science

Advertisements
Advertisements

Question

What is an invariant?

One Line Answer

Solution

An expression involving variables, which remains unchanged by an assignment to one of these variables is called an invariant of the assignment.

shaalaa.com
Invariants
  Is there an error in this question or solution?
Chapter 8: Iteration and recursion - Evaluation - Section - B [Page 113]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 8 Iteration and recursion
Evaluation - Section - B | Q 1. | Page 113

RELATED QUESTIONS

We wish to cover a chessboard with dominoes, `square``square` the number of black squares, and the number of white squares covered by dominoes, respectively, placing a domino can be modeled by ______


If m x a + n x b is an invariant for the assignment a, b : = a + 8, b + 7, the values of m and n are ______


Which of the following is not an invariant of the assignment?

m, n := m + 2, n + 3


There are 7 tumblers on a table, all standing upside down. You are allowed to turn any 2 tumblers simultaneously in one move. Is it possible to reach a situation when all the tumblers are right-side-up?


A knockout tournament is a series of games. Two players compete in each game; the loser is knocked out (i.e. does not play anymore), the winner carries on. The winner of the tournament is the player that is left after all other players have been knocked out. Suppose there are 1234 players in a tournament. How many games are played before the tournament winner is decided?


King Vikramaditya has two magic swords. With one, he can cut off 19 heads of a dragon, but after that, the dragon grows 13 heads. With the other sword, he can cut off 7 heads, but 22 new heads grow. If all heads are cut off, the dragon dies. If the dragon has originally 1000 heads, can it ever die?


Assume an 8 × 8 chessboard with the usual coloring. "Recoloring" operation changes the color of all squares of a row or a column. You can recolor repeatedly. The goal is to attain just one black square. Show that you cannot achieve the goal.


Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×