State Measuring complexity

Measuring complexity: Many algorithms have an integer n, or two integers m and n, as input - e.g., addition, multiplication, exponentiation, factorisation and primality testing. When we want to describe or analyse the `easiness' or `hardness' of the algorithm, we want to measure its `running time' as a function of the `size' of the input value(s).

If the input value is n, then it is usual to use the number of (decimal) digits, or bits (binary digits), required to store n as a measure of the size of n.

Given input n, the number of decimal digits in n is given by

[log10 n] +1;

where [x], pronounced `floor of x', denotes the greatest integer less than or equal to x. The number of binary digits or bits is similarly given by

[lg n] +1;

where we use the abbreviation lg x for log2 x (this notation is common, but not completely standard).

   Related Questions in Mathematics

  • Q : Abstract Algebra let a, b, c, d be

    let a, b, c, d be integers. Prove the following statements: (a) if a|b and b|c. (b) if a|b and ac|bd. (c) if d|a and d|b then d|(xa+yb) for any x, y EZ

  • Q : What is the probability that the film

    T.C.Fox, marketing director for Metro-Goldmine Motion Pictures, believes that the studio's upcoming release has a 60 percent chance of being a hit, a 25 percent chance of being a moderate success, and a 15 percent chance of being a flop. To test the accuracy of his op

  • Q : Explain Factorisation by trial division

    Factorisation by trial division: The essential idea of factorisation by trial division is straightforward. Let n be a positive integer. We know that n is either prime or has a prime divisor less than or equal to √n. Therefore, if we divide n in

  • Q : Mathematical and Theoretical Biology

    Mathematical and theoretical biology is an interdisciplinary scientific research field with a range of applications in the fields of biology, biotechnology, and medicine. The field may be referred to as mathematical biology or biomathematics to stress the mathematical

  • Q : Mathematical Method for Engineers The

     The function is clearly undefined at , but despite all of this the function does have a limit as approaches 0. a) Use MATLAB and ezplot to sketch for , and use the zoom on facility to guess the . You need to include you M-file, outp

  • Q : Problem on Datalog for defining

    The focus is on  the use of Datalog for defining properties  and queries on graphs. (a) Assume that P is some property of graphs  definable in the Datalog. Show that P is preserved beneath extensions  and homomo

  • Q : How to get calculus homework done from

    How to get calculus homework done from tutor

  • Q : Ordinary Differential Equation or ODE

    What is an Ordinary Differential Equation (ODE)?

  • Q : Calculus I need it within 4 hours. Due

    I need it within 4 hours. Due time March 15, 2014. 3PM Pacific Time. (Los Angeles, CA)

  • Q : Probability and Stochastic assignment

    Introduction to Probability and Stochastic Assignment 1: 1. Consider an experiment in which one of three boxes containing microchips is chosen at random and a microchip is randomly selected from the box.

©TutorsGlobe All rights reserved 2022-2023.