0

I have an algorithm that has the following cost:

C(Alg) <= t * Z

I've found on the web an exercise that state the following :

if t>=x,     I can say that     C(Alg) <= x * Z  <= t * Z

but it looks strange.. do you agree?

tshepang
  • 12,111
  • 21
  • 91
  • 136

1 Answers1

0

This is in general not true. Think about the case where $Z$ is negative, then this does not hold true:

$$\text{if} x \leq Z, \text{then} xZ \leq tZ$$
tonga
  • 11,749
  • 25
  • 75
  • 96
  • oh i'm sorry.. i didn't say that Z is always positive – user3158123 Jan 03 '14 at 17:43
  • Even if Z is always positive, the conclusion that `C(Alg)<=x*Z<=t*Z` under the condition that `x<=t` is incorrect because `xZ` is a tighter upper bound. – tonga Jan 03 '14 at 17:46