ArticleslgStudy

science

L (complexity)

L (complexity) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand L (complexity) rather than just read about it. In short: In computational complexity theory, L (also known as LSPACE, LOGSPACE or DLOGSPACE) is the complexity class containing decision problems that can be solved by a deterministic Turing machine using a logarithmic amount of writable memory space. Formally, the Turing machine has two tapes, one of which encodes the input and can only be read, whereas the other tape has logarithmic size but can be written as well as read.

L (complexity) — main illustration
L (complexity) — illustration

Key takeaways

  • L (complexity) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect L (complexity) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of L (complexity) from memory before moving on to harder problems.

Reference excerpt

In computational complexity theory, L (also known as LSPACE, LOGSPACE or DLOGSPACE) is the complexity class containing decision problems that can be solved by a deterministic Turing machine using a logarithmic amount of writable memory space. Formally, the Turing machine has two tapes, one of which encodes the input and can only be read, whereas the other tape has logarithmic size but can be written as well as read. Logarithmic space is sufficient to hold a constant number of pointers into the input and a logarithmic number of Boolean flags, and many basic logspace algorithms use the memory in this way.

Complete problems and logical characterization Every non-trivial problem in L is complete under log-space reductions, so weaker reductions are required to identify meaningful notions of L-completeness, the most common being first-order reductions. A 2004 result by Omer Reingold shows that USTCON, the problem of whether there exists a path between two vertices in a given undirected graph, is in L, showing that L = SL, since USTCON is SL-complete. One consequence of this is a simple logical characterization of L: it contains precisely those languages expressible in first-order logic with an added commutative transitive closure operator (in graph theoretical terms, this turns every connected component into a clique). This result has application to database query languages: data complexity of a query is defined as the complexity of answering a fixed query considering the data size as the variable input. For this measure, queries against relational databases with complete information (having no notion of nulls) as expressed for instance in relational algebra are in L.

Related complexity classes L is a subclass of NL, which is the class of languages decidable in logarithmic space on a nondeterministic Turing machine. A problem in NL may be transformed into a problem of reachability in a directed graph representing states and state transitions of the nondeterministic machine, and the logarithmic space bound implies that this graph has a polynomial number of vertices and edges, from which it follows that NL is contained in the complexity class P of problems solvable in deterministic polynomial time. Thus L ⊆ NL ⊆ P. The inclusion of L into P can also be proved more directly: a decider using O(log n) space cannot use more than 2O(log n) = nO(1) time, because this is the total number of possible configurations. L further relates to the class NC in the following way: NC1 ⊆ L ⊆ NL ⊆ NC2. In words, given a parallel computer C with a polynomial number O(nk) of processors for some constant k, any problem that can be solved on C in O(log n) time is in L, and any problem in L can be solved in O(log2 n) time on C.

It is an open problem whether L = P, and, at least as of 1997, whether L = NL. It is not even known whether L = NP. The related class of function problems is FL. FL is often used to define logspace reductions.

Random versions Just as how P has several random versions: BPP, ZPP, PP, and RP, there are several random versions of L. Bounded-error Probability L (BPL) is defined like BPP, as the complexity class of problems solvable with a logspace Turing machine such that:

Other than the usual tapes of a logspace Turing machine, the machine also takes a tape filled with random bits. The randomness is read-only and one-way. That is, the read-head on the random tape can only move in one direction. To reference a previous random bit, the machine must store it in the work tape. The Turing machine has to halt for every input and every random tape. If the answer is 'yes' then the machine accepts with probability at least 2/3. If the answer is 'no' then the machine rejects with probability at least 2/3. It is contained in NC2, which is contained in P. BP•L is defined the same as BPL, except that the machine is allowed to read the random tape both forwards and backwards. It contains BPL. It is also exactly equal to the class of languages that are nearly logspace: a language is nearly logspace if, relative to almost every oracle, the language is in L. ZP•L is defined like BP•L, except that the machine may output "unknown", and must never make an error (i.e. accept when the answer is 'no', and vice versa). The relation of ZP•L to BP•L, is the same as the relation of ZPP to BPP. It contains BPL and is contained by BP•L. Randomized L (RL) is defined like BPL:

Other than the usual tapes of a logspace Turing machine, the machine also takes a read-only one-way tape filled with random bits. The Turing machine has to halt for every input and every random tape. If the answer is 'yes,' accept with probability at least 1/2. If the answer is 'no,' always reject. Also, it must always run in polynomial time (since otherwise we would just get NL). It is strongly suspected that RL = L. Both BPL and RL are contained in Steve's Class. Probabilistic L (PL) has the same relation to L that PP has to P:

If the answer is 'yes,' accept with probability at least 1/2. If the answer is 'no,' reject with probability at least 1/2. It contains BPL, and is contained by NC2.

Additional properties L is low for itself, because it can simulate log-space oracle queries (roughly speaking, "function calls which use log space") in log space, reusing the same space for each query.

Other uses The main idea of logspace is that one can store a polynomial-magnitude number in logspace and use it to remember pointers to a position of the input. The logspace class is therefore useful to model computation where the input is too big to fit in the RAM of a computer. Long DNA sequences and databases are good examples of problems where only a constant part of the input will be in RAM at a given time and where we have pointers to compute the next part of the input to inspect, thus using only logarithmic memory.

See also L/poly, a nonuniform variant of L that captures the complexity of polynomial-size branching programs

Notes

… excerpt ends here. Continue reading the full article.

Illustrations

L (complexity): The relations between various L-related complexity classes. Produced by tracing out the various class containment statements from Complexity Zoo.
The relations between various L-related complexity classes. Produced by tracing out the various class containment statements from Complexity Zoo.

Worked examples

Example 1 — a first encounter with L (complexity)

Start with the simplest possible case. Write down what L (complexity) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to L (complexity) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about L (complexity) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of L (complexity)

In research
L (complexity) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses L (complexity) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
L (complexity) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Complexity classes, so understanding it makes those chapters shorter.
In everyday life
Look for L (complexity) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “L (complexity)” →

How to study L (complexity) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what L (complexity) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain L (complexity) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is L (complexity) in simple terms?

In computational complexity theory, L (also known as LSPACE, LOGSPACE or DLOGSPACE) is the complexity class containing decision problems that can be solved by a deterministic Turing machine using a logarithmic amount of writable memory space. Formally, the Turing machine has two tapes, one of which…

Why does L (complexity) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study L (complexity)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on L (complexity).

Tags

  • Complexity classes

Keep exploring