Word RAM explained
In theoretical computer science, the word RAM (word random-access machine) model is a model of computation in which a random-access machine does arithmetic and bitwise operations on a word of bits. Michael Fredman and Dan Willard created it in 1990 to simulate programming languages like C.[1]
Model
The word RAM model is an abstract machine similar to a random-access machine, but with finite memory and word-length. It works with words of size up to bits, meaning it can store integers up to
. Because the model assumes that the
word size matches the problem size, that is, for a problem of size,
, the word RAM model is a
transdichotomous model.
[2] The model allows both arithmetic operations and
bitwise operations including
logical shifts to be done in constant time (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 to sort integers in expected time of (in Big O notation)
, while Han also created a
deterministic variant with
running time
.
The dynamic predecessor problem is also commonly analyzed in the word RAM model, and was the original motivation for the model. Dan Willard used y-fast tries to solve this in
time, or, more precisely,
where is a bound on the values stored.
[3] Michael Fredman and Willard also solved the problem using
fusion trees in
time.
[1] Using
exponential search trees, a query can be performed in
.
[4] Additional results in the word RAM model are listed in the article on range searching.
Lower bounds applicable to word RAM algorithms are often proved in the cell-probe model.
See also
Notes and References
- Fredman. Michael. Michael Fredman. Willard. Dan. Dan Willard. Blasting through the information theoretic barrier with fusion trees. Symposium on Theory of Computing. 1–7. 1990.
- In fact one usually assumes to be smaller than
, so that the data-structure considered can be indexed with -bit addresses.
- Willard . Dan E. . Log-logarithmic worst-case range queries are possible in space Θ (N) . Information Processing Letters . 1983 . 17 . 2 . 81-84.
- Andersson . Arne . Thorup . Mikkel . Dynamic ordered sets with exponential search trees . Journal of the ACM . 2007 . 54 . 3 . 1-40 . 10.1145/1236457.1236460. cs/0210006 .