News for hackers. Stuff that matters.
Re:New Proof Dramatically Compresses Space Needed for Comput... by zerof1l on Monday June 30, 2025 @06:05AM (#44421424)
Here's the gist:

For nearly 50 years theorists believed that if solving a problem takes t steps, it should also need roughly t bits of memory: 100 steps - 100bits. To be exact t/log(t).

Ryan Williams found that any problem solvable in time t needs only about sqrt(t) bits of memory: a 100-step computation could be compressed and solved with something on the order of 10 bits.

Re:New Proof Dramatically Compresses Space Needed for Comput... by zombot on Monday June 30, 2025 @08:19AM (#44422352)
> log(t)

log to what basis? 2 or e or 10 or...

Why do programmers have to be so sloppy?

Re:New Proof Dramatically Compresses Space Needed for Comput... by anonymous_sorry on Monday June 30, 2025 @09:15AM (#44422905)
It's not sloppiness, it's economy.

You can convert between log bases by multiplying by a constant factor. But any real-world program will also have a constant factor associated with it, depending on the specific work it is doing and the hardware it is running on. So it is usually pointless to consider constant factors when theorising about computer programs in general.

Re:New Proof Dramatically Compresses Space Needed for Comput... by 12345ieee on Monday June 30, 2025 @08:20AM (#44422370)
It doesn't matter in O() notation.
Re:New Proof Dramatically Compresses Space Needed for Comput... by derbOac on Monday June 30, 2025 @09:17AM (#44422929)
One answer, from a certain perspective, is that it's relative to your encoding base. It's logarithmic in operations, with the base depending on the encoding.
Re:New Proof Dramatically Compresses Space Needed for Comput... by eviks on Monday June 30, 2025 @08:58AM (#44422742)
Another reason is because base e notation is ln, not log
Re:New Proof Dramatically Compresses Space Needed for Comput... by tzs on Monday June 30, 2025 @11:13AM (#44424343)
It depends on the field.

For example in programming base e is more common. For example log is base e in C/C++, JavaScript, Java, Python, Perl, Mathematica, Fortran, and Rust.

Another example is number theory. I just checked a few number theory books from my library and most used base e: Hardy & Wright's "An Introduction to the Theory of Numbers", Apostol's "Introduction to Analytic Number Theory", Baker's "A Comprehensive Course in Number Theory", Ingham's "The Distribution of Prime Numbers", Baker's "Transcendental Number Theory", Ribenboim's "The Book of Prime Number Records", Kumanduri & Romero's "Number Theory with Computer Applications", and Niven's "Irrational Numbers".

The only number theory book I found using ln rather than log was Gelfond's "Transcendental & Algebraic Numbers".

Re:New Proof Dramatically Compresses Space Needed for Comput... by eviks on Monday June 30, 2025 @11:28AM (#44424501)
That confusion is unfortunate, thanks for checking the books!

Am now a bit curious as to what the country/scientific field table with most common log notation would look like as it seems there is indeed a lot of variance...

https://mathworld.wolfram.com/Ln.html

> The United States Department of Commerce recommends that the notation lnx be used in this way to refer to the natural logarithm (Taylor 1995, p. 33).

> Unfortunately, mathematicians in the United States commonly use the symbol logx to refer to the natural logarithm, as does TraditionalForm typesetting in the Wolfram Language

Re:New Proof Dramatically Compresses Space Needed for Comput... by tempodox on Monday June 30, 2025 @11:03AM (#44424223)
If only! The math libs I know use the name `log` for base e logarithm, not `ln`.
Re:New Proof Dramatically Compresses Space Needed for Comput... by eviks on Monday June 30, 2025 @11:07AM (#44424277)
hm, you're right, this unfortunatley proves the original point...
Re:New Proof Dramatically Compresses Space Needed for Comput... by Tarq0n on Monday June 30, 2025 @08:34AM (#44422485)
This is very common. Log without further specification can be assumed to be the natural log (log e).
Re:New Proof Dramatically Compresses Space Needed for Comput... by holowoodman on Monday June 30, 2025 @09:11AM (#44422859)
No. Usually log without further specification is base10.

Except in mathematics and physics, where it usually is base e.

Except sometimes in computer science, where it can be base 2.

But there are more of those weirdnesses: "ld" can be "log decimal", so base 10; or "logarithmus dualis", so base 2. Base 2 is also sometimes written as "lb" (log binary). You really need to know the conventions of the field/subfield to know which is which.

Re:New Proof Dramatically Compresses Space Needed for Comput... by eru on Monday June 30, 2025 @11:46AM (#44424688)
Log without a basis (at least to me) usually indicates that the basis doesn't matter in this context (or is obvious).

I usually see either base e or base 2 as the default. In which applications do people use both logarithms and base 10 as the default? I mean, especially these day. In the olden days of the slide ruler base 10 was probably more common.

Re:New Proof Dramatically Compresses Space Needed for Comput... by holowoodman on Monday June 30, 2025 @02:47PM (#44426557)
> In which applications do people use both logarithms and base 10 as the default?

Engineering. For example dB is defined in base 10.

Re:New Proof Dramatically Compresses Space Needed for Comput... by gbacon on Monday June 30, 2025 @03:28PM (#44426960)
Base 2 is also sometimes abbreviated lg.
Re:New Proof Dramatically Compresses Space Needed for Comput... by mort96 on Monday June 30, 2025 @09:53AM (#44423290)
In this case, and in many other cases, log without further specification is meant to be understood as just "it is logarithmic" without further specification. With big O, we don't differentiate between log bases, just as we don't differentiate between scale factors. In fact, converting from one log base to another is just multiplying by a constant.
Re:New Proof Dramatically Compresses Space Needed for Comput... by griffzhowl on Monday June 30, 2025 @08:36AM (#44422511)
In information theory it usually means log base 2
Re:New Proof Dramatically Compresses Space Needed for Comput... by eviks on Monday June 30, 2025 @08:59AM (#44422753)
no, that's what ln is for
Re:New Proof Dramatically Compresses Space Needed for Comput... by thaumasiotes on Monday June 30, 2025 @04:30PM (#44427512)
Well, you're right that that's what "ln" is for. But more specifically "ln" is for indicating the natural log on calculators that already have another button labeled "log". Tarq0n is correct that "log" without further specification can be assumed to be the natural log.
Re:New Proof Dramatically Compresses Space Needed for Comput... by heavenlyblue on Monday June 30, 2025 @08:25AM (#44422406)
Why does it need the same bits of memory as steps?
Re:New Proof Dramatically Compresses Space Needed for Comput... by mjburgess on Monday June 30, 2025 @08:44AM (#44422581)
The basic intuition of the two extremes are:

* High space requirement: we need a bucket per step to track the state

* Low space requirement: we only need a single bucket, if we can mix/unmix the various components of the state

High-space requirement algorithms will be those with a large amount of "unmixable" complex state. Low-space reqs will be those with either a small state, or an easily mixed/unmixed state.

Example of mixing: suppose we need an odd number and a parity (+,-) -- then we can store odd/even numbers: taking even to means (-1 * (number-1)) and odd means odd.

So 7 = +7, 8 = -7

I don't know if this example is really that good, but I believe the very basics of the intution is correct -- its to do with how we can trade "interpretation" of data (computation) for the amount of data in such a way that data can kinda be mixed/unmixed in the interpretation

Re:New Proof Dramatically Compresses Space Needed for Comput... by TrueDuality on Monday June 30, 2025 @09:33AM (#44423096)
Bits are a bit misleading here, it would be more accurate to say "units of computation". If you're problem space operates on 32-bit integers this would be 32bits * number of steps, these papers solve for individual bits as the smallest individual unit of computation we can commonly reason about.
Re:New Proof Dramatically Compresses Space Needed for Comput... by mort96 on Monday June 30, 2025 @09:47AM (#44423222)
Wait but if "bits of memory" here was supposed to be "units of computation", that means that:

* The old assumption was that if you require t steps to complete, you need t/log(t) units of computation

* This new proof shows that if you require t steps to complete, you need sqrt(t) units of computation

Surely this doesn't make sense? Using any definition of "unit of computation" I would intuitively assume, computing t steps requires something proportionalt to t units of computation...

Re:New Proof Dramatically Compresses Space Needed for Comput... by nyrikki on Monday June 30, 2025 @10:19AM (#44423637)
There is a bit of nuances here that is difficult to explain fully but note from the paper.

> Our simulation reduces the problem of simulating time-bounded multitape Turing machines to a series of implicitly-defined Tree Evaluation instances with nice parameters, leveraging the remarkable space-efficient algorithm for Tree Evaluation recently found by Cook and Mertz [STOC 2024].

The "time-bounded multitape Turing machines" with bounded fan-in means that that particular abstract model has access to the bits of those tapes current head position.

Mapping the quirks of the various abstract models can be tricky, but remember having access to the symbol currently under the tape head is 'free' in TMs.

It is a useful abstraction but doesn't directly map to physically realizable machine.

It is still an interesting result for trees in physically realizable machines.

Re:New Proof Dramatically Compresses Space Needed for Comput... by conradev on Monday June 30, 2025 @10:49AM (#44424050)
Cook and Mertz call the wider area they work on “catalytic computing”: https://www.quantamagazine.org/catalytic-computing-taps-the-...
Re:New Proof Dramatically Compresses Space Needed for Comput... by taneq on Monday June 30, 2025 @08:30AM (#44422458)
Huh? What did any of those theorists think about the phrase "time/space tradeoff"?
Re:New Proof Dramatically Compresses Space Needed for Comput... by mhuffman on Monday June 30, 2025 @08:51AM (#44422643)
They were likely the ones that invented the phrase.
Re:New Proof Dramatically Compresses Space Needed for Comput... by mort96 on Monday June 30, 2025 @09:51AM (#44423268)
Really? But the whole idea behind the space/time trade-off is that in a bunch of cases, if you want to compute something in less memory, you need to solve it in more steps; or if you want to solve something in fewer steps, you need to use more memory.

This seems to wildly contradict the idea that the amount of memory needed is roughly proportional to the number of steps.

Re:New Proof Dramatically Compresses Space Needed for Comput... by eru on Monday June 30, 2025 @11:43AM (#44424665)
The amount of steps is an (over)estimate on the amount of memory needed.

You can write some trivial programs that need this much memory. But most of them can be optimised to use less space (and still compute the same answer).

The big question was: can you always optimise the space usage down from the ridiculous maximum and to what extent?

Re:New Proof Dramatically Compresses Space Needed for Comput... by mort96 on Monday June 30, 2025 @11:47AM (#44424702)
But plenty of programs can only be optimized to take less space by making them run slower (i.e take more steps)...
Re:New Proof Dramatically Compresses Space Needed for Comput... by eru on Monday June 30, 2025 @11:50AM (#44424731)
Yes. But even with infinite time there's a limit to how much you can compress the space usage. And that's an interesting property to study.

In addition you can look at how much extra time you actually need: infinite time is a vast overestimate. The new proof gives much more reasonable time bounds.

Re:New Proof Dramatically Compresses Space Needed for Comput... by Ar-Curunir on Monday June 30, 2025 @12:18PM (#44425039)
That is also what is happening here. When you reduce space to sqrt you are increasing time complexity. The interesting part of the result is that you can make this tradeoff for _any_ problem.
Re:New Proof Dramatically Compresses Space Needed for Comput... by svat on Monday June 30, 2025 @01:18PM (#44425736)
> in a bunch of cases

That's precisely the issue: of course for many problems there are obvious ways to trade off space and time. Smart people who have spent their lives thinking about this are aware of this. :-) The issue here is: can this always be done? For an arbitrary computation that takes t time, can it always be simulated in much less space (using more time of course), no matter what the computation is? Lots of people have tried, and the best result until now was t/log t in the 1970s.

Edit: A comment on a previous discussion of this result by the author of the Quanta article, which substantiates and links to researchers' opinion that it's the universality (works for every problem) that's the surprising part: https://news.ycombinator.com/item?id=44075191

Re:New Proof Dramatically Compresses Space Needed for Comput... by taneq on Monday June 30, 2025 @09:43AM (#44423188)
I'm not convinced of that if they thought that s=O(t/log(t)) where s=space (bytes or similar) and t=time (clocks, steps, etc.) I dunno about theoretical limits but in practice, there's at least 1-2 orders of magnitude to be exchanged between space and processing time.
Re:New Proof Dramatically Compresses Space Needed for Comput... by eru on Monday June 30, 2025 @11:44AM (#44424669)
That's in practice for practical problems. But they were interested in the worst cases.
Re:New Proof Dramatically Compresses Space Needed for Comput... by bubblyworld on Monday June 30, 2025 @09:18AM (#44422948)
That phrase is usually about a specific problem, right? This is more like given an arbitrary algorithm (you don't know which up front), can you optimise it's memory usage? Seems kinda surprising to me that you can.
Re:New Proof Dramatically Compresses Space Needed for Comput... by cubefox on Monday June 30, 2025 @09:10AM (#44422855)
> Ryan Williams found that any problem solvable in time t needs only about sqrt(t) bits of memory

At least or at most or on average?

Re:New Proof Dramatically Compresses Space Needed for Comput... by user070223 on Monday June 30, 2025 @09:55AM (#44423326)
I've skimmed the result couple of weeks ago, and if I remember it states that there from all machines which takes t time to accomplish something there is one such that sqrt(t) memory is used. so it's at most but not on avg nor amorotized[not sure if et even make sense it the space where the problem lies] (you take the least memory hungry machine)
Re:New Proof Dramatically Compresses Space Needed for Comput... by cma on Monday June 30, 2025 @02:18PM (#44426291)
There must be more constraints, what if the problem is copying a string? Or is it only for turing tape machines where it has to backtrack during the copy, increasing number of steps?
Re:New Proof Dramatically Compresses Space Needed for Comput... by jasperry on Monday June 30, 2025 @03:47PM (#44427098)
That's a good example! So the sqrt(n) space in the result must refer to space beyond that needed to write down the output--basically a working memory scratchpad. In which case, a string-copying function could use just a constant amount of scratch space.

I mean, for all I know, the result may have been proved in the model of decision problems where the output is always one bit. But I'd guess that it generalizes just fine to the case where you have to write longer outputs.

However, your question does make me wonder if the result still applies in the RAM model, where you can move to any spot on the tape in constant time. My theory knowledge is getting rusty...

Re:New Proof Dramatically Compresses Space Needed for Comput... by jasperry on Monday June 30, 2025 @04:20PM (#44427404)
Update after youtube: It was already known that a time-t function can be computed in sqrt(t) space on a single-tape Turing machine. It's exactly like @cma said: a Turing machine wastes a lot of time moving the head back and forth. Williams' result shows sqrt(t) space for multi-tape Turing machines. Those are much more time-efficient in regard to head movement, so until Williams' proof it was not believed to be possible to to make any algorithm use only sqrt(t) space.
Re:New Proof Dramatically Compresses Space Needed for Comput... by jeanlucas on Monday June 30, 2025 @10:21AM (#44423662)
In the best case
Re:New Proof Dramatically Compresses Space Needed for Comput... by utopcell on Monday June 30, 2025 @05:57PM (#44428343)
This is a worst-case result. In the best case, it is easy to see that the gap can be exponential. Imagine a program that increments a counter until it reaches value n. This "program" would only need O(logn) memory: mainly the counter itself.
Re:New Proof Dramatically Compresses Space Needed for Comput... by m3kw9 on Monday June 30, 2025 @10:27AM (#44423750)
Doesn’t make practical sense why they would even assign a number to problems which could have unknown dependencies. Unless you are talking about bounded math issues
Re:New Proof Dramatically Compresses Space Needed for Comput... by andsoitis on Monday June 30, 2025 @11:13AM (#44424342)
> Ryan Williams found that any problem solvable in time t needs only about sqrt(t) bits of memory: a 100-step computation could be compressed and solved with something on the order of 10 bits.

Does it require one to first have solved the problem in uncompressed space?

Re:New Proof Dramatically Compresses Space Needed for Comput... by jasperry on Monday June 30, 2025 @04:32PM (#44427541)
As I understand it, this result is about algorithms that solve any instance of a given computational problem (like finding the shortest paths through a graph.) The specific problem instance (the graph) is the input to the algorithm. The result shows how to take an algorithm and construct another algorithm that solves the same class of problems in less space, by transforming how the algorithm reads and writes memory. Now you have an algorithm that still solves any instance of that problem but uses only sqrt(t) space.

So, to answer your question more directly: no, you don't have to have solved a specific instance of the problem, but you have to already have an algorithm that solves it in general.

Re:New Proof Dramatically Compresses Space Needed for Comput... by svat on Monday June 30, 2025 @12:35PM (#44425220)
To be clear, this was/is a statement about the worst case, not every problem. So it may be clearer to rephrase your sentence as:

For nearly 50 years theorists believed that there exist problems taking t steps that also need roughly t/log(t) bits of memory.

(The Quanta magazine article https://www.quantamagazine.org/for-algorithms-a-little-memor... gives some context: for a long time, the best result was t/log(t) as proved in "On Time Versus Space" https://dl.acm.org/doi/10.1145/322003.322015 by Hopcroft, Paul and Valiant in 1975.)

Re:New Proof Dramatically Compresses Space Needed for Comput... by makira on Monday June 30, 2025 @02:07PM (#44426202)