Growth of Functions - What is "Log Star" (O(log*n))?

In summary: The log-star of a number is the minimum number of times you would have to apply the base-2 log to a number to get a results that is less than 2.
  • #1
gnome
1,041
1
I'm not sure this belongs here, but I don't know where else to post it:

On a handout from my Analysis of Algorithms class there's a "Hierarchy of Functions" chart which includes familiar orders such as
log n, linear, n log n, quadratic, cubic, exponential, etc.

There is one that I've never seen before, I don't know what it means & I can't find anything written about it.

He calls it "log star", also written as log*n.
It's the second-lowest listed in the hierarchy, between "constant" and "log log"; that is, an algorithm that is O(log*n) is a very good one, better than O(log-log n).

Any ideas what it means?
 
Physics news on Phys.org
  • #2
As far as I know:

[tex]\log^*n=\min\lbrace x\in\mathbb{N}\vert \log_2^xn<2\rbrace[/tex]

In other words, the log-star of a number is the minimum number of times you would have to apply the base-2 log to a number to get a results that is less than 2. An algorithm which is [itex]O(\log^*n)[/itex] is considered to have an almost-constant running time. While the algorithm is not strictly speaking constant-time, you could increase the amount of input by a factor of [itex]10^{15}[/itex] and only increase the running time by a factor of 5.
 
Last edited:
  • #3
Who thinks of these things?

Sorry, I still don't get it. What's inf{...

Can you give me an example of what would be log*n if n is say, 10000?
 
  • #4
Originally posted by gnome
Who thinks of these things?

Sorry, I still don't get it. What's inf{...

Can you give me an example of what would be log*n if n is say, 10000?

I replaced inf with min when I realized using it here was both unnecessary and confusing. There's a slightly stronger definition where you need to use inf.

log*10000 = 3 because log(log(log 10000)) < 2 and log(log 10000) >= 2. Note that this is using log base 2.

To find the log-star of a number, just count the number of times you have to apply log (base 2) to it to get a result less than 2.
 
Last edited:
  • #5
Thank you.

Now, is there an easier way to get that on a calculator than doing this:

ln (ln (ln 10000/ln2) /ln2) /ln2 = 1.899...

?
 
  • #6
Originally posted by gnome
Thank you.

Now, is there an easier way to get that on a calculator than doing this:

ln (ln (ln 10000/ln2) /ln2) /ln2 = 1.899...

?

I can't think of one. But:

log*2 = 1
log*4 = 2
log*16 = 3
log*65536 = 4

Unless you're working with numbers >= 2^65536 then you should be able to use those values to figure out the values in your head (they'll always be between 0 and 5).

But someone else here may be more clever than me. And there is also another version of this function that gives real numbers instead of integers (for example, log*15 would not be 2 but rather a number between 2 and 3). However I definitely don't know how to calculate that version.

If you can wait 3 months, I can find out in my Algorithms class next term.
 

1. What does "Log Star" (O(log*n)) mean?

"Log Star" (O(log*n)) is a special notation used to represent functions that grow extremely slowly. It is also known as "Iterated logarithm" and is a more precise measure of complexity than the traditional "Big O" notation. It is commonly used in theoretical computer science to analyze algorithms with very fast growth rates.

2. How is "Log Star" (O(log*n)) different from "Big O" (O(n))?

The main difference between "Log Star" (O(log*n)) and "Big O" (O(n)) is that the latter represents a linear growth rate, while the former represents a growth rate that is even slower than logarithmic. In other words, "Log Star" (O(log*n)) functions grow so slowly that they can be considered constant for all practical purposes.

3. What is the significance of "Log Star" (O(log*n)) in computer science?

"Log Star" (O(log*n)) is significant in computer science because it represents functions that grow so slowly that they are practically constant. This means that algorithms with "Log Star" (O(log*n)) time complexity have extremely fast running times and are considered very efficient. It is commonly used to analyze the complexity of algorithms in fields such as data structures, graph theory, and cryptography.

4. How is "Log Star" (O(log*n)) calculated?

To calculate "Log Star" (O(log*n)), you first need to understand the concept of "iterated logarithm." The iterated logarithm of a number is the number of times you can take the logarithm of that number before the result becomes less than or equal to 1. For example, the iterated logarithm of 1000 is 3, because log(log(log(1000))) = log(log(3)) = log(1) = 0. In "Log Star" (O(log*n)), the * symbol represents the iterated logarithm. So, for a function with a "Log Star" (O(log*n)) growth rate, the number of times you can take the logarithm of the input before the result becomes less than or equal to 1 will increase very slowly as the input size increases.

5. Can "Log Star" (O(log*n)) be replaced by a more precise notation?

Yes, "Log Star" (O(log*n)) can be replaced by a more precise notation called "Small O" (o(n)). "Small O" represents functions that grow even slower than "Log Star" and are considered to have a negligible impact on the overall complexity of an algorithm. However, "Log Star" is a more convenient notation for practical purposes and is commonly used in theoretical computer science.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
828
  • Topology and Analysis
Replies
2
Views
1K
  • General Math
Replies
15
Views
2K
  • Precalculus Mathematics Homework Help
Replies
7
Views
2K
Replies
9
Views
1K
Replies
15
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
911
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
957
  • Linear and Abstract Algebra
Replies
1
Views
2K
Back
Top