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 {{mvar|w}} bits. Michael Fredman and Dan Willard created it in 1990 to simulate programming languages like C.<ref name="Fredman90">{{cite journal|last1=Fredman|first1=Michael|author1-link=Michael Fredman|last2=Willard|first2=Dan|author2-link=Dan Willard|title=Blasting through the information theoretic barrier with fusion trees|journal=Symposium on Theory of Computing|pages=1–7|date=1990}}</ref>
== 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 {{mvar|w}} bits, meaning it can store integers up to <math>2^w-1</math>. Because the model assumes that the word size matches the problem size, that is, for a problem of size {{mvar|n}}, <math>w \ge \log n</math>, the word RAM model is a transdichotomous model.<ref>In fact one usually assumes {{mvar|n}} to be smaller than <math>2^w</math>, so that the data-structure considered can be indexed with {{mvar|w}}-bit addresses.</ref> 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) <math>O(n \sqrt{\log \log n})</math>,<ref name="Han02">{{citation | last1 = Han | first1 = Yijie | last2 = Thorup | first2 = M. | author2-link = Mikkel Thorup | contribution = Integer sorting in {{math|O(''n''{{sqrt|log log ''n''}})}} expected time and linear space | doi = 10.1109/SFCS.2002.1181890 | pages = 135–144 | publisher = IEEE Computer Society | title = Proceedings of the 43rd Annual Symposium on Foundations of Computer Science (FOCS 2002) | year = 2002| title-link = Symposium on Foundations of Computer Science | isbn = 978-0-7695-1822-0 | citeseerx = 10.1.1.671.5583 }}</ref> while Han also created a deterministic variant with running time <math>O(n \log \log n)</math>.<ref name="Han04">{{citation | last = Han | first = Yijie | doi = 10.1016/j.jalgor.2003.09.001 | mr = 2028585 | issue = 1 | journal = Journal of Algorithms | pages = 96–105 | title = Deterministic sorting in {{math|''O''(''n'' log log ''n'')}} time and linear space | volume = 50 | year = 2004}}</ref>
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 <math>O(\log w)</math> time, or, more precisely, <math>O(\log\log U)</math> where {{mvar|U}} is a bound on the values stored.<ref>{{cite journal |last1=Willard |first1=Dan E. |title=Log-logarithmic worst-case range queries are possible in space Θ (N) |journal=Information Processing Letters |date=1983 |volume=17 |issue=2 |pages=81–84|doi=10.1016/0020-0190(83)90075-3 }}</ref> Michael Fredman and Willard also solved the problem using fusion trees in <math>O(\log_w n)</math> time.<ref name="Fredman90"/> Using exponential search trees, a query can be performed in <math>O(\sqrt{\log n / \log\log n})</math>.<ref>{{cite journal |last1=Andersson |first1=Arne |last2=Thorup |first2=Mikkel |title=Dynamic ordered sets with exponential search trees |journal=Journal of the ACM |date=2007 |volume=54 |issue=3 |page=13 |doi=10.1145/1236457.1236460|arxiv=cs/0210006 }}</ref>
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 == * Transdichotomous model
== References == {{reflist}}
Category: Models of computation