text:
Gray code

The reflected binary code (RBC), also known as reflected binary (RB) or Gray code after Frank Gray, is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit).

For example, the representation of the decimal value "1" in binary would normally be "001" and "2" would be "010". In Gray code, these values are represented as "001" and "011". That way, incrementing a value from 1 to 2 requires only one bit to change, instead of two.

Gray codes are widely used to prevent spurious output from electromechanical switches and to facilitate error correction in digital communications such as digital terrestrial television and some cable TV systems. The use of Gray code in these devices helps simplify logic operations and reduce errors in practice.

Function
Many devices indicate position by closing and opening switches. If that device uses natural binary codes, positions 3 and 4 are next to each other but all three bits of the binary representation differ:
 * {| class="wikitable" style="text-align:center;"

! Decimal !! Binary
 * 3 || 011
 * 4 || 100
 * }
 * 3 || 011
 * 4 || 100
 * }
 * }
 * }
 * }

The problem with natural binary codes is that physical switches are not ideal: it is very unlikely that physical switches will change states exactly in synchrony. In the transition between the two states shown above, all three switches change state. In the brief period while all are changing, the switches will read some spurious position. Even without keybounce, the transition might look like 011 — 001 — 101 — 100. When the switches appear to be in position 001, the observer cannot tell if that is the "real" position 1, or a transitional state between two other positions. If the output feeds into a sequential system, possibly via combinational logic, then the sequential system may store a false value.

This problem can be solved by changing only one switch at a time, so there is never any ambiguity of position, resulting in codes assigning to each of a contiguous set of integers, or to each member of a circular list, a word of symbols such that no two code words are identical and each two adjacent code words differ by exactly one symbol. These codes are also known as unit-distance,    single-distance, single-step, monostrophic    or syncopic codes, in reference to the Hamming distance of 1 between adjacent codes.

Invention
In principle, there can be more than one such code for a given word length, but the term Gray code was first applied to a particular binary code for non-negative integers, the binary-reflected Gray code, or BRGC. Bell Labs researcher George R. Stibitz described such a code in a 1941 patent application, granted in 1943. Frank Gray introduced the term reflected binary code in his 1947 patent application, remarking that the code had "as yet no recognized name". He derived the name from the fact that it "may be built up from the conventional binary code by a sort of reflection process".

In the standard encoding of the Gray Code the least significant bit follows a repetitive pattern of 2 on, 2 off ( … 11001100 … ); the next digit a pattern of 4 on, 4 off; the i-th least significant bit a pattern of 2i on 2i off. The most significant digit is an exception to this: for an n-bit Gray code, the most significant digit follows the pattern 2n-1 on, 2n-1 off, which is the same (cyclic) sequence of values as for the second-most significant digit, but shifted forwards 2n-2 places. The four-bit version of this is shown below:
 * {| class="wikitable sortable" style="text-align:center;"

! Decimal !! Binary !! Gray
 * 0 || 0000 || 0000
 * 1 || 0001 || 0001
 * 2 || 0010 || 0011
 * 3 || 0011 || 0010
 * 4 || 0100 || 0110
 * 5 || 0101 || 0111
 * 6 || 0110 || 0101
 * 7 || 0111 || 0100
 * 8 || 1000 || 1100
 * 9 || 1001 || 1101
 * 10 || 1010 || 1111
 * 11 || 1011 || 1110
 * 12 || 1100 || 1010
 * 13 || 1101 || 1011
 * 14 || 1110 || 1001
 * 15 || 1111 || 1000
 * }
 * 8 || 1000 || 1100
 * 9 || 1001 || 1101
 * 10 || 1010 || 1111
 * 11 || 1011 || 1110
 * 12 || 1100 || 1010
 * 13 || 1101 || 1011
 * 14 || 1110 || 1001
 * 15 || 1111 || 1000
 * }
 * 13 || 1101 || 1011
 * 14 || 1110 || 1001
 * 15 || 1111 || 1000
 * }
 * 15 || 1111 || 1000
 * }
 * }

For decimal 15 the code rolls over to decimal 0 with only one switch change. This is called the cyclic or adjacency property of the code.

In modern digital communications, Gray codes play an important role in error correction. For example, in a digital modulation scheme such as QAM where data is typically transmitted in symbols of 4 bits or more, the signal's constellation diagram is arranged so that the bit patterns conveyed by adjacent constellation points differ by only one bit. By combining this with forward error correction capable of correcting single-bit errors, it is possible for a receiver to correct any transmission errors that cause a constellation point to deviate into the area of an adjacent point. This makes the transmission system less susceptible to noise.

Despite the fact that Stibitz described this code  before Gray, the reflected binary code was later named after Gray by others who used it. Two different 1953 patent applications use "Gray code" as an alternative name for the "reflected binary code"; one of those also lists "minimum error code" and "cyclic permutation code" among the names. A 1954 patent application refers to "the Bell Telephone Gray code". Other names include "cyclic binary code", "cyclic progression code", "cyclic permuting binary" or "cyclic permuted binary" (CPB).

The Gray code is sometimes misattributed to 19th century electrical device inventor Elisha Gray.

Mathematical puzzles
Reflected binary codes were applied to mathematical puzzles before they became known to engineers.

The binary-reflected Gray code represents the underlying scheme of the classical Chinese rings puzzle, a sequential mechanical puzzle mechanism described by the French Louis Gros in 1872.

It can serve as a solution guide for the Towers of Hanoi problem, based on a game by the French Édouard Lucas in 1883. Similarly, the so-called Towers of Bucharest and Towers of Klagenfurt game configurations yield ternary and pentary Gray codes.

Martin Gardner wrote a popular account of the Gray code in his August 1972 Mathematical Games column in Scientific American.

The code also forms a Hamiltonian cycle on a hypercube, where each bit is seen as one dimension.

Telegraphy codes
When the French engineer Émile Baudot changed from using a 6-unit (6-bit) code to 5-unit code for his printing telegraph system, in 1875 or 1876,  he ordered the alphabetic characters on his print wheel using a reflected binary code, and assigned the codes using only three of the bits to vowels. With vowels and consonants sorted in their alphabetical order,  and other symbols appropriately placed, the 5-bit character code has been recognized as a reflected binary code. This code became known as Baudot code and, with minor changes, was eventually adopted as International Telegraph Alphabet No. 1 (ITA1, CCITT-1) in 1932. About the same time, the German-Austrian Otto Schäffler demonstrated another printing telegraph in Vienna using a 5-bit reflected binary code for the same purpose, in 1874.

Analog-to-digital signal conversion
Frank Gray, who became famous for inventing the signaling method that came to be used for compatible color television, invented a method to convert analog signals to reflected binary code groups using vacuum tube-based apparatus. Filed in 1947, the method and apparatus were granted a patent in 1953, and the name of Gray stuck to the codes. The "PCM tube" apparatus that Gray patented was made by Raymond W. Sears of Bell Labs, working with Gray and William M. Goodall, who credited Gray for the idea of the reflected binary code.

Gray was most interested in using the codes to minimize errors in converting analog signals to digital; his codes are still used today for this purpose.

Position encoders

Gray codes are used in linear and rotary position encoders (absolute encoders and quadrature encoders) in preference to weighted binary encoding. This avoids the possibility that, when multiple bits change in the binary representation of a position, a misread will result from some of the bits changing before others.

For example, some rotary encoders provide a disk which has an electrically conductive Gray code pattern on concentric rings (tracks). Each track has a stationary metal spring contact that provides electrical contact to the conductive code pattern. Together, these contacts produce output signals in the form of a Gray code. Other encoders employ non-contact mechanisms based on optical or magnetic sensors to produce the Gray code output signals.

Regardless of the mechanism or precision of a moving encoder, position measurement error can occur at specific positions (at code boundaries) because the code may be changing at the exact moment it is read (sampled). A binary output code could cause significant position measurement errors because it is impossible to make all bits change at exactly the same time. If, at the moment the position is sampled, some bits have changed and others have not, the sampled position will be incorrect. In the case of absolute encoders, the indicated position may be far away from the actual position and, in the case of incremental encoders, this can corrupt position tracking.

In contrast, the Gray code used by position encoders ensures that the codes for any two consecutive positions will differ by only one bit and, consequently, only one bit can change at a time. In this case, the maximum position error will be small, indicating a position adjacent to the actual position.

Genetic algorithms
Due to the Hamming distance properties of Gray codes, they are sometimes used in genetic algorithms. They are very useful in this field, since mutations in the code allow for mostly incremental changes, but occasionally a single bit-change can cause a big leap and lead to new properties.

Boolean circuit minimization
Gray codes are also used in labelling the axes of Karnaugh maps since 1953  as well as in Händler circle graphs since 1958,    both graphical methods for logic circuit minimization.

Error correction
In modern digital communications, 1D- and 2D-Gray codes play an important role in error prevention before applying an error correction. For example, in a digital modulation scheme such as QAM where data is typically transmitted in symbols of 4 bits or more, the signal's constellation diagram is arranged so that the bit patterns conveyed by adjacent constellation points differ by only one bit. By combining this with forward error correction capable of correcting single-bit errors, it is possible for a receiver to correct any transmission errors that cause a constellation point to deviate into the area of an adjacent point. This makes the transmission system less susceptible to noise.

Communication between clock domains
Digital logic designers use Gray codes extensively for passing multi-bit count information between synchronous logic that operates at different clock frequencies. The logic is considered operating in different "clock domains". It is fundamental to the design of large chips that operate with many different clocking frequencies.

Cycling through states with minimal effort
If a system has to cycle sequentially through all possible combinations of on-off states of some set of controls, and the changes of the controls require non-trivial expense (e.g. time, wear, human work), a Gray code minimizes the number of setting changes to just one change for each combination of states. An example would be testing a piping system for all combinations of settings of its manually operated valves.

A balanced Gray code can be constructed, that flips every bit equally often. Since bit-flips are evenly distributed, this is optimal in the following way: balanced Gray codes minimize the maximal count of bit-flips for each digit.

Gray code counters and arithmetic
George R. Stibitz utilized a reflected binary code in a binary pulse counting device in 1941 already.

A typical use of Gray code counters is building a FIFO (first-in, first-out) data buffer that has read and write ports that exist in different clock domains. The input and output counters inside such a dual-port FIFO are often stored using Gray code to prevent invalid transient states from being captured when the count crosses clock domains. The updated read and write pointers need to be passed between clock domains when they change, to be able to track FIFO empty and full status in each domain. Each bit of the pointers is sampled non-deterministically for this clock domain transfer. So for each bit, either the old value or the new value is propagated. Therefore, if more than one bit in the multi-bit pointer is changing at the sampling point, a "wrong" binary value (neither new nor old) can be propagated. By guaranteeing only one bit can be changing, Gray codes guarantee that the only possible sampled values are the new or old multi-bit value. Typically Gray codes of power-of-two length are used.

