Use the continuous convention . Let . Applying the allowed logarithm inequality to for gives
Hence . Equality forces . Since every is strictly positive, this makes the entire alphabet. Equality in every weighted logarithm inequality then forces for every . Conversely makes every summand zero. Thus
This is Gibbs inequality for relative entropy, with zero probabilities in the first argument handled explicitly.
First consider any instantaneous code. Put and . Part 1(a) gives
so .
For the construction, take the Shannon lengths . Then , so Kraft's condition holds. Also for every . Averaging gives
For a nontrivial alphabet all , so these lengths are positive and the ordinary code convention applies. For a deterministic one-symbol source, the usual zero-bit convention uses when the number of source symbols is externally known. If strictly nonempty codewords and arbitrary unframed message lengths are required instead, that degenerate case has and cannot satisfy the printed strict upper bound. This convention issue does not affect sources with at least two symbols.
A discrete memoryless channel has finite input and output alphabets and fixed conditional probabilities , whose rows sum to one. Memorylessness means that for successive uses, conditional on the input sequence, the output probabilities factor as the product of these one-use conditional probabilities.
Its information capacity in bits per use is
The maximization varies the input distribution while keeping the channel matrix fixed. The output distribution is in the row-vector convention.
Let be the selected block, and write . Because both the input and output alphabets are disjoint across blocks, is determined by either the input or the output. The mutual-information chain rule therefore gives
For any fixed , equality is achievable by using a capacity-achieving distribution inside each block. It remains to maximize this binary expression.
Put and . A direct expansion of binary relative entropy yields
Part 1(a) makes the maximum , uniquely at . Hence
The block choice itself communicates information, in addition to any information sent within the selected block.
Exactly the regular languages. A read-only-from-left Turing acceptor has only its current control state as usable memory: it never changes a tape symbol, and its head never returns to an earlier cell. This is the behaviour of a deterministic finite automaton while it reads the input.
To make the correspondence precise, retain the control states and the transitions on the input alphabet. Replace accepting and rejecting halts by absorbing states, so that halting before the end of a word over an alphabet has the same effect on every continuation. For each remaining state , follow the transitions on blank symbols and mark accepting in the deterministic finite automaton exactly when this blank-only continuation eventually accepts. This marking is a finite calculation: either a halting state is reached or a state repeats, after which the blank-only run loops. The resulting deterministic finite automaton accepts exactly the same formal language as the read-only-from-left Turing acceptor. If the latter is a decider, the blank-only run from every reachable end-of-input state halts.
Conversely, simulate any deterministic finite automaton by a read-only-from-left Turing acceptor, using its state transitions while reading the input. At the first blank symbol, halt and accept or reject according to the current deterministic finite automaton state. This machine halts on every input and decides the required regular language.
is undecidable. The condition depends only on the accepted formal language. It holds for a Turing machine accepting the empty language, and fails for a Turing machine accepting the singleton , where is an alphabet symbol. It is therefore a nontrivial extensional property of programs, and Rice's theorem applies. In particular, the condition does not assert that the machine halts on every input; nonacceptance of long words over an alphabet may result from rejection or from an infinite computation.
is a decidable language: it consists of every valid Turing machine encoding. Every multitape Turing machine has an equivalent single-tape Turing machine. To see this, represent the finitely used portions of its tapes on one tape, separated by delimiters, and mark each simulated head position. To simulate one step, scan these portions to read the marked symbols, retain this fixed number of symbols and the control state in finite control, and scan again to update the symbols and head marks. Extend a represented portion with a blank cell when necessary. Each simulated step takes finitely many real steps.
The single-tape Turing machine accepts exactly when the simulated multitape Turing machine accepts; infinite computations remain infinite. The simulation may increase time complexity, but the question only asks about accepted formal languages. Hence a decider simply checks the syntax of the Turing machine encoding and accepts every valid description. Rice's theorem does not make this property undecidable, because the property is true of every computably enumerable language and is therefore trivial in the theorem's sense.
The linear speedup theorem concerns multitape Turing machines whose finite control and tape alphabet may change. Formally, for , if a deterministic -tape Turing machine decides within steps on every input of length , then for every constant there is a deterministic -tape Turing machine deciding the same formal language with
The additive constant is independent of ; in the usual normalized formulation the bound is , with the integer-rounding convention absorbed in the constant.[ref]
The construction packs a fixed number of old tape symbols into each new symbol and uses a larger finite control to simulate blocks of old steps. Initial input packing explains the additive linear term. If , choosing a larger constant makes the total asymptotic time complexity an arbitrarily small constant multiple of .
It does not promise arbitrary speed increases on fixed hardware. Larger packed symbols and transition tables cease to be single constant-cost hardware operations without limit. The theorem also retains the input-reading overhead. It is a statement about changing the abstract machine description and primitive operations, rather than an unlimited implementation optimization on one processor.
Let , accepted by a fixed Nondeterministic Turing machine in at most steps on every computation branch, for a polynomial . Since the transition relation is finite, there is a fixed constant bounding the number of choices at any step. Every branch can be specified by a word over an alphabet of length over a -symbol choice alphabet, padding unused choices after halting.
A deterministic Turing machine enumerates all such choice sequences and simulates the corresponding branches for at most steps each. It accepts if some simulation accepts, and rejects after all have failed. Every possible accepting branch is included, and the time cutoff guarantees termination even on invalid choice sequences. A standard direct simulation has only polynomial overhead per branch, giving
for a suitable polynomial . This is a deterministic exponential time bound. Therefore
Here EXPTIME means the union of deterministic time bounds over fixed positive integers , allowing the usual constant factors and finitely many small inputs.
Use Turing machines with a two-way read-only input tape, bounded by endmarkers, and a fixed finite number of read-write work tapes over a fixed finite alphabet. Work-tape cells count towards space complexity; the read-only input does not. For input length , use to include the small-length cases.
, or L, is the class of formal languages decided by a deterministic such machine using at most work-tape cells for some fixed constant . It must halt on every input and accept exactly the members.
, or NL, is the class of formal languages accepted by a Nondeterministic Turing machine with the same work-space bound on every computation branch. An input is accepted if and only if at least one branch accepts. One may require all branches to halt: the configuration graph has only a polynomial number of vertices, so a logarithmic space counter can stop any branch that has taken more steps than that bound. If an accepting computation exists, one exists with no repeated Turing machine configuration, so this convention does not change the complexity class.
In standard space complexity notation,
Let a deterministic Turing machine decide with at most work-tape cells. Fix an input of length . A Turing machine configuration is determined by the control state, the read-only input-head position, the work-tape contents, and the work-head positions. For one work tape with alphabet , their number is bounded, up to harmless fixed factors, by
The factors respectively count the state, input-head position, work-head position and work-tape contents. With a fixed number of work tapes, replace the last two factors by if each tape is allowed cells; this still gives a valid polynomial upper bound. Two-way work tapes only change fixed factors in the head-position bounds.
Since
there are at most Turing machine configurations for some constant depending on . If a deterministic computation repeats one of its Turing machine configurations on the fixed input, all subsequent steps repeat too, so it never halts. But is a decider. It therefore halts before any repetition and takes at most a polynomial number of steps. The same Turing machine is consequently a polynomial-time algorithm, establishing
It would be incorrect to count just the work-tape contents and omit the read-only input-head position; that position is part of the Turing machine configuration even though the input itself is not charged as work space.
A nondeterministic finite automaton, allowing the epsilon transitions used in this paper, is a tuple
Here is a nonempty finite set of automaton states, is a finite alphabet, is the power set of , is the initial automaton state, and is the set of accepting automaton states. The symbol denotes the empty word. Membership permits an automaton transition from to consuming when , or consuming nothing when .
The recognized formal language is
The label of a graph path is the concatenation of its labels with all occurrences of omitted. Thus acceptance requires consuming the entire input word; a single successful choice of automaton transitions suffices. A path of length zero is allowed, so the empty word is accepted whenever , or an accepting automaton state is reachable by epsilon transitions. If epsilon transitions are excluded from the definition of a nondeterministic finite automaton, the displayed version is called an Epsilon-NFA.
A nondeterministic pushdown automaton is a tuple
Here is a nonempty finite set of control states, a finite input alphabet, a finite stack alphabet, the initial control state, the initial stack symbol, and the final control states. The notation requires each transition to have only finitely many choices. Since the domain is finite, the whole transition specification is finite.
A pushdown automaton configuration is , recording the control state, unread input word, and stack contents. Write the top of the stack on the left. For , the one-step relation is
An epsilon transition instead has
Thus a move replaces the top stack symbol by the word , whose leftmost symbol becomes the new top. It consumes one input symbol or no input symbol. Under this convention there is no move from an empty stack.
For acceptance by final state, the recognized formal language is
Here allows any finite number of moves, including zero. The entire input must have been consumed; the final stack need not be empty. Acceptance requires at least one such run of the nondeterministic pushdown automaton.
Use the standard conversion of a context-free grammar to a pushdown automaton, implementing a leftmost derivation on a stack. Take control states , input alphabet , stack alphabet , initial control state , initial stack symbol , and sole final control state . The symbol is a fresh stack bottom marker. As in part (a), the top of the stack is written on the left.
Initialize with
In control state , replace a top nonterminal symbol by one of its production rule right-hand sides:
The replacements are written in the order in which they are to be processed. For example, replacing by leaves on top; an implementation using individual push operations pushes , then , then .
Match and pop top terminal symbols by
Finally include
All unlisted transitions have no choices; has no outgoing transitions. This is acceptance by final state, leaving the bottom marker on the stack. Taking the last transition too early cannot cause false acceptance, because an unread input suffix remains and cannot consume it.
For correctness, after initialization the stack contains the unprocessed part of a sentential form. Expanding a top nonterminal symbol simulates one step of a leftmost derivation, and popping a matching terminal symbol transfers it to the already-read input prefix. Thus if the input prefix consumed so far is and the stack above is , then . Acceptance gives for the entire input .
Conversely, any leftmost derivation of specifies choices of these transitions: expand the next nonterminal symbol, and read each resulting leading terminal symbol when it reaches the top. After all symbols of are consumed, only remains, enabling the move to . The nondeterministic pushdown automaton therefore recognizes exactly . The empty word is accepted by choosing after initialization.
is a co-recursively enumerable language, is not a recursively enumerable language, and is not a decidable language. The stipulated order on halting times includes .
First, failure has a finite witness. For valid machine descriptions,
Indeed, a strict inequality forces the first halting time to be finite. The second can be either a larger finite time or infinity. Whether the displayed condition holds for fixed is decidable by a finite simulation, including the initial configurations when .
Enumerate all pairs and perform these finite tests by dovetailing, accepting the complement of a set of on finding a witness. Equivalently, at stage , inspect all inputs of length at most through transitions. A genuine violation eventually appears; if there is no violation, the procedure never accepts. Malformed descriptions or differing input alphabets can be recognized and accepted as nonmembers immediately. Thus the complement is a recursively enumerable language, proving that is a co-recursively enumerable language.
For non-enumerability, use the standard result that the complement of a set of the halting problem
is not a recursively enumerable language. Given , effectively construct two Turing machines over the same fixed input alphabet. On every input , let ignore and simulate on the fixed word , halting precisely when that simulation halts. Let loop forever on every input.
If does not halt on , both halting times are infinity for every , so the pair belongs to . If halts on , the first halting time is finite while the second is infinity, so the pair does not belong to . Therefore
This is a many-one reduction from non-halting to the pointwise running-time domination problem. Were a recursively enumerable language, constructing the pair and running its recognizer would recognize non-halting, contradicting the stated result. Hence is not a recursively enumerable language. Since every decidable language is a recursively enumerable language, is also undecidable.
Fix a deterministic, single-tape Turing machine with tape cells indexed by the integers. A precise definition is the tuple
Here is a nonempty finite set of control states, a finite tape alphabet with a designated blank symbol , the input alphabet, the initial control state, and distinct halting control states. The transition function is total on the displayed domain. The Turing machine instruction means to write over the scanned , enter control state , and move the head one cell in direction .
A Turing machine configuration is , where , is the head position, and is the tape-content function, equal to outside a finite set. Its next-configuration relation is
if , with for and for , and
There is no successor to either halting Turing machine configuration.
For input , the initial Turing machine configuration is , where for and is blank elsewhere. In particular, the initial tape for the empty word is entirely blank. The recognized formal language is
The relation permits any finite number of transitions. An input outside may reach the rejecting control state or run forever; recognition does not require halting on every input.
Let the input words be , let be their common length, let be the finite alphabet, and let contain the dictionary words of length . Unequal input lengths immediately make the puzzle impossible because a mutation preserves length. A word ladder search problem can use the state space , with initial state ; including handles an input word not itself in the dictionary.
At word , an action is a position–letter pair with , and , permitted precisely when replacing by gives . The search transition model returns that , and the goal test is . If , the empty sequence is accepted; if and , no transition can reach .
Assign each permitted transition cost . A search node at search depth has
Thus minimizing path cost is exactly minimizing the number of mutations. Uniform-cost search, with repeated states handled by graph search and the goal test on selection, finds a shortest word ladder if one exists. Because all costs are equal, breadth-first search gives the same optimal-length guarantee.
For a discrete memoryless channel with transition probabilities , the conditional probability of a length- output given a length- input factors as
The same transition probabilities apply at each use. Its channel capacity is
The unit is bits per channel use. For finite alphabets the maximum exists by continuity on the probability simplex; with more general alphabets one uses a supremum when appropriate.
An channel code consists of an encoder and a decoder . It represents each of messages by input symbols and recovers a message from the observed output symbols. Its code rate is bits per use. For each message , its conditional error probability is ; an average error also specifies the message probability distribution, while the maximum error takes the largest conditional error.
Write . Because is determined by , the chain rule for mutual information gives
This is the data processing inequality. It holds for every input probability distribution. Maximizing each side over that same set of input probability distributions gives ; processing cannot increase channel capacity.
A simple sufficient condition for equality is that be injective on the reachable output alphabet. Then can be recovered from , giving and hence for every input law. The input that achieves the original channel capacity therefore achieves it after processing as well. Values of outside reachable outputs are irrelevant.
Injectivity is sufficient rather than necessary. More precisely, for finite alphabets equality in capacity data processing holds exactly when there is an original capacity-achieving input law for which and have conditional independence given . Sufficiency follows from the displayed gap identity. For necessity, maximize at an input law ; if its maximum equals , then , so both inequalities are equalities. Processing may discard output details unrelated to the input without losing channel capacity.
Each of the three input values has two possible outputs, so their union has at most six elements. The preceding union formula also gives this bound. Choose noise values , whose two translated input alphabets are disjoint. With columns ordered the transition matrix is
Thus . Every output determines its input, explicitly , so . Consequently , with equality for a uniform input. Therefore
The extra uncertainty of which noise value occurred does not reduce information about the input: the two possible outputs for each input remain distinguishable from those of every other input.
Translate the output alphabet by and put . The reachable outputs become
For the two sets overlap in two points; for in one; for they are disjoint. In particular , and choosing noise values attains four.
With rows indexed by inputs and columns by outputs , independence and uniform two-point noise give
Every conditional output distribution has information entropy one bit, so . The input probability mass function makes all four outputs equiprobable, attaining that bound. Thus
Using a zero-probability input in a channel-capacity maximization is legitimate; it is unrelated to the strictly positive source weights needed for the tree-shape claims in Question 2.