Word RAM
   HOME

TheInfoList



OR:

In
theoretical computer science Theoretical computer science is a subfield of computer science and mathematics that focuses on the Abstraction, abstract and mathematical foundations of computation. It is difficult to circumscribe the theoretical areas precisely. The Associati ...
, the word RAM (word random-access machine) model is a
model of computation In computer science, and more specifically in computability theory and computational complexity theory, a model of computation is a model which describes how an output of a mathematical function is computed given an input. A model describes how ...
in which a
random-access machine In computer science, random-access machine (RAM or RA-machine) is a model of computation that describes an abstract machine in the general class of register machines. The RA-machine is very similar to the counter machine but with the added capab ...
does arithmetic and bitwise operations on a word of bits.
Michael Fredman Michael Lawrence Fredman is an emeritus professor at the Computer Science Department at Rutgers University, United States. He earned his Ph.D. from Stanford University in 1972 under the supervision of Donald Knuth. He was a member of the mathemat ...
and
Dan Willard Dan Edward Willard (September 19, 1948 – January 21, 2023) was an American computer scientist and logician, and a professor of computer science at the University at Albany. Education and career Willard did his undergraduate studies in mathemat ...
created it in 1990 to simulate programming languages like C.


Model

The word RAM model is an
abstract machine In computer science, an abstract machine is a theoretical model that allows for a detailed and precise analysis of how a computer system functions. It is similar to a mathematical function in that it receives inputs and produces outputs based on p ...
similar to a
random-access machine In computer science, random-access machine (RAM or RA-machine) is a model of computation that describes an abstract machine in the general class of register machines. The RA-machine is very similar to the counter machine but with the added capab ...
, but with finite memory and word-length. It works with words of size up to bits, meaning it can store
integers An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
up to 2^w-1. Because the model assumes that the word size matches the problem size, that is, for a problem of size , w \ge \log n, the word RAM model is a transdichotomous model. The model allows both arithmetic operations and
bitwise operations In computer programming, a bitwise operation operates on a bit string, a bit array or a binary numeral (considered as a bit string) at the level of its individual bits. It is a fast and simple action, basic to the higher-level arithmetic opera ...
including
logical shift In computer science, a logical shift is a bitwise operation that shifts all the bits of its operand. The two base variants are the logical left shift and the logical right shift. This is further modulated by the number of bit positions a given v ...
s to be done in
constant time In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations p ...
(the precise instruction set assumed by an algorithm or proof using the model may vary).


Algorithms and data structures

In the word RAM model, integer sorting can be done fairly efficiently. Yijie Han and Mikkel Thorup created a
randomized algorithm A randomized algorithm is an algorithm that employs a degree of randomness as part of its logic or procedure. The algorithm typically uses uniformly random bits as an auxiliary input to guide its behavior, in the hope of achieving good performan ...
to sort integers in
expected time In computational complexity theory, the average-case complexity of an algorithm is the amount of some computational resource (typically time) used by the algorithm, averaged over all possible inputs. It is frequently contrasted with worst-case com ...
of (in
Big O notation Big ''O'' notation is a mathematical notation that describes the asymptotic analysis, limiting behavior of a function (mathematics), function when the Argument of a function, argument tends towards a particular value or infinity. Big O is a memb ...
) O(n \sqrt), while Han also created a
deterministic Determinism is the metaphysical view that all events within the universe (or multiverse) can occur only in one possible way. Deterministic theories throughout the history of philosophy have developed from diverse and sometimes overlapping mo ...
variant with running time O(n \log \log n). The dynamic predecessor problem is also commonly analyzed in the word RAM model, and was the original motivation for the model.
Dan Willard Dan Edward Willard (September 19, 1948 – January 21, 2023) was an American computer scientist and logician, and a professor of computer science at the University at Albany. Education and career Willard did his undergraduate studies in mathemat ...
used y-fast tries to solve this in O(\log w) time, or, more precisely, O(\log\log U) where is a bound on the values stored.
Michael Fredman Michael Lawrence Fredman is an emeritus professor at the Computer Science Department at Rutgers University, United States. He earned his Ph.D. from Stanford University in 1972 under the supervision of Donald Knuth. He was a member of the mathemat ...
and Willard also solved the problem using
fusion tree In computer science, a fusion tree is a type of tree data structure that implements an associative array on -bit integers on a finite universe, where each of the input integers has size less than 2w and is non-negative. When operating on a collect ...
s in O(\log_w n) time. Using exponential search trees, a query can be performed in O(\sqrt). Additional results in the word RAM model are listed in the article on
range searching In computer science, the range searching problem consists of processing a set ''S'' of objects, in order to determine which objects from ''S'' intersect with a query object, called the ''range''. For example, if ''S'' is a set of points correspond ...
. Lower bounds applicable to word RAM algorithms are often proved in the cell-probe model.


See also

* Transdichotomous model


References

{{reflist Models of computation