Sometimes digital buses in electronic systems are used to convey quantities that can only increase or decrease by one at a time, for example the output of an event counter which is being passed between clock domains or to a digital-to-analog converter. The advantage of Gray codes in these applications is that differences in the propagation delays of the many wires that represent the bits of the code cannot cause the received value to go through states that are out of the Gray code sequence. This is similar to the advantage of Gray codes in the construction of mechanical encoders, however the source of the Gray code is an electronic counter in this case. The counter itself must count in Gray code, or if the counter runs in binary then the output value from the counter must be reclocked after it has been converted to Gray code, because when a value is converted from binary to Gray code, it is possible that differences in the arrival times of the binary data bits into the binary-to-Gray conversion circuit will mean that the code could go briefly through states that are wildly out of sequence. Adding a clocked register after the circuit that converts the count value to Gray code may introduce a clock cycle of latency, so counting directly in Gray code may be advantageous.

To produce the next count value in a Gray-code counter, it is necessary to have some combinational logic that will increment the current count value that is stored. One way to increment a Gray code number is to convert it into ordinary binary code, add one to it with a standard binary adder, and then convert the result back to Gray code. Other methods of counting in Gray code are discussed in a report by Robert W. Doran, including taking the output from the first latches of the master-slave flip flops in a binary ripple counter.

Gray code addressing
As the execution of program code typically causes an instruction memory access pattern of locally consecutive addresses, bus encodings using Gray code addressing instead of binary addressing can reduce the number of state changes of the address bits significantly, thereby reducing the CPU power consumption in some low-power designs.

Constructing an n-bit Gray code

The binary-reflected Gray code list for n bits can be generated recursively from the list for n − 1 bits by reflecting the list (i.e. listing the entries in reverse order), prefixing the entries in the original list with a binary 0, prefixing the entries in the reflected list with a binary 1, and then concatenating the original list with the reversed list. For example, generating the n = 3 list from the n = 2 list:
 * {| cellpadding="5" border="0" style="margin: 1em;"

 * 2-bit list:
 * 00, 01, 11, 10
 * Reflected:
 * 10, 11, 01, 00
 * Prefix old entries with 0:
 * 000, 001, 011, 010,
 * Prefix new entries with 1:
 * 110, 111, 101, 100
 * Concatenated:
 * 000, 001, 011, 010,
 * 110, 111, 101, 100
 * }
 * Prefix new entries with 1:
 * 110, 111, 101, 100
 * Concatenated:
 * 000, 001, 011, 010,
 * 110, 111, 101, 100
 * }
 * 000, 001, 011, 010,
 * 110, 111, 101, 100
 * }

The one-bit Gray code is G1 = (0,1). This can be thought of as built recursively as above from a zero-bit Gray code G0 = ( Λ ) consisting of a single entry of zero length. This iterative process of generating Gn+1 from Gn makes the following properties of the standard reflecting code clear:
 * Gn is a permutation of the numbers 0, ..., 2n − 1. (Each number appears exactly once in the list.)
 * Gn is embedded as the first half of Gn+1.
 * Therefore, the coding is stable, in the sense that once a binary number appears in Gn it appears in the same position in all longer lists; so it makes sense to talk about the reflective Gray code value of a number: G(m) = the mth reflecting Gray code, counting from 0.
 * Each entry in Gn differs by only one bit from the previous entry. (The Hamming distance is 1.)
 * The last entry in Gn differs by only one bit from the first entry. (The code is cyclic.)

These characteristics suggest a simple and fast method of translating a binary value into the corresponding Gray code. Each bit is inverted if the next higher bit of the input value is set to one. This can be performed in parallel by a bit-shift and exclusive-or operation if they are available: the nth Gray code is obtained by computing $$n \oplus \left\lfloor \tfrac{n}{2} \right\rfloor$$. Prepending a 0 bit leaves the order of the code words unchanged, prepending a 1 bit reverses the order of the code words. If the bits at position $$i$$ of codewords are inverted, the order of neighbouring blocks of $$2^i$$ codewords is reversed. For example, if bit 0 is inverted in a 3 bit codeword sequence, the order of two neighbouring codewords is reversed
 * → (invert bit 0)

If bit 1 is inverted, blocks of 2 codewords change order:
 * → (invert bit 1)

If bit 2 is inverted, blocks of 4 codewords reverse order:
 * → (invert bit 2)

Thus, performing an exclusive or on a bit $$b_i$$ at position $$i$$ with the bit $$b_{i+1}$$ at position $$i+1$$ leaves the order of codewords intact if $$b_{i+1} = \mathtt{0}$$, and reverses the order of blocks of $$2^{i+1}$$ codewords if $$b_{i+1} = \mathtt{1}$$. Now, this is exactly the same operation as the reflect-and-prefix method to generate the Gray code.

A similar method can be used to perform the reverse translation, but the computation of each bit depends on the computed value of the next higher bit so it cannot be performed in parallel. Assuming $$g_i$$ is the $$i$$th Gray-coded bit ($$g_0$$ being the most significant bit), and $$b_i$$ is the $$i$$th binary-coded bit ($$b_0$$ being the most-significant bit), the reverse translation can be given recursively: $$b_0 = g_0$$, and $$b_i=g_i \oplus b_{i-1}$$. Alternatively, decoding a Gray code into a binary number can be described as a prefix sum of the bits in the Gray code, where each individual summation operation in the prefix sum is performed modulo two.

To construct the binary-reflected Gray code iteratively, at step 0 start with the $$\mathrm{code}_0 = \mathtt{0}$$, and at step $$i > 0$$ find the bit position of the least significant 1 in the binary representation of $$i$$ and flip the bit at that position in the previous code $$\mathrm{code}_{i-1}$$ to get the next code $$\mathrm{code}_i$$. The bit positions start 0, 1, 0, 2, 0, 1, 0, 3, .... See find first set for efficient algorithms to compute these values.

Converting to and from Gray code
The following functions in C convert between binary numbers and their associated Gray codes. While it may seem that Gray-to-binary conversion requires each bit to be handled one at a time, faster algorithms exist.

On newer processors, the number of ALU instructions in the decoding step can be reduced by taking advantage of the CLMUL instruction set. If MASK is the constant binary string of ones ended with a single zero digit, then carryless multiplication of MASK with the grey encoding of x will always give either x or its bitwise negation.

Special types of Gray codes
In practice, "Gray code" almost always refers to a binary-reflected Gray code (BRGC). However, mathematicians have discovered other kinds of Gray codes. Like BRGCs, each consists of a list of words, where each word differs from the next in only one digit (each word has a Hamming distance of 1 from the next word).

Gray codes with n bits and of length less than 2n
It is possible to construct binary Gray codes with n bits with a length of less than $2^{n}$, if the length is even. One possibility is to start with a balanced Gray code and remove pairs of values at either the beginning and the end, or in the middle. OEIS sequence A290772 gives the number of possible Gray sequences of length $2n$ that include zero and use the minimum number of bits.

n-ary Gray code
There are many specialized types of Gray codes other than the binary-reflected Gray code. One such type of Gray code is the n-ary Gray code, also known as a non-Boolean Gray code. As the name implies, this type of Gray code uses non-Boolean values in its encodings.

For example, a 3-ary (ternary) Gray code would use the values. The (n, k)-Gray code is the n-ary Gray code with k digits. The sequence of elements in the (3, 2)-Gray code is:. The (n, k)-Gray code may be constructed recursively, as the BRGC, or may be constructed iteratively. An algorithm to iteratively generate the (N, k)-Gray code is presented (in C):

There are other Gray code algorithms for (n,k)-Gray codes. The (n,k)-Gray code produced by the above algorithm is always cyclical; some algorithms, such as that by Guan, lack this property when k is odd. On the other hand, while only one digit at a time changes with this method, it can change by wrapping (looping from n − 1 to 0). In Guan's algorithm, the count alternately rises and falls, so that the numeric difference between two Gray code digits is always one.

Gray codes are not uniquely defined, because a permutation of the columns of such a code is a Gray code too. The above procedure produces a code in which the lower the significance of a digit, the more often it changes, making it similar to normal counting methods.

See also Skew binary number system, a variant ternary number system where at most two digits change on each increment, as each increment can be done with at most one digit carry operation.

Balanced Gray code
Although the binary reflected Gray code is useful in many scenarios, it is not optimal in certain cases because of a lack of "uniformity". In balanced Gray codes, the number of changes in different coordinate positions are as close as possible. To make this more precise, let G be an R-ary complete Gray cycle having transition sequence $$(\delta_k)$$; the transition counts (spectrum) of G are the collection of integers defined by
 * $$\lambda_k = |\{ j \in \mathbb{Z}_{R^n} : \delta_j = k \}| \,, \text { for } k \in \mathbb{Z}_n$$

A Gray code is uniform or uniformly balanced if its transition counts are all equal, in which case we have $$\lambda_k = \tfrac{R^n}{n}$$ for all k. Clearly, when $$R = 2$$, such codes exist only if n is a power of 2. If n is not a power of 2, it is possible to construct well-balanced binary codes where the difference between two transition counts is at most 2; so that (combining both cases) every transition count is either $$2\left\lfloor \tfrac{2^n}{2n} \right\rfloor$$ or $$2\left\lceil \tfrac{2^n}{2n} \right\rceil$$. Gray codes can also be exponentially balanced if all of their transition counts are adjacent powers of two, and such codes exist for every power of two.

For example, a balanced 4-bit Gray code has 16 transitions, which can be evenly distributed among all four positions (four transitions per position), making it uniformly balanced:
 * 0 1 1 1 1 1 0 0 0 0 0  1
 * 0 0 1 1 1 0  1 1 1  0 0 0
 * 0 0 0 0 1 1 1 1 0  1 1  0
 * 0 0 1 0 0 0 0  1 1 1 1 1

whereas a balanced 5-bit Gray code has a total of 32 transitions, which cannot be evenly distributed among the positions. In this example, four positions have six transitions each, and one has eight:
 * 1 1 1 1 0 0 0 1 1 1 1 1  0  1 1 1 1  0 0 0 0 0 0 0 0 0
 * 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0  1 1 1 1 1  0 0  1  0 0
 * 1 1 0 1 1  0 0 0 0 0  1 1  0 0  1 1 1 1 1  0 0 0 0  1
 * 1 0 0 0 0 0 0 1 1 1 1 1  0 0 0 0 0  1 1 1 1 1 1 1  0 0
 * 1 1 1 1 1 1 0 0 0 1  0 0 0 0 0 0 0 0  1  0 0  1 1 1 1 1

