📖 Samacheer Kalvi · 11th TN - English Medium · Computer Science · Page 82question

Solving · Part 9

Chapter 2: Chapter 2 · Computer Science

are unnecessary. If we include unnecessary details, it makes the problem and its solution over-complicated. Specification abstracts a problem by the properties of the inputs and the desired input-output relation. We recognize the properties essential for solving the problem, and ignore the unnecessary details.

State: In algorithms, the state of a computation is abstracted by a set of variables. Functions: When an algorithm is very complex, we can decompose it into functions and abstract each function by its specification. . .

State State is a basic and important abstraction. Computational processes have state. A computational process starts with an initial state. As actions are performed, its state changes.

It ends with a final state. State of a process is abstracted by a set of variables in the algorithm. The state at any point of execution is simply the values of the variables at that point. Example .

. Chocolate Bars: A rectangular chocolate bar is divided into squares by horizontal and vertical grooves. We wish to break the bar into individual squares. To start with, we have the whole of the bar as a single piece.

A cut is made by choosing a piece and breaking it along one of its grooves. Thus a cut divides a piece into two pieces. How many cuts are needed to break the bar into its individual squares? In this example, we will abstract the essential variables of the problem.

We solve the problem in Example . . Essential variables: The number of pieces and the number of cuts are the essential variables of the problem. We will represent them by two variables, p and c, respectively.

Thus, the state of the process is abstracted by two variables p and c. Irrelevant details: . The problem could be cutting a chocolate bar into individual pieces or cutting a sheet of postage stamps into individual stamps. It is irrelevant.

The problem is simply cutting a grid of squares into individual squares. Chapter Page - - . The sequence of cuts that have been made and the shapes and sizes of the resulting pieces are

Related topics

Have a question about this topic?

Get an AI answer grounded in your actual textbook — with the exact page reference.

Ask AI about this topic →