Integers
By definition,
(a) show that 1k + 2k + · · · + n
k
is O(n
k+1), where k is a positive integer.
(b) show that (n
3 + 2n)/(2n + 1) is O(n
2
).
(c) Prove that (n + 3)3 = Θ(n
3
)
- (a) Is 2n+1 = O(2n
)? why?
(b) Is 22n = O(2n
)? why? - Order the following functions into a list such that if f(n) comes before g(n) in the list then
f(n) = O(g(n)). If any two (or more) of the same asymptotic order, indicate which.
(a) Start with these basic functions
n, 2
n
, n lg n, n3
, lg n, n − n
3 + 7n
5
, n2 + lg n
(b) Combine the following functions into your answer for part (a). Assume that 0 < < 1.
e
n
,
√
n, 2
n−1
, lg lg n, (
√
2)lg n
, ln n, (lg n)
2
, n!, n1+
, 1 - Recall that we have discussed the method of explicit substitution to solve a recurrence relation.
It expands out the recurrence a few times until a pattern emerges. For instance, let us start with
the recurrence
T(n) = 2T(n/2) + cn.
where c is a positive constant. By repeatedly applying this rule, we can bound T(n) in terms of
T(n/2), then T(n/2
2
), then T(n/2
3
), and so on, at each step getting closer to the basis value of
T(1) = O(1):
T(n) = 2T(n/2) + cn = 2[2T(n/2
2
) + cn/2] + cn = 22T(n/2
2
) + 2cn
= 22
[2T(n/2
3
) + cn/2
2
] + 2cn = 23T(n/2
3
) + 3cn = . . .
A pattern is emerging. The general term is T(n) = 2kT(n/2
k
) + kcn. Plugging in k = lg n, we
get T(n) = n · T(1) + c n lg n = Θ(n lg n).
Do the same thing for the following recurrence
T(n) = 3 · T(
n
2
) + cn.
(a) What is the general kth term in this case?
(b) What value of k should be plugged in to get the answer? - Find the solution of the in each of the following recurrences, and then give tight bounds for T(n).
(a) T(n) = T(n − 1) + 1/n with T(0) = 0.
(b) T(n) = T(n − 1) + c
n with T(0) = 1, where c > 1 is some constant
(c) T(n) = 2 T(n − 1) + 1
Sample Solution
the desired outcome. Organized crime, for instance, was one of the most common form of deviance under the extreme prohibition of gambling, prostitution and drugs in the 1920s (Florien, 2009). Therefore, a small degree of crime plays an important role in guarding the privilege of our body politics and provide us room to express ourselves. The controversy on the effects of crime can also be discussed under the context of how it justifies our legal systems and promotes job creation. The practicability of law towards crime shows how significant our legal system is in the maintenance of our society. The diversity of law and how it specifically tackles various criminal behaviors is physical proof of why the legal system is still extremely viable nowadays. But, in turn, this cannot be made possible without the prevalence of crime. Law would simply be a set of groundless rules that can hardly be applied to the public, and it would not be able to fully exercise its function. Similarly, crime is also a necessity when it comes to creating jobs. The police department, occupations in the legal sector, private security etc, all these are jobs upheld by the presence of crime. In every superhero movie, a well-developed antagonist is crucial in order to have an interesting and coherent storyline, that is the same in real life. Ironically crime is a problem that needs to be fixed, but its complete extermination could mean a certain level of losses as well. The essential debate of crime is the debate of how an equilibrium can be achieved between the pursuit of societal peace in the long term, and the prevention of the underlying conditions of deviance. There is always a vital relationship between deep structural problems of our society and the rise and fall of crime rates. The idea that crime is destructive and should be eradicated is not wrong, but we also should not ignore the possibilities of positive change that are embedded within the pervasiveness of crime. The aforementioned positive aspects of crime bring us to a conclusion that crime is here to stay, but it depends on us to decide whether we should gain or lose from it. A small degree of crime is good for the society when we balance our desire for security with risk, and the call of liberty with the need of restraint. A prosperous society is a product of cultivation, and that is why crime is so important. About Essay Sauce>
GET ANSWER