We will now show a construction and implementation for well-balanced binary Gray codes which allows us to generate an n-digit balanced Gray code for every n. The main principle is to inductively construct an (n + 2)-digit Gray code $$G'$$ given an n-digit Gray code G in such a way that the balanced property is preserved. To do this, we consider partitions of $$G = g_0, \ldots, g_{2^n-1}$$ into an even number L of non-empty blocks of the form
 * $$\left\{g_0\right\}, \left\{g_1, \ldots, g_{k_2}\right\}, \left\{g_{k_2+1}, \ldots, g_{k_3}\right\}, \ldots, \left\{g_{k_{L-2}+1}, \ldots, g_{-2}\right\}, \left\{g_{-1}\right\}$$

where $$k_1 = 0$$, $$k_{L-1} = -2$$, and $$k_{L} \equiv -1 \pmod{2^n}$$). This partition induces an $$(n+2)$$-digit Gray code given by
 * $$\mathtt{00}g_0,$$
 * $$\mathtt{00}g_1, \ldots, \mathtt{00}g_{k_2}, \mathtt{01}g_{k_2}, \ldots, \mathtt{01}g_1, \mathtt{11}g_1, \ldots, \mathtt{11}g_{k_2}, $$
 * $$\mathtt{11}g_{k_2+1}, \ldots, \mathtt{11}g_{k_3}, \mathtt{01}g_{k_3}, \ldots, \mathtt{01}g_{k_2+1}, \mathtt{00}g_{k_2+1}, \ldots, \mathtt{00}g_{k_3}, \ldots,$$
 * $$\mathtt{00}g_{-2}, \mathtt{00}g_{-1}, \mathtt{10}g_{-1}, \mathtt{10}g_{-2}, \ldots, \mathtt{10}g_0, \mathtt{11}g_0, \mathtt{11}g_{-1}, \mathtt{01}g_{-1}, \mathtt{01}g_0$$

If we define the transition multiplicities
 * $$m_i = \left|\left\{ j : \delta_{k_j} = i, 1 \leq j \leq L \right\}\right|$$

to be the number of times the digit in position i changes between consecutive blocks in a partition, then for the (n + 2)-digit Gray code induced by this partition the transition spectrum $$\lambda'_i$$ is

\lambda'_i = \begin{cases} 4 \lambda_i - 2 m_i, & \text{if } 0 \leq i < n \\ L, & \text{ otherwise } \end{cases} $$

The delicate part of this construction is to find an adequate partitioning of a balanced n-digit Gray code such that the code induced by it remains balanced, but for this only the transition multiplicities matter; joining two consecutive blocks over a digit $$i$$ transition and splitting another block at another digit $$i$$ transition produces a different Gray code with exactly the same transition spectrum $$\lambda'_i$$, so one may for example designate the first $$m_i$$ transitions at digit $$i$$ as those that fall between two blocks. Uniform codes can be found when $$R \equiv 0 \pmod 4$$ and $$R^n \equiv 0 \pmod n$$, and this construction can be extended to the R-ary case as well.

Long run Gray codes
Long run (or maximum gap) Gray codes maximize the distance between consecutive changes of digits in the same position. That is, the minimum run-length of any bit remains unchanged for as long as possible.

Monotonic Gray codes
Monotonic codes are useful in the theory of interconnection networks, especially for minimizing dilation for linear arrays of processors. If we define the weight of a binary string to be the number of 1s in the string, then although we clearly cannot have a Gray code with strictly increasing weight, we may want to approximate this by having the code run through two adjacent weights before reaching the next one.

We can formalize the concept of monotone Gray codes as follows: consider the partition of the hypercube $$Q_n = (V_n, E_n)$$ into levels of vertices that have equal weight, i.e.
 * $$V_n(i) = \{ v \in V_n : v \text{ has weight } i \}$$

for $$0 \leq i \leq n$$. These levels satisfy $$|V_n(i)| = \textstyle\binom{n}{i}$$. Let $$Q_n(i)$$ be the subgraph of $$Q_n$$ induced by $$V_n(i) \cup V_n(i+1)$$, and let $$E_n(i)$$ be the edges in $$Q_n(i)$$. A monotonic Gray code is then a Hamiltonian path in $$Q_n$$ such that whenever $$\delta_1 \in E_n(i)$$ comes before $$\delta_2 \in E_n(j)$$ in the path, then $$i \leq j$$.

An elegant construction of monotonic n-digit Gray codes for any n is based on the idea of recursively building subpaths $$P_{n,j}$$ of length $$2 \textstyle\binom{n}{j}$$ having edges in $$E_n(j)$$. We define $$P_{1,0} = (\mathtt{0}, \mathtt{1})$$, $$P_{n,j} = \emptyset$$ whenever $$j < 0$$ or $$j \geq n$$, and

P_{n+1,j} = \mathtt{1}P^{\pi_n}_{n,j-1}, \mathtt{0}P_{n,j} $$ otherwise. Here, $$\pi_n$$ is a suitably defined permutation and $$P^{\pi}$$ refers to the path P with its coordinates permuted by $$\pi$$. These paths give rise to two monotonic n-digit Gray codes $$G_n^{(1)}$$ and $$G_n^{(2)}$$ given by

G_n^{(1)} = P_{n,0} P_{n,1}^R P_{n,2} P_{n,3}^R \cdots \text{ and } G_n^{(2)} = P_{n,0}^R P_{n,1} P_{n,2}^R P_{n,3} \cdots $$

The choice of $$\pi_n$$ which ensures that these codes are indeed Gray codes turns out to be $$\pi_n = E^{-1}\left(\pi_{n-1}^2\right)$$. The first few values of $$P_{n,j}$$ are shown in the table below.
 * {| class="wikitable floatright" style="text-align: center;"

! scope="col" | $$P_{n,j}$$ ! scope="col" | j = 0 ! scope="col" | j = 1 ! scope="col" | j = 2 ! scope="col" | j = 3 ! scope="row" | n = 1 ! scope="row" | n = 2 ! scope="row" | n = 3 ! scope="row" | n = 4
 * + Subpaths in the Savage–Winkler algorithm
 * 0, 1 || || ||
 * 00, 01 || 10, 11 || ||
 * 000, 001 || 100, 110, 010, 011 || 101, 111 ||
 * 0000, 0001 || 1000, 1100, 0100, 0110, 0010, 0011 || 1010, 1011, 1001, 1101, 0101, 0111 || 1110, 1111
 * }

These monotonic Gray codes can be efficiently implemented in such a way that each subsequent element can be generated in O(n) time. The algorithm is most easily described using coroutines.

Monotonic codes have an interesting connection to the Lovász conjecture, which states that every connected vertex-transitive graph contains a Hamiltonian path. The "middle-level" subgraph $$Q_{2n+1}(n)$$ is vertex-transitive (that is, its automorphism group is transitive, so that each vertex has the same "local environment" and cannot be differentiated from the others, since we can relabel the coordinates as well as the binary digits to obtain an automorphism) and the problem of finding a Hamiltonian path in this subgraph is called the "middle-levels problem", which can provide insights into the more general conjecture. The question has been answered affirmatively for $$n \leq 15$$, and the preceding construction for monotonic codes ensures a Hamiltonian path of length at least 0.839 N, where N is the number of vertices in the middle-level subgraph.

Beckett–Gray code
Another type of Gray code, the Beckett–Gray code, is named for Irish playwright Samuel Beckett, who was interested in symmetry. His play "Quad" features four actors and is divided into sixteen time periods. Each period ends with one of the four actors entering or leaving the stage. The play begins and ends with an empty stage, and Beckett wanted each subset of actors to appear on stage exactly once. Clearly the set of actors currently on stage can be represented by a 4-bit binary Gray code. Beckett, however, placed an additional restriction on the script: he wished the actors to enter and exit so that the actor who had been on stage the longest would always be the one to exit. The actors could then be represented by a first in, first out queue, so that (of the actors onstage) the actor being dequeued is always the one who was enqueued first. Beckett was unable to find a Beckett–Gray code for his play, and indeed, an exhaustive listing of all possible sequences reveals that no such code exists for n = 4. It is known today that such codes do exist for n = 2, 5, 6, 7, and 8, and do not exist for n = 3 or 4. An example of an 8-bit Beckett–Gray code can be found in Donald Knuth's Art of Computer Programming. According to Sawada and Wong, the search space for n = 6 can be explored in 15 hours, and more than $9,500$ solutions for the case n = 7 have been found.

Snake-in-the-box codes
Snake-in-the-box codes, or snakes, are the sequences of nodes of induced paths in an n-dimensional hypercube graph, and coil-in-the-box codes, or coils, are the sequences of nodes of induced cycles in a hypercube. Viewed as Gray codes, these sequences have the property of being able to detect any single-bit coding error. Codes of this type were first described by William H. Kautz in the late 1950s; since then, there has been much research on finding the code with the largest possible number of codewords for a given hypercube dimension.

Single-track Gray code
Yet another kind of Gray code is the single-track Gray code (STGC) developed by Norman B. Spedding and refined by Hiltgen, Paterson and Brandestini in Single-track Gray Codes (1996). The STGC is a cyclical list of P unique binary encodings of length n such that two consecutive words differ in exactly one position, and when the list is examined as a P × n matrix, each column is a cyclic shift of the first column.

The name comes from their use with rotary encoders, where a number of tracks are being sensed by contacts, resulting for each in an output of 0 or 1. To reduce noise due to different contacts not switching at exactly the same moment in time, one preferably sets up the tracks so that the data output by the contacts are in Gray code. To get high angular accuracy, one needs lots of contacts; in order to achieve at least 1° accuracy, one needs at least 360 distinct positions per revolution, which requires a minimum of 9 bits of data, and thus the same number of contacts.

If all contacts are placed at the same angular position, then 9 tracks are needed to get a standard BRGC with at least 1° accuracy. However, if the manufacturer moves a contact to a different angular position (but at the same distance from the center shaft), then the corresponding "ring pattern" needs to be rotated the same angle to give the same output. If the most significant bit (the inner ring in Figure 1) is rotated enough, it exactly matches the next ring out. Since both rings are then identical, the inner ring can be cut out, and the sensor for that ring moved to the remaining, identical ring (but offset at that angle from the other sensor on that ring). Those two sensors on a single ring make a quadrature encoder. That reduces the number of tracks for a "1° resolution" angular encoder to 8 tracks. Reducing the number of tracks still further cannot be done with BRGC.

For many years, Torsten Sillke and other mathematicians believed that it was impossible to encode position on a single track such that consecutive positions differed at only a single sensor, except for the 2-sensor, 1-track quadrature encoder. So for applications where 8 tracks were too bulky, people used single-track incremental encoders (quadrature encoders) or 2-track "quadrature encoder + reference notch" encoders.

Norman B. Spedding, however, registered a patent in 1994 with several examples showing that it was possible. Although it is not possible to distinguish 2n positions with n sensors on a single track, it is possible to distinguish close to that many. Etzion and Paterson conjecture that when n is itself a power of 2, n sensors can distinguish at most 2n − 2n positions and that for prime n the limit is 2n − 2 positions. The authors went on to generate a 504-position single track code of length 9 which they believe is optimal. Since this number is larger than 28 = 256, more than 8 sensors are required by any code, although a BRGC could distinguish 512 positions with 9 sensors.

