Chapter 1 : Introduction-Fundamentals
1.1.What Is Computer Science?
Computer science is fundamentally about is computational problem solving —that is, solving
problems by the use of computation
The Essence of Computational Problem Solving
In order to solve a problem computationally, two things are needed:
A representation that captures all the relevant aspects of the problem.
An algorithm that solves the problem by use of the representation.
Limits of Computational Problem Solving
Any algorithm that correctly solves a given problem must solve the problem in a reasonable
amount of time, otherwise it is of limited practical use.
1.2 Computer Algorithms
What Is an Algorithm?
An algorithm is a finite number of clearly described, unambiguous “doable” steps that can be
systematically followed to produce a desired result for given input in a finite amount of time.
Algorithms and Computers: A Perfect Match
Because computers can execute instructions very quickly and reliably without error, algorithms
and computers are a perfect match.
1.3 Computer Hardware
Computer hardware comprises the physical part of a computer system. It includes the all-
important components of the central processing unit (CPU) and main memory. It also includes
peripheral components such as a keyboard, monitor, mouse, and printer.
Binary representation
All information within a computer system is represented using only two digits, 0 and 1, called
binary representation.
The Binary Number System
The term bit stands for binary digit. A byte is a group of bits operated on as a single unit in a
computer system, usually consisting of eight bits.
Operating Systems—Bridging Software and Hardware
An operating system is software that has the job of managing the hardware resources of a given
computer and providing a particular user interface.
1
, PROBLEM SOLVING USING PYTHON UNIT-I
BASE-2 REPRESENTATION :
128 64 32 16 8 4 2 1
2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
0 1 1 0 0 0 1 1 = 99
1.4 Computer Software
Computer software is a set of program instructions, including related data and documentation,
that can be executed by computer.
Syntax, Semantics, and Program Translation :
The syntax of a language is a set of characters and the acceptable sequences of those
characters.
The semantics of a language is the meaning associated with each syntactically correct
sequence of characters.
A compiler is a translator program that translates programs directly into machine code
to be executed by the CPU.
An interpreter executes program instructions in place of (“running on top of”) the CPU.
Syntax errors are caused by invalid syntax. Semantic (logic) errors are caused by errors in
program logic.
Procedural vs. Object-Oriented Programming
Python supports both procedural and object-oriented programming.
Procedural programming and object-oriented programming are two major
programming paradigms in use today.
1.5 THE PROCESS OF COMPUTATIONAL PROBLEM SOLVING
2