Getting n alone in n=x and nlgn=x

  • Thread starter Dafydd
  • Start date
In summary, to find the greatest n for which n! is greater or equal to x, we can use the Stirling's approximation. And for the greatest n for which nlgn is greater or equal to x, we can use the inverse of the logarithm function. Remember to always think critically and use the appropriate tools to solve a problem.
  • #1
Dafydd
12
0

Homework Statement



I need to know the greatest n for which n! is greater or equal to x, and the greatest n for which nlgn is greater or equal to x.

Homework Equations



Can't think of any. Sorry!

The Attempt at a Solution



For a "normal" function, like, say, lgn or n^2, it would be as easy as inverting the function and getting n on its own, like this:

lgn = x
n = 2^x (where lg is of base 2)

or

n^2 = x
n = sqrt(x).

However, for n!=x and nlgn=x I can't come up with a way to do this. Help!
 
Physics news on Phys.org
  • #2



I would like to provide some guidance on how to approach this problem. First, let's define n! and nlgn to make sure we are on the same page. n! (n factorial) is the product of all positive integers from 1 to n. For example, 5! = 1x2x3x4x5 = 120. On the other hand, nlgn is a logarithmic function where the base of the logarithm is n. So, if we write it as nlgn = x, it means nlogn = x.

Now, let's look at the problem at hand. We need to find the greatest n for which n! is greater or equal to x, and the greatest n for which nlgn is greater or equal to x. In other words, we need to find the value of n when the value of n! or nlgn reaches or exceeds x.

For n!, we can use the Stirling's approximation, which states that for large values of n, n! is approximately equal to √(2πn)(n/e)^n. This approximation can give us a good estimate for the value of n when n! equals x.

For nlgn, we can use the inverse of the logarithm function to find n. The inverse of logarithm is the exponential function, so we can write it as n = e^x. This means that when nlgn equals x, n is equal to e^x.

I hope this helps you in finding the solutions to your problem. Remember, as a scientist, it is important to understand the underlying concepts and use appropriate approximations or equations to solve a problem.
 

1. What does "n" represent in the equations n=x and nlgn=x?

In these equations, "n" represents the input size of a problem, while "x" represents the output or solution of the problem. For example, in a sorting algorithm, "n" would represent the number of elements to be sorted, while "x" would represent the sorted list.

2. How do you solve for "n" when given n=x and nlgn=x?

To solve for "n" in these equations, you can use algebraic manipulation or trial and error. For n=x, simply set "n" equal to "x" to find the value of "n". For nlgn=x, you can use the inverse of the logarithm function (exponentiation) to solve for "n". For example, if the equation is nlgn=8, you can raise both sides to the power of 2 to get n=4.

3. What is the significance of "n" and "x" being equal in these equations?

The equality of "n" and "x" in these equations represents a balanced relationship between the input size and output of a problem. It means that the time or space complexity of a problem is directly proportional to the input size, and there is no additional overhead or inefficiency in the algorithm.

4. Can "n" and "x" have different units or dimensions in these equations?

No, "n" and "x" should have the same units or dimensions in these equations. Since "n" represents the input size and "x" represents the output, they should have the same units to be comparable. For example, if "n" is measured in seconds, "x" should also be measured in seconds.

5. How are these equations used in algorithm analysis?

The equations n=x and nlgn=x are used to determine the time or space complexity of an algorithm. By analyzing these equations, we can determine the relationship between the input size and the performance of an algorithm. This helps in comparing different algorithms and choosing the most efficient one for a given problem.

Similar threads

  • Calculus and Beyond Homework Help
Replies
4
Views
652
  • Calculus and Beyond Homework Help
Replies
1
Views
504
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
549
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
868
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
16
Views
3K
  • Calculus and Beyond Homework Help
Replies
3
Views
980
Back
Top