An STGC for P = 30 and n = 5 is reproduced here:
 * {|class="wikitable" style="text-align:center; background:#FFFFFF; border-width:0;"

! Angle || Code ! Angle || Code ! Angle || Code ! Angle || Code ! Angle || Code
 * + Single-track Gray code for 30 positions
 * rowspan="7" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="7" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="7" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="7" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * 0° || 10000 || 72° || 01000 || 144° || 00100 || 216° || 00010 || 288° || 00001
 * 12° || 10100 || 84° || 01010 || 156° || 00101 || 228° || 10010 || 300° || 01001
 * 24° || 11100 || 96° || 01110 || 168° || 00111 || 240° || 10011 || 312° || 11001
 * 36° || 11110 || 108° || 01111 || 180° || 10111 || 252° || 11011 || 324° || 11101
 * 48° || 11010 || 120° || 01101 || 192° || 10110 || 264° || 01011 || 336° || 10101
 * 60° || 11000 || 132° || 01100 || 204° || 00110 || 276° || 00011 || 348° || 10001
 * }
 * 36° || 11110 || 108° || 01111 || 180° || 10111 || 252° || 11011 || 324° || 11101
 * 48° || 11010 || 120° || 01101 || 192° || 10110 || 264° || 01011 || 336° || 10101
 * 60° || 11000 || 132° || 01100 || 204° || 00110 || 276° || 00011 || 348° || 10001
 * }
 * 60° || 11000 || 132° || 01100 || 204° || 00110 || 276° || 00011 || 348° || 10001
 * }

Each column is a cyclic shift of the first column, and from any row to the next row only one bit changes. The single-track nature (like a code chain) is useful in the fabrication of these wheels (compared to BRGC), as only one track is needed, thus reducing their cost and size. The Gray code nature is useful (compared to chain codes, also called De Bruijn sequences), as only one sensor will change at any one time, so the uncertainty during a transition between two discrete states will only be plus or minus one unit of angular measurement the device is capable of resolving.

Since this 30 degree example was added, there has been a lot of interest in examples with higher angular resolution. In 2008, Gary Williams, based on previous work discovered a 9-bit Single Track Gray Code that gives a 1 degree resolution. This gray code was used to design an actual device which was published on the site Thingiverse. This device was designed by etzenseep (Florian Bauer) in September, 2022.

An STGC for P = 360 and n = 9 is reproduced here:
 * {|class="wikitable" style="text-align:center; background:#FFFFFF; border-width:0;"

! Angle || Code ! Angle || Code ! Angle || Code ! Angle || Code ! Angle || Code ! Angle || Code ! Angle || Code ! Angle || Code ! Angle || Code
 * + Single-track Gray code for 360 positions
 * rowspan="42" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="42" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="42" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="42" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="42" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="42" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="42" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="42" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * rowspan="42" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * 0° || 100000001
 * 40° || 000000011
 * 80° || 000000110
 * 120° || 000001100
 * 160° || 000011000
 * 200° || 000110000
 * 240° || 001100000
 * 280° || 011000000
 * 320° || 110000000
 * 1° || 110000001
 * 41° || 100000011
 * 81° || 000000111
 * 121° || 000001110
 * 161° || 000011100
 * 201° || 000111000
 * 241° || 001110000
 * 281° || 011100000
 * 321° || 111000000
 * 2° || 111000001
 * 42° || 110000011
 * 82° || 100000111
 * 122° || 000001111
 * 162° || 000011110
 * 202° || 000111100
 * 242° || 001111000
 * 282° || 011110000
 * 322° || 111100000
 * 3° || 111000011
 * 43° || 110000111
 * 83° || 100001111
 * 123° || 000011111
 * 163° || 000111110
 * 203° || 001111100
 * 243° || 011111000
 * 283° || 111110000
 * 323° || 111100001
 * 4° || 111000111
 * 44° || 110001111
 * 84° || 100011111
 * 124° || 000111111
 * 164° || 001111110
 * 204° || 011111100
 * 244° || 111111000
 * 284° || 111110001
 * 324° || 111100011
 * 5° || 111001111
 * 45° || 110011111
 * 85° || 100111111
 * 125° || 001111111
 * 165° || 011111110
 * 205° || 111111100
 * 245° || 111111001
 * 285° || 111110011
 * 325° || 111100111
 * 6° || 111011111
 * 46° || 110111111
 * 86° || 101111111
 * 126° || 011111111
 * 166° || 111111110
 * 206° || 111111101
 * 246° || 111111011
 * 286° || 111110111
 * 326° || 111101111
 * 7° || 111011011
 * 47° || 110110111
 * 87° || 101101111
 * 127° || 011011111
 * 167° || 110111110
 * 207° || 101111101
 * 247° || 011111011
 * 287° || 111110110
 * 327° || 111101101
 * 8° || 101011011
 * 48° || 010110111
 * 88° || 101101110
 * 128° || 011011101
 * 168° || 110111010
 * 208° || 101110101
 * 248° || 011101011
 * 288° || 111010110
 * 328° || 110101101
 * 9° || 101011111
 * 49° || 010111111
 * 89° || 101111110
 * 129° || 011111101
 * 169° || 111111010
 * 209° || 111110101
 * 249° || 111101011
 * 289° || 111010111
 * 329° || 110101111
 * 10° || 101011101
 * 50° || 010111011
 * 90° || 101110110
 * 130° || 011101101
 * 170° || 111011010
 * 210° || 110110101
 * 250° || 101101011
 * 290° || 011010111
 * 330° || 110101110
 * 11° || 101010101
 * 51° || 010101011
 * 91° || 101010110
 * 131° || 010101101
 * 171° || 101011010
 * 211° || 010110101
 * 251° || 101101010
 * 291° || 011010101
 * 331° || 110101010
 * 12° || 101010111
 * 52° || 010101111
 * 92° || 101011110
 * 132° || 010111101
 * 172° || 101111010
 * 212° || 011110101
 * 252° || 111101010
 * 292° || 111010101
 * 332° || 110101011
 * 13° || 101110111
 * 53° || 011101111
 * 93° || 111011110
 * 133° || 110111101
 * 173° || 101111011
 * 213° || 011110111
 * 253° || 111101110
 * 293° || 111011101
 * 333° || 110111011
 * 14° || 001110111
 * 54° || 011101110
 * 94° || 111011100
 * 134° || 110111001
 * 174° || 101110011
 * 214° || 011100111
 * 254° || 111001110
 * 294° || 110011101
 * 334° || 100111011
 * 15° || 001010111
 * 55° || 010101110
 * 95° || 101011100
 * 135° || 010111001
 * 175° || 101110010
 * 215° || 011100101
 * 255° || 111001010
 * 295° || 110010101
 * 335° || 100101011
 * 16° || 001011111
 * 56° || 010111110
 * 96° || 101111100
 * 136° || 011111001
 * 176° || 111110010
 * 216° || 111100101
 * 256° || 111001011
 * 296° || 110010111
 * 336° || 100101111
 * 17° || 001011011
 * 57° || 010110110
 * 97° || 101101100
 * 137° || 011011001
 * 177° || 110110010
 * 217° || 101100101
 * 257° || 011001011
 * 297° || 110010110
 * 337° || 100101101
 * 18° || 001011001
 * 58° || 010110010
 * 98° || 101100100
 * 138° || 011001001
 * 178° || 110010010
 * 218° || 100100101
 * 258° || 001001011
 * 298° || 010010110
 * 338° || 100101100
 * 19° || 001111001
 * 59° || 011110010
 * 99° || 111100100
 * 139° || 111001001
 * 179° || 110010011
 * 219° || 100100111
 * 259° || 001001111
 * 299° || 010011110
 * 339° || 100111100
 * 20° || 001111101
 * 60° || 011111010
 * 100° || 111110100
 * 140° || 111101001
 * 180° || 111010011
 * 220° || 110100111
 * 260° || 101001111
 * 300° || 010011111
 * 340° || 100111110
 * 21° || 000111101
 * 61° || 001111010
 * 101° || 011110100
 * 141° || 111101000
 * 181° || 111010001
 * 221° || 110100011
 * 261° || 101000111
 * 301° || 010001111
 * 341° || 100011110
 * 22° || 000110101
 * 62° || 001101010
 * 102° || 011010100
 * 142° || 110101000
 * 182° || 101010001
 * 222° || 010100011
 * 262° || 101000110
 * 302° || 010001101
 * 342° || 100011010
 * 23° || 000100101
 * 63° || 001001010
 * 103° || 010010100
 * 143° || 100101000
 * 183° || 001010001
 * 223° || 010100010
 * 263° || 101000100
 * 303° || 010001001
 * 343° || 100010010
 * 24° || 000101101
 * 64° || 001011010
 * 104° || 010110100
 * 144° || 101101000
 * 184° || 011010001
 * 224° || 110100010
 * 264° || 101000101
 * 304° || 010001011
 * 344° || 100010110
 * 25° || 000101001
 * 65° || 001010010
 * 105° || 010100100
 * 145° || 101001000
 * 185° || 010010001
 * 225° || 100100010
 * 265° || 001000101
 * 305° || 010001010
 * 345° || 100010100
 * 26° || 000111001
 * 66° || 001110010
 * 106° || 011100100
 * 146° || 111001000
 * 186° || 110010001
 * 226° || 100100011
 * 266° || 001000111
 * 306° || 010001110
 * 346° || 100011100
 * 27° || 000110001
 * 67° || 001100010
 * 107° || 011000100
 * 147° || 110001000
 * 187° || 100010001
 * 227° || 000100011
 * 267° || 001000110
 * 307° || 010001100
 * 347° || 100011000
 * 28° || 000010001
 * 68° || 000100010
 * 108° || 001000100
 * 148° || 010001000
 * 188° || 100010000
 * 228° || 000100001
 * 268° || 001000010
 * 308° || 010000100
 * 348° || 100001000
 * 29° || 000011001
 * 69° || 000110010
 * 109° || 001100100
 * 149° || 011001000
 * 189° || 110010000
 * 229° || 100100001
 * 269° || 001000011
 * 309° || 010000110
 * 349° || 100001100
 * 30° || 000001001
 * 70° || 000010010
 * 110° || 000100100
 * 150° || 001001000
 * 190° || 010010000
 * 230° || 100100000
 * 270° || 001000001
 * 310° || 010000010
 * 350° || 100000100
 * 31° || 100001001
 * 71° || 000010011
 * 111° || 000100110
 * 151° || 001001100
 * 191° || 010011000
 * 231° || 100110000
 * 271° || 001100001
 * 311° || 011000010
 * 351° || 110000100
 * 32° || 100001101
 * 72° || 000011011
 * 112° || 000110110
 * 152° || 001101100
 * 192° || 011011000
 * 232° || 110110000
 * 272° || 101100001
 * 312° || 011000011
 * 352° || 110000110
 * 33° || 100000101
 * 73° || 000001011
 * 113° || 000010110
 * 153° || 000101100
 * 193° || 001011000
 * 233° || 010110000
 * 273° || 101100000
 * 313° || 011000001
 * 353° || 110000010
 * 34° || 110000101
 * 74° || 100001011
 * 114° || 000010111
 * 154° || 000101110
 * 194° || 001011100
 * 234° || 010111000
 * 274° || 101110000
 * 314° || 011100001
 * 354° || 111000010
 * 35° || 010000101
 * 75° || 100001010
 * 115° || 000010101
 * 155° || 000101010
 * 195° || 001010100
 * 235° || 010101000
 * 275° || 101010000
 * 315° || 010100001
 * 355° || 101000010
 * 36° || 010000111
 * 76° || 100001110
 * 116° || 000011101
 * 156° || 000111010
 * 196° || 001110100
 * 236° || 011101000
 * 276° || 111010000
 * 316° || 110100001
 * 356° || 101000011
 * 37° || 010000011
 * 77° || 100000110
 * 117° || 000001101
 * 157° || 000011010
 * 197° || 000110100
 * 237° || 001101000
 * 277° || 011010000
 * 317° || 110100000
 * 357° || 101000001
 * 38° || 010000001
 * 78° || 100000010
 * 118° || 000000101
 * 158° || 000001010
 * 198° || 000010100
 * 238° || 000101000
 * 278° || 001010000
 * 318° || 010100000
 * 358° || 101000000
 * 39° || 000000001
 * 79° || 000000010
 * 119° || 000000100
 * 159° || 000001000
 * 199° || 000010000
 * 239° || 000100000
 * 279° || 001000000
 * 319° || 010000000
 * 359° || 100000000
 * }
 * {|class="wikitable" style="text-align:center; background:#FFFFFF; border-width:0;"
 * 76° || 100001110
 * 116° || 000011101
 * 156° || 000111010
 * 196° || 001110100
 * 236° || 011101000
 * 276° || 111010000
 * 316° || 110100001
 * 356° || 101000011
 * 37° || 010000011
 * 77° || 100000110
 * 117° || 000001101
 * 157° || 000011010
 * 197° || 000110100
 * 237° || 001101000
 * 277° || 011010000
 * 317° || 110100000
 * 357° || 101000001
 * 38° || 010000001
 * 78° || 100000010
 * 118° || 000000101
 * 158° || 000001010
 * 198° || 000010100
 * 238° || 000101000
 * 278° || 001010000
 * 318° || 010100000
 * 358° || 101000000
 * 39° || 000000001
 * 79° || 000000010
 * 119° || 000000100
 * 159° || 000001000
 * 199° || 000010000
 * 239° || 000100000
 * 279° || 001000000
 * 319° || 010000000
 * 359° || 100000000
 * }
 * {|class="wikitable" style="text-align:center; background:#FFFFFF; border-width:0;"
 * 359° || 100000000
 * }
 * {|class="wikitable" style="text-align:center; background:#FFFFFF; border-width:0;"

! Starting Angle || Ending Angle || Length
 * + Starting and ending angles for the 20 tracks for a Single-track Gray Code with 9 sensors separated by 40°
 * rowspan="21" style="text-align:center; background:#FFFFFF; border-width:0;"|
 * 3 ||  4 ||  2
 * 23 || 28 ||  6
 * 31 || 37 ||  7
 * 44 || 48 ||  5
 * 56 || 60 ||  5
 * 64 || 71 ||  8
 * 74 || 76 ||  3
 * 88 || 91 ||  4
 * 94 || 96 ||  3
 * 99 || 104 || 6
 * 110 || 115 || 6
 * 131 || 134 || 4
 * 138 || 154 || 17
 * 173 || 181 || 9
 * 186 || 187 || 2
 * 220 || 238 || 19
 * 242 || 246 || 5
 * 273 || 279 || 7
 * 286 || 289 || 4
 * 307 || 360 || 54
 * }
 * 110 || 115 || 6
 * 131 || 134 || 4
 * 138 || 154 || 17
 * 173 || 181 || 9
 * 186 || 187 || 2
 * 220 || 238 || 19
 * 242 || 246 || 5
 * 273 || 279 || 7
 * 286 || 289 || 4
 * 307 || 360 || 54
 * }
 * 242 || 246 || 5
 * 273 || 279 || 7
 * 286 || 289 || 4
 * 307 || 360 || 54
 * }
 * 286 || 289 || 4
 * 307 || 360 || 54
 * }
 * }

