I think you've got the answer...though I don't know a formula for that
summation.
So you've got:
1 + (n-2) + (n-2)(n-3) + ... + (n-2)!
Say k = (n-2), so you have:
1 + k + k(k-1) + k(k-1)(k-2) + ... + k!
Divide by k!:
1/k! + 1/(k-1)! + 1/(k-2)! + ... + 1/2! + 1
So we have:
Sum (i=1 to k) of 1/i!
Now there must be a formula for that...I'm going to hunt for it. Does
that look right??
Anushka
p.s: That link you posted before is great.
I hope everyone's studying is going well :P 10 more days!
T(n) = T(floor(n/2)) + T(floor(n/4)) + cn
I don't know the solution for this either.
Thanks,
Anushka
Drawing the recurrence tree:
1st level cost: cn
2nd level cost: 3cn/4
3rd level cost: 9cn/16
So, running time is cn + 3cn/4 + 9cn/16 + ..... + etc...
Fraction is monotonically decreasing, so running time will be the
largest term: theta(n).
There is a visual illustration of a similar tree in CLR that I just
saw yesterday.
- Arun
- Arun
> > On 04/04/07, habiba <habi...@gmail.com> wrote:
>
> > > for the first problem, i think its (b) since its undecidable, so its not
> > > accepted by a turing machine and all finite languages are accepted by a TM
> > > so L shud be infinite. and 2 is i think right too since recursive is
> > > contained in RE. 3rd isnt correct because if a language and its complement
> > > are both undecidable then actually they are recursive and not RE. (does it
> > > make sense?)
> > > the 2nd quesiton:
> > > my guess is (D) ...i guess i did see this question in some paper.
> > > In the 1st option, we are concerned with only n steps so once the n
> > > steps are over we are done. And so is the 3rd. In the 2nd TM can go & on and
> > > we never know when is 1 printed.
>