1.1 The Basic Model of Computation, Programming Paradigms
1.1 The Basic Model of Computation, Programming Paradigms
s Computational Model:
A computational model is a mathematical model in computational science that
requires extensive computational resources to study the behavior of a complex system
by computer simulation. The common basis of programming language and computer
architecture is known as computational model. Provides a higher level of abstraction
than the programming language and the architecture.Computational model is the
combination of computer language and computer Architecture.
Algorithms are the most important and durable part of computer science because they
can be studied in a language- and machine- independent way. This means that we
need techniques that capable us to compare the efficiency of algorithms without
implementing them.
3.The program for RAM is not stored in memory. Thus we are assuming that the
program does not modify itself.
You give the computer little orders to do and it does them one at a time and
reports back.The paradigm consists of several statements, and after the execution of all
of them, the result is stored. It’s about writing a list of instructions to tell the computer
what to do step by step.I
In an imperative programming paradigm, the order of the steps is crucial,
because a given step will have different consequences depending on the current values
of variables when the step is executed.Find the sum of first ten natural numbers in the
imperative paradigm approach.
A great example of procedures would be the well known for loop. The for loop's
main purpose is to cause side effects and it does not return a value.
C,C++,Fortran Cobal
● Speeds up performance.
● It makes it easy to solve problems since this approach seems to be like a divide
and conquer method.
● C/C++
So the main differences are that imperative tells you how to do something and
declarative tells you what to do.
i.Logic programming paradigms
It would solve logical problems like puzzles, series etc. In logic programming we
have a knowledge base which we know before and along with the question and
knowledge base which is given to the machine, it produces results. In normal
programming languages, such concept of knowledge base is not available but while
using the concept of artificial intelligence, machine learning we have some models like
Perception model which is using the same mechanism
In logical programming the main emphasis is on knowledge base and the problem.
To give you an idea, John is Bill's and Lisa's father. Mary is Bill's and Lisa's
mother. Now, if someone asks a question like "who is the father of Bill and Lisa?" or
"who is the mother of Bill and Lisa?" we can teach the computer to answer these
questions using logic programming.
You compose your program of short functions. All code is within a function. All
variables are scoped to the function.In the functional programming paradigm, the
functions do not modify any values outside the scope of that function and the functions
themselves are not affected by any values outside their scope.Some of the languages
like perl, javascript mostly uses this paradigm.