Two-dimensional Gray code

Two-dimensional Gray codes are used in communication to minimize the number of bit errors in quadrature amplitude modulation (QAM) adjacent points in the constellation. In a typical encoding the horizontal and vertical adjacent constellation points differ by a single bit, and diagonal adjacent points differ by 2 bits.

Two-dimensional Gray codes also have uses in location identifications schemes, where the code would be applied to area maps such as a Mercator projection of the earth's surface and an appropriate cyclic two-dimensional distance function such as the Mannheim metric be used to calculate the distance between two encoded locations, thereby combining the characteristics of the Hamming distance with the cyclic continuation of a Mercator projection.

Excess-Gray-code
If a subsection of a specific codevalue is extracted from that value, for example the last 3 bits of a 4-bit gray-code, the resulting code will be an "excess gray code". This code shows the property of counting backwards in those extracted bits if the original value is further increased. Reason for this is that gray-encoded values do not show the behaviour of overflow, known from classic binary encoding, when increasing past the "highest" value.

Example: The highest 3-bit gray code, 7, is encoded as (0)100. Adding 1 results in number 8, encoded in gray as 1100. The last 3 bits do not overflow and count backwards if you further increase the original 4 bit code.

When working with sensors that output multiple, gray-encoded values in a serial fashion, one should therefore pay attention whether the sensor produces those multiple values encoded in 1 single gray-code or as separate ones, as otherwise the values might appear to be counting backwards when an "overflow" is expected.

Gray isometry
The bijective mapping { 0 ↔ 00, 1 ↔ 01, 2 ↔ 11, 3 ↔ 10 } establishes an isometry between the metric space over the finite field $$\mathbb{Z}_2^2$$ with the metric given by the Hamming distance and the metric space over the finite ring $$\mathbb{Z}_4$$ (the usual modular arithmetic) with the metric given by the Lee distance. The mapping is suitably extended to an isometry of the Hamming spaces $$\mathbb{Z}_2^{2m}$$ and $$\mathbb{Z}_4^m$$. Its importance lies in establishing a correspondence between various "good" but not necessarily linear codes as Gray-map images in $$\mathbb{Z}_2^2$$ of ring-linear codes from $$\mathbb{Z}_4$$.

Related codes
There are a number of binary codes similar to Gray codes, including:
 * Datex codes aka Giannini codes (1954), as described by Carl P. Spaulding,     use a variant of O'Brien code II.
 * Codes used by Varec (ca. 1954),  use a variant of O'Brien code I as well as base-12 and base-16 Gray code variants.
 * Lucal code (1959)  aka modified reflected binary code (MRB)
 * Gillham code (1961/1962),    uses a variant of Datex code and O'Brien code II.
 * Leslie and Russell code (1964)
 * Royal Radar Establishment code
 * Hoklas code (1988)

The following binary-coded decimal (BCD) codes are Gray code variants as well:
 * Petherick code (1953),      also known as Royal Aircraft Establishment (RAE) code.
 * O'Brien codes I and II (1955)     (An O'Brien type-I code was already described by Frederic A. Foss of IBM  and used by Varec in 1954. Later, it was also known as Watts code or Watts reflected decimal (WRD) code and is sometimes ambiguously referred to as reflected binary modified Gray code.           An O'Brien type-II code was already used by Datex in 1954. )
 * Excess-3 Gray code (1956) (aka Gray excess-3 code,  Gray 3-excess code, reflex excess-3 code, excess Gray code, Gray excess code, 10-excess-3 Gray code or Gray–Stibitz code), described by Frank P. Turvey Jr. of ITT.
 * Tompkins codes I and II (1956)
 * Glixon code (1957), sometimes ambiguously also called modified Gray code

title: Gray code


text:
Executive

Executive (exe., exec., execu.) may refer to:

Role or title

 * Executive, a senior management role in an organization
 * Chief executive officer (CEO), one of the highest-ranking corporate officers (executives) or administrators
 * Executive director, job title of the chief executive in many non-profit, government and international organizations; also a description contrasting with non-executive director
 * Executive officer, a high-ranking member of a corporation body, government or military
 * Business executive, a person responsible for running an organization
 * Music executive or record executive, person within a record label who works in senior management
 * Studio executive, employee of a film studio
 * Executive producer, a person who oversees the production of an entertainment product
 * Account executive, a job title given by a number of marketing agencies (usually to trainee staff who report to account managers)
 * Project executive, a role with the overall responsibility of a project, typically required for larger or more complex projects
 * Executive education, term used for programs at graduate-level business schools that aim to educate managers or entrepreneurs

Function

 * Executive (government), branch of government that has authority and responsibility for the administration of state bureaucracy
 * Executive functions or executive system, theorized cognitive system in psychology that controls and manages other cognitive processes

Arts, entertainment, and media

 * Executive (magazine), a Lebanese business monthly
 * The Executive, a fictional raincoat in the Seinfeld episode "The Raincoats"
 * The Executive, (George Michael § The Executive) a musical band including Andrew Ridgeley and George Michael before the formation of Wham!

Brands and enterprises

 * Chrysler Executive, a car offered 1983–1986
 * Sinclair Executive, an electronic calculator offered in the early 1970s

Computing and technology

 * Executive (operating system), the operating system for the ICL 290x range of computers
 * The Windows Executive, internal part of modern Microsoft Windows operating systems

Other uses

 * Executive car, in Britain: an automobile larger than a large family car
 * Executive paper size (often 7.25 ×)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Executive


text:
Gold code

A Gold code, also known as Gold sequence, is a type of binary sequence, used in telecommunication (CDMA) and satellite navigation (GPS). Gold codes are named after Robert Gold. Gold codes have bounded small cross-correlations within a set, which is useful when multiple devices are broadcasting in the same frequency range. A set of Gold code sequences consists of 2n + 1 sequences each one with a period of 2n − 1.

