In computing, especially
computational geometry, a real RAM (
random-access machine) is a mathematical model of a computer that can compute with exact
real number
In mathematics, a real number is a number that can be used to measurement, measure a ''continuous'' one-dimensional quantity such as a distance, time, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small var ...
s instead of the binary
fixed point or
floating point
In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can be r ...
numbers used by most actual computers. The real RAM was formulated by
Michael Ian Shamos
Michael Ian Shamos (born April 21, 1947) is an American mathematician, attorney, book author, journal editor, consultant and company director. He is (with Franco P. Preparata) the author of ''Computational Geometry'' (Springer-Verlag, 1985), whic ...
in his 1978 Ph.D. dissertation.
Model
The "RAM" part of the real RAM model name stands for "
random-access machine". This is a model of computing that resembles a simplified version of a standard computer architecture. It consists of a
stored program
A stored-program computer is a computer that stores program instructions in electronically or optically accessible memory. This contrasts with systems that stored the program instructions with plugboards or similar mechanisms.
The definition ...
, a
computer memory
In computing, memory is a device or system that is used to store information for immediate use in a computer or related computer hardware and digital electronic devices. The term ''memory'' is often synonymous with the term '' primary storage ...
unit consisting of an array of cells, and a
central processing unit
A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, an ...
with a bounded number of
registers. Each memory cell or register can store a real number. Under the control of the program, the real RAM can transfer real numbers between memory and registers, and perform arithmetic operations on the values stored in the registers.
The allowed operations typically include addition, subtraction, multiplication, and division, as well as comparisons, but not modulus or rounding to integers. The reason for avoiding integer rounding and modulus operations is that allowing these operations could give the real RAM unreasonable amounts of computational power, enabling it to solve
PSPACE-complete In computational complexity theory, a decision problem is PSPACE-complete if it can be solved using an amount of memory that is polynomial in the input length ( polynomial space) and if every other problem that can be solved in polynomial space can ...
problems in polynomial time.
When analyzing algorithms for the real RAM, each allowed operation is typically assumed to take
constant time.
Implementation
Software libraries
In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and subro ...
such as
LEDA have been developed which allow programmers to write computer programs that work as if they were running on a real RAM.
These libraries represent real values using
data structure
In computer science, a data structure is a data organization, management, and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the rel ...
s which allow them to perform arithmetic and comparisons with the same results as a real RAM would produce. For example, In LEDA, real numbers are represented using the
leda_real
datatype, which supports ''k''-th roots for any natural number ''k'', rational operators, and comparison operators. The time analysis of the underlying real RAM algorithm using these real datatypes
can be interpreted as counting the number of library calls needed by a given algorithm.
Related models
The real RAM closely resembles the later
Blum–Shub–Smale machine.
[.] However, the real RAM is typically used for the analysis of concrete algorithms in
computational geometry, while the Blum–Shub–Smale machine instead forms the basis for extensions of the theory of
NP-completeness
In computational complexity theory, a problem is NP-complete when:
# it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryin ...
to real-number computation.
An alternative to the real RAM is the
word RAM, in which both the inputs to a problem and the values stored in memory and registers are assumed to be integers with a fixed number of bits. The word RAM model can perform some operations more quickly than the real RAM; for instance, it allows fast
integer sorting
In computer science, integer sorting is the algorithmic problem of sorting a collection of data values by integer keys. Algorithms designed for integer sorting may also often be applied to sorting problems in which the keys are floating point num ...
algorithms, while sorting on the real RAM must be done with slower
comparison sort
A comparison sort is a type of sorting algorithm that only reads the list elements through a single abstract comparison operation (often a "less than or equal to" operator or a three-way comparison) that determines which of two elements should oc ...
ing algorithms. However, some computational geometry problems have inputs or outputs that cannot be represented exactly using integer coordinates; see for instance the
Perles configuration, an arrangement of points and line segments that has no integer-coordinate representation.
References
{{reflist
External links
Feasible Real Random Access Machines ReferencesGeometric Computing The Science of Making Geometric Algorithms Work
Classes of computers
Computational science
Computational geometry