--%>

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 : Ordinary Differential Equation or ODE

    What is an Ordinary Differential Equation (ODE)?

  • Q : Test Please read the assignment

    Please read the assignment carefully and confirm only if you are 100% sure. Please go through below mentioned guidelines and penalties: • Your solution must be accurate and complete. • Please do not change Subject Title of the Email. • Penalty clause will be applied in case of delayed or plag

  • Q : The mean of the sampling distribution

    1. Caterer determines that 87% of people who sampled the food thought it was delicious. A random sample of 144 out of population of 5000 taken. The 144 are asked to sample the food. If P-hat is the proportion saying that the food is delicious, what is the mean of the sampling distribution p-hat?<

  • Q : Define terms Terms : Terms are defined

    Terms: Terms are defined inductively by the following clauses.               (i) Every individual variable and every individual constant is a term. (Such a term is called atom

  • Q : Who firstly use the finite-difference

    Who firstly use the finite-difference method?

  • Q : Numerical Analysis Hi, I was wondering

    Hi, I was wondering if there is anyone who can perform numerical analysis and write a code when required. Thanks

  • Q : Pig Game Using the PairOfDice class

    Using the PairOfDice class design and implement a class to play a game called Pig. In this game the user competes against the computer. On each turn the player rolls a pair of dice and adds up his or her points. Whoever reaches 100 points first, wins. If a player rolls a 1, he or she loses all point

  • Q : Who firstly discovered mathematical

    Who firstly discovered mathematical theory for random walks, that rediscovered later by Einstein?

  • Q : Research Areas in Medical Mathematical

    Some Research Areas in Medical Mathematical Modelling:1. Modeling and numerical simulations of the nanometric aerosols in the lower portion of the bronchial tree. 2. Multiscale mathematical modeling of

  • Q : What is Non-Logical Vocabulary

    Non-Logical Vocabulary: 1. Predicates, called also relation symbols, each with its associated arity. For our needs, we may assume that the number of predicates is finite. But this is not essential. We can have an infinite list of predicates, P