A set of Gold codes can be generated with the following steps. Pick two maximum length sequences of the same length 2n − 1 such that their absolute cross-correlation is less than or equal to 2(n+2)/2, where n is the size of the linear-feedback shift register used to generate the maximum length sequence (Gold '67). The set of the 2n − 1 exclusive-ors of the two sequences in their various phases (i.e. translated into all relative positions) together with the two maximum length sequences form a set of 2n + 1 Gold code sequences. The highest absolute cross-correlation in this set of codes is 2(n+2)/2 + 1 for even n and 2(n+1)/2 + 1 for odd n.

The exclusive or of two different Gold codes from the same set is another Gold code in some phase.

Within a set of Gold codes about half of the codes are balanced – the number of ones and zeros differs by only one.

Gold codes are used in GPS. The GPS C/A ranging codes are Gold codes of period 1,023.

title: Gold code


text:
Personal rapid transit

Personal rapid transit (PRT), also referred to as podcars or guided/railed taxis, is a public transport mode featuring a network of specially built guideways on which ride small automated vehicles that carry few (generally less than 6) passengers per vehicle. PRT is a type of automated guideway transit (AGT), a class of system which also includes larger vehicles all the way to small subway systems. In terms of routing, it tends towards personal public transport systems.

PRT vehicles are sized for individual or small group travel, typically carrying no more than three to six passengers per vehicle. Guideways are arranged in a network topology, with all stations located on sidings, and with frequent merge/diverge points. This allows for nonstop, point-to-point travel, bypassing all intermediate stations. The point-to-point service has been compared to a taxi or a horizontal lift (elevator).

Numerous PRT systems have been proposed but most have not been implemented. , only a handful of PRT systems are operational: Morgantown Personal Rapid Transit (the oldest and most extensive), in Morgantown, West Virginia, has been in continuous operation since 1975. Since 2010 a 10-vehicle 2getthere system has operated at Masdar City, UAE, and since 2011 a 21-vehicle Ultra PRT system has run at London Heathrow Airport. A 40-vehicle Vectus system with in-line stations officially opened in Suncheon, South Korea, in April 2014. A PRT system connecting the terminals and parking has been built at the new Chengdu Tianfu International Airport, which opened in 2021.

Overview
Most mass transit systems move people in groups over scheduled routes. This has inherent inefficiencies. For passengers, time is wasted by waiting for the next vehicle to arrive, indirect routes to their destination, stopping for passengers with other destinations, and often confusing or inconsistent schedules. Slowing and accelerating large weights can undermine public transport's benefit to the environment while slowing other traffic.

Personal rapid transit systems attempt to eliminate these wastes by moving small groups nonstop in automated vehicles on fixed tracks. Passengers can ideally board a pod immediately upon arriving at a station, and can – with a sufficiently extensive network of tracks – take relatively direct routes to their destination without stops.

The low weight of PRT's small vehicles allows smaller guideways and support structures than mass transit systems like light rail. The smaller structures translate into lower construction costs, smaller easements, and less visually obtrusive infrastructure.

As it stands, a citywide deployment with many lines and closely spaced stations, as envisioned by proponents, has yet to be constructed. Past projects have failed because of financing, cost overruns, regulatory conflicts, political issues, misapplied technology, and flaws in design, engineering or review.

However, the theory remains active. For example, from 2002 to 2005, the EDICT project, sponsored by the European Union, conducted a study on the feasibility of PRT in four European cities. The study involved 12 research organizations, and concluded that PRT: The report also concluded that, despite these advantages, public authorities will not commit to building PRT because of the risks associated with being the first public implementation.
 * would provide future cities "a highly accessible, user-responsive, environmentally friendly transport system which offers a sustainable and economic solution."
 * could "cover its operating costs, and provide a return which could pay for most, if not all, of its capital costs."
 * would provide "a level of service which is superior to that available from conventional public transport."
 * would be "well received by the public, both public transport and car users."

The PRT acronym was introduced formally in 1978 by J. Edward Anderson. The Advanced Transit Association (ATRA), a group which advocates the use of technological solutions to transit problems, compiled a definition in 1988 that can be seen here.

List of operational automated transit networks (ATN) systems
Currently, five advanced transit networks (ATN) systems are operational, and several more are in the planning stage.

List of ATN suppliers
The following list summarizes several well-known automated transit networks (ATN) suppliers as of 2014, with subsequent amendments.

 * Revenue service: Boeing (Morgantown PRT), Heathrow pod, 2getthere, Vectus.
 * Full test track: Modutram, Cabinentaxi, Glydways, Urbanloop
 * Historical: CVS, Aramis, PRT2000 (Raytheon), Monocab/ROMAG, EcoMobility, Tubenet Transit Systems

Origins
Modern PRT concepts began around 1953 when Donn Fichter, a city transportation planner, began research on PRT and alternative transportation methods. In 1964, Fichter published a book which proposed an automated public transit system for areas of medium to low population density. One of the key points made in the book was Fichter's belief that people would not leave their cars in favor of public transit unless the system offered flexibility and end-to-end transit times that were much better than existing systems – flexibility and performance he felt only a PRT system could provide. Several other urban and transit planners also wrote on the topic and some early experimentation followed, but PRT remained relatively unknown.

Around the same time, Edward Haltom was studying monorail systems. Haltom noticed that the time to start and stop a conventional large monorail train, like those of the Wuppertal Schwebebahn, meant that a single line could only support between 20 and 40 vehicles an hour. In order to get reasonable passenger movements on such a system, the trains had to be large enough to carry hundreds of passengers (see headway for a general discussion). This, in turn, demanded large guideways that could support the weight of these large vehicles, driving up capital costs to the point where he considered them unattractive.

Haltom turned his attention to developing a system that could operate with shorter timings, thereby allowing the individual cars to be smaller while preserving the same overall route capacity. Smaller cars would mean less weight at any given point, which meant smaller and less expensive guideways. To eliminate the backup at stations, the system used "offline" stations that allowed the mainline traffic to bypass the stopped vehicles. He designed the Monocab system using six-passenger cars suspended on wheels from an overhead guideway. Like most suspended systems, it suffered from the problem of difficult switching arrangements. Since the car rode on a rail, switching from one path to another required the rail to be moved, a slow process that limited the possible headways.

UMTA is formed
By the late 1950s the problems with urban sprawl were becoming evident in the United States. When cities improved roads and the transit times were lowered, suburbs developed at ever increasing distances from the city cores, and people moved out of the downtown areas. Lacking pollution control systems, the rapid rise in car ownership and the longer trips to and from work were causing significant air quality problems. Additionally, movement to the suburbs led to a flight of capital from the downtown areas, one cause of the rapid urban decay seen in the US.

Mass transit systems were one way to combat these problems. Yet during this period, the federal government was feeding the problems by funding the development of the Interstate Highway System, while at the same time funding for mass transit was being rapidly scaled back. Public transit ridership in most cities plummeted.

In 1962, President John F. Kennedy charged Congress with the task of addressing these problems. These plans came to fruition in 1964, when President Lyndon B. Johnson signed the Urban Mass Transportation Act of 1964 into law, thereby forming the Urban Mass Transportation Administration. UMTA was set up to fund mass transit developments in the same fashion that the earlier Federal Aid Highway Act of 1956 had helped create the Interstate Highways. That is, UMTA would help cover the capital costs of building out new infrastructure.

PRT research starts
However, planners who were aware of the PRT concept were worried that building more systems based on existing technologies would not help the problem, as Fitcher had earlier noted. Proponents suggested that systems would have to offer the flexibility of a car:

The reason for the sad state of public transit is a very basic one – the transit systems just do not offer a service which will attract people away from their automobiles. Consequently, their patronage comes very largely from those who cannot drive, either because they are too young, too old, or because they are too poor to own and operate an automobile. Look at it from the standpoint of a commuter who lives in a suburb and is trying to get to work in the central business district (CBD). If he is going to go by transit, a typical scenario might be the following: he must first walk to the closest bus stop, let us say a five or ten minute walk, and then he may have to wait up to another ten minutes, possibly in inclement weather, for the bus to arrive. When it arrives, he may have to stand unless he is lucky enough to find a seat. The bus will be caught up in street congestion and move slowly, and it will make many stops completely unrelated to his trip objective. The bus may then let him off at a terminal to a suburban train. Again he must wait, and, after boarding the train, again experience a number of stops on the way to the CBD, and possibly again he may have to stand in the aisle. He will get off at the station most convenient to his destination and possibly have to transfer again onto a distribution system. It is no wonder that in those cities where ample inexpensive parking is available, most of those who can drive do drive.

In 1966, the United States Department of Housing and Urban Development was asked to "undertake a project to study ... new systems of urban transportation that will carry people and goods ... speedily, safely, without polluting the air, and in a manner that will contribute to sound city planning." The resulting report was published in 1968 and proposed the development of PRT, as well as other systems such as dial-a-bus and high-speed interurban links.

In the late 1960s, the Aerospace Corporation, an independent non-profit corporation set up by the US Congress, spent substantial time and money on PRT, and performed much of the early theoretical and systems analysis. However, this corporation is not allowed to sell to non-federal government customers. In 1969, members of the study team published the first widely publicized description of PRT in Scientific American. In 1978 the team also published a book. These publications sparked off a sort of "transit race" in the same sort of fashion as the space race, with countries around the world rushing to join what appeared to be a future market of immense size.

The oil crisis of 1973 made vehicle fuels more expensive, which naturally interested people in alternative transportation.

System developments
In 1967, aerospace giant Matra started the Aramis project in Paris. After spending about 500 million francs, the project was canceled when it failed its qualification trials in November 1987. The designers tried to make Aramis work like a "virtual train", but control software issues caused cars to bump unacceptably. The project ultimately failed.

Between 1970 and 1978, Japan operated a project called "Computer-controlled Vehicle System" (CVS). In a full-scale test facility, 84 vehicles operated at speeds up to 60 km/h on a 4.8 km guideway; one-second headways were achieved during tests. Another version of CVS was in public operation for six months from 1975 to 1976. This system had 12 single-mode vehicles and four dual-mode vehicles on a 1.6 km track with five stations. This version carried over 800,000 passengers. CVS was cancelled when Japan's Ministry of Land, Infrastructure and Transport declared it unsafe under existing rail safety regulations, specifically in respect of braking and headway distances.

On March 23, 1973, U.S. Urban Mass Transportation Administration (UMTA) administrator Frank Herringer testified before Congress: "A DOT program leading to the development of a short, one-half to one-second headway, high-capacity PRT (HCPRT) system will be initiated in fiscal year 1974." However, this HCPRT program was diverted into a modest technology program. According to PRT supporter J. Edward Anderson, this was "because of heavy lobbying from interests fearful of becoming irrelevant if a genuine PRT program became visible." From that time forward people interested in HCPRT were unable to obtain UMTA research funding.

In 1975, the Morgantown Personal Rapid Transit project was completed. It has five off-line stations that enable non-stop, individually programmed trips along an 8.7 mi track serviced by a fleet of 71 cars. This is a crucial characteristic of PRT. However, it is not considered a PRT system because its vehicles are too heavy and carry too many people. When it carries many people, it operates in a point-to-point fashion, instead of running like an automated people mover from one end of the line to the other. During periods of low usage all cars make a full circuit stopping at every station in both directions. Morgantown PRT is still in continuous operation at West Virginia University in Morgantown, West Virginia, with about 15,000 riders per day. The steam-heated track has proven expensive and the system requires an operation and maintenance budget of $5 million annually. Although it successfully demonstrated automated control and it is still operating it was not sold to other sites. A 2010 report concluded replacing the system with buses on roads would provide unsatisfactory service and create congestion. Subsequently, the forty year old computer and vehicle control systems were replaced in the 2010s and there are plans to replace the vehicles.

From 1969 to 1980, Mannesmann Demag and MBB cooperated to build the Cabinentaxi urban transportation system in Germany. Together the firms formed the Cabintaxi Joint Venture. They created an extensive PRT technology, including a test track, that was considered fully developed by the German government and its safety authorities. The system was to have been installed in Hamburg, but budget cuts stopped the proposed project before the start of construction. With no other potential projects on the horizon, the joint venture disbanded, and the fully developed PRT technology was never installed. Cabintaxi Corporation, a US-based company, obtained the technology in 1985, and remains active in the private-sector market trying to sell the system but so far there have been no installations.

In 1979 the three station Duke University Medical Center Patient Rapid Transit system was commissioned. Uniquely, the cars could move sideways, as well as backwards and forwards and it was described as a "horizontal elevator". The system was closed in 2009 to allow for expansion of the hospital.

In the 1990s, Raytheon invested heavily in a system called PRT 2000, based on technology developed by J. Edward Anderson at the University of Minnesota. Raytheon failed to install a contracted system in Rosemont, Illinois, near Chicago, when estimated costs escalated to US$50 million per mile, allegedly due to design changes that increased the weight and cost of the system relative to Anderson's original design. In 2000, rights to the technology reverted to the University of Minnesota, and were subsequently purchased by Taxi2000.

Later developments
In 1999 the 2getthere designed ParkShuttle system was opened in the Kralingen neighbourhood of eastern Rotterdam using 12-seater driverless buses. The system was extended in 2005 and new second-generation vehicles introduced to serve five stations over 1.8 km with five grade crossings over ordinary roads. Operation is scheduled in peak periods and on demand at other times. In 2002, 2getthere operated twenty five 4-passenger "CyberCabs" at Holland's 2002 Floriade horticultural exhibition. These transported passengers along a track spiraling up to the summit of Big Spotters Hill. The track was approximately 600 m long (one-way) and featured only two stations. The six-month operation was intended to research the public acceptance of PRT-like systems.

In 2010 a 10-vehicle (four seats each), two station 2getthere system was opened to connect a parking lot to the main area at Masdar City, UAE. The systems runs in an undercroft beneath the city and was supposed to be a pilot project for a much larger network, which would also have included transport of freight. Expansion of the system was cancelled just after the pilot scheme opened due to the cost of constructing the undercroft and since then other electric vehicles have been proposed.

In January 2003, the prototype ULTra ("Urban Light Transport") system in Cardiff, Wales, was certified to carry passengers by the UK Railway Inspectorate on a 1 km test track. ULTra was selected in October 2005 by BAA plc for London's Heathrow Airport. Since May 2011 a three-station system has been open to the public, transporting passengers from a remote parking lot to terminal 5. During the deployment of the system the owners of Heathrow became owners of the UltrPRT design. In May 2013 Heathrow Airport Limited included in its draft five-year (2014–2019) master plan a scheme to use the PRT system to connect terminal 2 and terminal 3 to their respective business car parks. The proposal was not included in the final plan due to spending priority given to other capital projects and has been deferred. If a third runway is constructed at Heathrow will destroy the existing system, which will be built over, will be replaced by another PRT.

In June 2006, a Korean/Swedish consortium, Vectus Ltd, started constructing a 400 m test track in Uppsala, Sweden. This test system was presented at the 2007 PodCar City conference in Uppsala. A 40-vehicle, 2-station, 4.46 km system called "SkyCube" was opened in Suncheon, South Korea, in April 2014.

In the 2010s the Mexican Western Institute of Technology and Higher Education began research into project LINT ("Lean Intelligent Network Transportation") and built a 1/12 operational scale model. This was further developed and became the Modutram system and a full-scale test track was built in Guadalajara, which was operational by 2014.

In 2018 it was announced that a PRT system would be installed at the new Chengdu Tianfu International Airport. The system will include 6 miles of guideway, 4 stations, 22 pods and will connect airport parking to two terminal buildings. It is supplied by Ultra MTS. The airport is due to open in 2021.

System design
Among the handful of prototype systems (and the larger number that exist on paper) there is a substantial diversity of design approaches, some of which are controversial.

Vehicle design
Vehicle weight influences the size and cost of a system's guideways, which are in turn a major part of the capital cost of the system. Larger vehicles are more expensive to produce, require larger and more expensive guideways, and use more energy to start and stop. If vehicles are too large, point-to-point routing also becomes more expensive. Against this, smaller vehicles have more surface area per passenger (thus have higher total air resistance which dominates the energy cost of keeping vehicles moving at speed), and larger motors are generally more efficient than smaller ones.

The number of riders who will share a vehicle is a key unknown. In the U.S., the average car carries 1.16 persons, and most industrialized countries commonly average below two people; not having to share a vehicle with strangers is a key advantage of private transport. Based on these figures, some have suggested that two passengers per vehicle (such as with skyTran, EcoPRT and Glydways), or even a single passenger per vehicle is optimum. Other designs use a car for a model, and choose larger vehicles, making it possible to accommodate families with small children, riders with bicycles, disabled passengers with wheelchairs, or a pallet or two of freight.

Propulsion
All current designs (except for the human-powered Shweeb) are powered by electricity. In order to reduce vehicle weight, power is generally transmitted via lineside conductors although two of the operating systems use on-board batteries. According to the designer of Skyweb/Taxi2000, J. Edward Anderson, the lightest system uses linear induction motor (LIM) on the vehicle for both propulsion and braking, which also makes manoeuvres consistent regardless of the weather, especially rain or snow. LIMs are used in a small number of rapid transit applications, but most designs use rotary motors. Most such systems retain a small on-board battery to reach the next stop after a power failure. CabinTaxi uses a LIM and was able to demonstrate 0.5 second headways on its test track. The Vectus prototype system used continuous track mounted LIMs with the reaction plate on the vehicle, eliminating the active propulsion system (and power required) on the vehicle.

ULTra and 2getthere use on-board batteries, recharged at stations. This increases the safety, and reduces the complexity, cost and maintenance of the guideway. As a result, the ULTRa guideway resembles a sidewalk with curbs and is inexpensive to construct. ULTRa and 2getthere vehicles resembles small automated electric cars, and use similar components. (The ULTRa POD chassis and cabin have been used as the basis of a shared autonomous vehicle for running in mixed traffic. )

Switching
Almost all designs avoid track switching, instead advocating vehicle-mounted switches (which engage with special guiderails at the junctions) or conventional steering. Advocates say that vehicle-switching permits faster routing so vehicles can run closer together which increases capacity. It also simplifies the guideway, makes junctions less visually obtrusive and reduces the impact of malfunctions, because a failed switch on one vehicle is less likely to affect other vehicles.

Track switching greatly increases headway distance. A vehicle must wait for the previous vehicle to clear the junction, for the track to switch and for the switch to be verified. Communication between the vehicle and wayside controllers adds both delays and more points of failure. If the track switching is faulty, vehicles must be able to stop before reaching the switch, and all vehicles approaching the failed junction would be affected.

Mechanical vehicle switching minimizes inter-vehicle spacing or headway distance, but it also increases the minimum distances between consecutive junctions. A mechanically switching vehicle, maneuvering between two adjacent junctions with different switch settings, cannot proceed from one junction to the next. The vehicle must adopt a new switch position, and then wait for the in-vehicle switch's locking mechanism to be verified. If the vehicle switching is faulty, that vehicle must be able to stop before reaching the next switch, and all vehicles approaching the failed vehicle would be affected.

Conventional steering allows a simpler 'track' consisting only of a road surface with some form of reference for the vehicle's steering sensors. Switching would be accomplished by the vehicle following the appropriate reference line – maintaining a set distance from the left roadway edge would cause the vehicle to diverge left at a junction, for example.

Guideways
Several types of guideways have been proposed or implemented, including beams similar to monorails, bridge-like trusses supporting internal tracks, and cables embedded in a roadway. Most designs put the vehicle on top of the track, which reduces visual intrusion and cost, as well as easing ground-level installation. An overhead track is necessarily higher, but may also be narrower. Most designs use the guideway to distribute power and data communications, including to the vehicles. The Morgantown PRT failed its cost targets because of the steam-heated track required to keep the large channel guideway free of frequent snow and ice. Heating uses up to four times as much as energy as that used to propel the vehicles. Most proposals plan to resist snow and ice in ways that should be less expensive. The Heathrow system has a special de-icing vehicle. Masdar's system has been limited because the exclusive right-of-way for the PRT was gained by running the vehicles in an undercroft at ground-level while building an elevated "street level" between all the buildings. This led to unrealistically expensive buildings and roads.

Stations
Proposals usually have stations close together, and located on side tracks so that through traffic can bypass vehicles picking up or dropping off passengers. Each station might have multiple berths, with perhaps one-third of the vehicles in a system being stored at stations waiting for passengers. Stations are envisioned to be minimalistic, without facilities such as rest rooms. For elevated stations, an elevator may be required for accessibility.

At least one system, Metrino, provides wheelchair and freight access by using a cogway in the track, so that the vehicle itself can go from a street-level stop to an overhead track.

Some designs have included substantial extra expense for the track needed to decelerate to and accelerate from stations. In at least one system, Aramis, this nearly doubled the width and cost of the required right-of-way and caused the nonstop passenger delivery concept to be abandoned. Other designs have schemes to reduce this cost, for example merging vertically to reduce the footprint.

Headway distance
Spacing of vehicles on the guideway influences the maximum passenger capacity of a track, so designers prefer smaller headway distances. Computerized control and active electronic braking (of motors) theoretically permit much closer spacing than the two-second headways recommended for cars at speed. In these arrangements, multiple vehicles operate in "platoons" and can be braked simultaneously. There are prototypes for automatic guidance of private cars based on similar principles.

Very short headways are controversial. The UK Railway Inspectorate has evaluated the ULTra design and is willing to accept one-second headways, pending successful completion of initial operational tests at more than 2 seconds. In other jurisdictions, preexisting rail regulations apply to PRT systems (see CVS, above); these typically calculate headways for absolute stopping distances with standing passengers. These severely restrict capacity and make PRT systems infeasible. Another standard said trailing vehicles must stop if the vehicle in front stopped instantaneously (or like a "brick wall"). In 2018 a committee of the American Society of Mechanical Engineers considered replacing the "brick wall" standard with a requirement for vehicles to maintain a safe "separation zone" based on the minimum stopping distance of the lead vehicle and the maximum stopping of the trailing vehicle. These changes were introduced into the standard in 2021.

Capacity
PRT is usually proposed as an alternative to rail systems, so comparisons tend to be with rail. PRT vehicles seat fewer passengers than trains and buses, and must offset this by combining higher average speeds, diverse routes, and shorter headways. Proponents assert that equivalent or higher overall capacity can be achieved by these means.

Single line capacity
With two-second headways and four-person vehicles, a single PRT line can achieve theoretical maximum capacity of 7,200 passengers per hour. However, most estimates assume that vehicles will not generally be filled to capacity, due to the point-to-point nature of PRT. At a more typical average vehicle occupancy of 1.5 persons per vehicle, the maximum capacity is 2,700 passengers per hour. Some researchers have suggested that rush hour capacity can be improved if operating policies support ridesharing.

Capacity is inversely proportional to headway. Therefore, moving from two-second headways to one-second headways would double PRT capacity. Half-second headways would quadruple capacity. Theoretical minimum PRT headways would be based on the mechanical time to engage brakes, and these are much less than a half second. Researchers suggest that high capacity PRT (HCPRT) designs could operate safely at half-second headways, which has already been achieved in practice on the Cabintaxi test track in the late 1970s. Using the above figures, capacities above 10,000 passengers per hour seem in reach.

In simulations of rush hour or high-traffic events, about one-third of vehicles on the guideway need to travel empty to resupply stations with vehicles in order to minimize response time. This is analogous to trains and buses travelling nearly empty on the return trip to pick up more rush hour passengers.

Grade separated light rail systems can move 15,000 passengers per hour on a fixed route, but these are usually fully grade separated systems. Street level systems typically move up to 7,500 passengers per hour. Heavy rail subways can move 50,000 passengers per hour per direction. As with PRT, these estimates depend on having enough trains.

Neither light nor heavy rail scales operated efficiently in off-peak when capacity utilization is low but a schedule must be maintained. In a PRT system when demand is low, surplus vehicles will be configured to stop at empty stations at strategically placed points around the network. This enables an empty vehicle to quickly be despatched to wherever it is required, with minimal waiting time for the passenger. PRT systems will have to re-circulate empty vehicles if there is an imbalance in demand along a route, as is common in peak periods.

Networked PRT capacity
The above discussion compares line or corridor capacity and may therefore not be relevant for a networked PRT system, where several parallel lines (or parallel components of a grid) carry traffic. In addition, Muller estimated that while PRT may need more than one guideway to match the capacity of a conventional system, the capital cost of the multiple guideways may still be less than that of the single guideway conventional system. Thus comparisons of line capacity should also consider the cost per line.

PRT systems should require much less horizontal space than existing metro systems, with individual cars being typically around 50% as wide for side-by-side seating configurations, and less than 33% as wide for single-file configurations. This is an important factor in densely populated, high-traffic areas.

Travel speed
For a given peak speed, nonstop journeys are about three times as fast as those with intermediate stops. This is not just because of the time for starting and stopping. Scheduled vehicles are also slowed by boardings and exits for multiple destinations.

Therefore, a given PRT seat transports about three times as many passenger miles per day as a seat performing scheduled stops. So PRT should also reduce the number of needed seats threefold for a given number of passenger miles.

While a few PRT designs have operating speeds of 100 km/hour, and one as high as 241 km/hour, most are in the region of 40-70 km/hour. Rail systems generally have higher maximum speeds, typically 90-130 km/hour and sometimes well in excess of 160 km/hour, but average travel speed is reduced about threefold by scheduled stops and passenger transfers.

Ridership attraction
If PRT designs deliver the claimed benefit of being substantially faster than cars in areas with heavy traffic, simulations suggest that PRT could attract many more car drivers than other public transit systems. Standard mass transit simulations accurately predict that 2% of trips (including cars) will switch to trains. Similar methods predict that 11% to 57% of trips would switch to PRT, depending on its costs and delays.

Control algorithms
The typical control algorithm places vehicles in imaginary moving "slots" that go around the loops of track. Real vehicles are allocated a slot by track-side controllers. Traffic jams are prevented by placing north–south vehicles in even slots, and east/west vehicles in odd slots. At intersections, the traffic in these systems can interpenetrate without slowing.

On-board computers maintain their position by using a negative feedback loop to stay near the center of the commanded slot. Early PRT vehicles measured their position by adding up the distance using odometers, with periodic check points to compensate for cumulative errors. Next-generation GPS and radio location could measure positions as well.

Another system, "pointer-following control", assigns a path and speed to a vehicle, after verifying that the path does not violate the safety margins of other vehicles. This permits system speeds and safety margins to be adjusted to design or operating conditions, and may use slightly less energy. The maker of the ULTra PRT system reports that testing of its control system shows lateral (side-to-side) accuracy of 1 cm, and docking accuracy better than 2 cm.

Safety
Computer control eliminates errors from human drivers, so PRT designs in a controlled environment should be much safer than private motoring on roads. Most designs enclose the running gear in the guideway to prevent derailments. Grade-separated guideways would prevent conflict with pedestrians or manually controlled vehicles. Other public transit safety engineering approaches, such as redundancy and self-diagnosis of critical systems, are also included in designs.

The Morgantown system, more correctly described as a Group Rapid Transit (GRT) type of Automated Guideway Transit system (AGT), has completed 110 million passenger-miles without serious injury. According to the U.S. Department of Transportation, AGT systems as a group have higher injury rates than any other form of rail-based transit (subway, metro, light rail, or commuter rail) though still much better than ordinary buses or cars. More recent research by the British company ULTra PRT reported that AGT systems have a better safety than more conventional, non-automated modes.

As with many current transit systems, personal passenger safety concerns are likely to be addressed through CCTV monitoring, and communication with a central command center from which engineering or other assistance may be dispatched.

Energy efficiency
The energy efficiency advantages claimed by PRT proponents include two basic operational characteristics of PRT: an increased average load factor; and the elimination of intermediate starting and stopping.

Average load factor, in transit systems, is the ratio of the total number of riders to the total theoretical capacity. A transit vehicle running at full capacity has a 100% load factor, while an empty vehicle has 0% load factor. If a transit vehicle spends half the time running at 100% and half the time running at 0%, the average load factor is 50%. Higher average load factor corresponds to lower energy consumption per passenger, so designers attempt to maximize this metric.

Scheduled mass transit (i.e. buses or trains) trades off service frequency and load factor. Buses and trains must run on a predefined schedule, even during off-peak times when demand is low and vehicles are nearly empty. So to increase load factor, transportation planners try to predict times of low demand, and run reduced schedules or smaller vehicles at these times. This increases passengers' wait times. In many cities, trains and buses do not run at all at night or on weekends.

PRT vehicles, in contrast, would only move in response to demand, which places a theoretical lower bound on their average load factor. This allows 24-hour service without many of the costs of scheduled mass transit.

ULTra PRT estimates its system will consume 839 BTU per passenger mile (0.55 MJ per passenger km). By comparison, cars consume 3,496 BTU, and personal trucks consume 4,329 BTU per passenger mile.

Due to PRT's efficiency, some proponents say solar becomes a viable power source. PRT elevated structures provide a ready platform for solar collectors, therefore some proposed designs include solar power as a characteristic of their networks.

For bus and rail transit, the energy per passenger-mile depends on the ridership and the frequency of service. Therefore, the energy per passenger-mile can vary significantly from peak to non-peak times. In the US, buses consume an average of 4,318 BTU/passenger-mile, transit rail 2,750 BTU/passenger-mile, and commuter rail 2,569 BTU/passenger-mile.

Opposition and controversy
Opponents to PRT schemes have expressed a number of concerns:

Technical feasibility debate
Vukan R. Vuchic, professor of Transportation Engineering at the University of Pennsylvania and a proponent of traditional forms of transit, has stated his belief that the combination of small vehicles and expensive guideway makes it highly impractical in both cities (not enough capacity) and suburbs (guideway too expensive). According to Vuchic: "...the PRT concept combines two mutually incompatible elements of these two systems: very small vehicles with complicated guideways and stations. Thus, in central cities, where heavy travel volumes could justify investment in guideways, vehicles would be far too small to meet the demand. In suburbs, where small vehicles would be ideal, the extensive infrastructure would be economically unfeasible and environmentally unacceptable."

PRT supporters claim that Vuchic's conclusions are based on flawed assumptions. PRT proponent J.E. Anderson wrote, in a rebuttal to Vuchic: "I have studied and debated with colleagues and antagonists every objection to PRT, including those presented in papers by Professor Vuchic, and find none of substance. Among those willing to be briefed in detail and to have all of their questions and concerns answered, I find great enthusiasm to see the system built."

The manufacturers of ULTra acknowledge that current forms of their system would provide insufficient capacity in high-density areas such as central London, and that the investment costs for the tracks and stations are comparable to building new roads, making the current version of ULTra more suitable for suburbs and other moderate capacity applications, or as a supplementary system in larger cities.

Regulatory concerns
Possible regulatory concerns include emergency safety, headways, and accessibility for the disabled. Many jurisdictions regulate PRT systems as if they were trains. At least one successful prototype, CVS, failed deployment because it could not obtain permits from regulators.

Several PRT systems have been proposed for California, but the California Public Utilities Commission (CPUC) states that its rail regulations apply to PRT, and these require railway-sized headways. The degree to which CPUC would hold PRT to "light rail" and "rail fixed guideway" safety standards is not clear because it can grant particular exemptions and revise regulations.

Other forms of automated transit have been approved for use in California, notably the Airtrain system at SFO. CPUC decided not to require compliance with General Order 143-B (for light rail) since Airtrain has no on-board operators. They did require compliance with General Order 164-D which mandates a safety and security plan, as well as periodic on-site visits by an oversight committee.

If safety or access considerations require the addition of walkways, ladders, platforms or other emergency/disabled access to or egress from PRT guideways, the size of the guideway may be increased. This may impact the feasibility of a PRT system, though the degree of impact would depend on both the PRT design and the municipality.

Concerns about PRT research
Wayne D. Cottrell of the University of Utah conducted a critical review of PRT academic literature since the 1960s. He concluded that there are several issues that would benefit from more research, including urban integration, risks of PRT investment, bad publicity, technical problems, and competing interests from other transport modes. He suggests that these issues, "while not unsolvable, are formidable," and that the literature might be improved by better introspection and criticism of PRT. He also suggests that more government funding is essential for such research to proceed, especially in the United States.

New urbanist opinion
Several proponents of new urbanism, an urban design movement that advocates for walkable cities, have expressed opinions on PRT.

Peter Calthorpe and Sir Peter Hall have supported the concept, but James Howard Kunstler disagrees.

PRT vs. autonomous vehicles
As the development of self-steering technology for autonomous cars and shuttles advances, the guideway technology of PRT seems obsolete at first glance. Automated operation might become feasible on existing roads too. On the other hand, PRT systems can also make use of self-steering technology and significant benefits remain from operating on a segregated route network.

title: Personal rapid transit