0
$\begingroup$

I want to show that $$n\log(n)$$ is a time constructible function. Can anyone help, how can I prove it?

Thanks in advance.

  • 2
    What is a time constructible function ?2017-02-15
  • 0
    How do you make $n \log(n)$ have integer values? Is it $\lfloor n \log(n) \rfloor, n \lfloor \log(n) \rfloor$, or some other definition.2017-02-15

1 Answers 1

2

A function $f: \mathbb{N} \rightarrow \mathbb{N}$ is time-constructible if there exists a Turing machine that can compute $f(n)$ from $n$ in $O(f(n))$ steps.

One way of computing $n \log n$ is to simulate an algorithm whose worst-case time complexity is $O(n \log n)$ on an appropriately generated input and count the steps during the simulation.

An example of an algorithm with this worst-case time complexity is mergesort; it will use $O(n \log n)$ steps on an input that is "alternately sorted".

To use $O(n \log n)$ steps, run mergesort with the input list $[0,2,1,4,3, \ldots, n]$.

  • 0
    Can you suggest in terms of turing machine simulation?2017-02-16