Computer Science Proof

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 3706 Views - Last Post: 14 March 2014 - 10:11 AM

#1 shamieh   User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 146
  • Joined: 14-September 13

Computer Science Proof

Posted 13 March 2014 - 06:23 PM

What is the trick to this? We were talking about things with regards to logarithmic complexities. we were given this equation


log_a^n
_______ = C

log_b^n


Question: Given 3 constants - a,b, and c and 1 variable n, prove this.

How might I even begin starting to prove this. I don't want the answer I just want someone to point me or guide to me at least step one in solving this problem

Thanks in advance,
Everyone is always very helpful here.

Is This A Good Question/Topic? 0
  • +

Replies To: Computer Science Proof

#2 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Computer Science Proof

Posted 13 March 2014 - 06:27 PM

To make sure I understand- you are taking log_a(n), the logarithm base-a of n? Or the loga(x)n, the logarithm base-a of x, raised to the nth power?

You'll probably find the change of base formula helpful.
Was This Post Helpful? 0
  • +
  • -

#3 shamieh   User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 146
  • Joined: 14-September 13

Re: Computer Science Proof

Posted 13 March 2014 - 06:36 PM

View Postmacosxnerd101, on 14 March 2014 - 01:27 AM, said:

To make sure I understand- you are taking log_a(n), the logarithm base-a of n? Or the loga(x)n, the logarithm base-a of x, raised to the nth power?

You'll probably find the change of base formula helpful.


This is what I meant to say:

logan
____________ = C
logbn
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Computer Science Proof

Posted 13 March 2014 - 06:41 PM

So is the n an exponent or are you taking the logarithm of it? That's what I'm trying to clarify.
Was This Post Helpful? 0
  • +
  • -

#5 shamieh   User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 146
  • Joined: 14-September 13

Re: Computer Science Proof

Posted 13 March 2014 - 06:46 PM

View Postmacosxnerd101, on 14 March 2014 - 01:41 AM, said:

So is the n an exponent or are you taking the logarithm of it? That's what I'm trying to clarify.


The n is the exponent.

But I don't see how the log change of base formula will help me when it just states that

log_n^b/ log_n^a = log_a^b because I have to prove it is equal to some constant C right?

This post has been edited by shamieh: 13 March 2014 - 06:51 PM

Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Computer Science Proof

Posted 13 March 2014 - 06:59 PM

So what are you taking the logarithm of? Your identity isn't true if you have log_a(x^n)^n / log_b(x)^n. The change of base formula will allow you to rewrite everything in terms of one base and cancel out non-constant terms.
Was This Post Helpful? 0
  • +
  • -

#7 shamieh   User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 146
  • Joined: 14-September 13

Re: Computer Science Proof

Posted 13 March 2014 - 07:05 PM

View Postmacosxnerd101, on 14 March 2014 - 01:59 AM, said:

So what are you taking the logarithm of? Your identity isn't true if you have log_a(x^n)^n / log_b(x)^n. The change of base formula will allow you to rewrite everything in terms of one base and cancel out non-constant terms.



Perhaps my teacher wrote the problem down wrong, or perhaps I need to just assume, as you said that it is really log_a (x) ^n. I will try that and see what I get. I think you are correct though.
Was This Post Helpful? 0
  • +
  • -

#8 shamieh   User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 146
  • Joined: 14-September 13

Re: Computer Science Proof

Posted 13 March 2014 - 07:51 PM

Hey Mac I can't read and that is why I called you Max initially, my bad. I now have
string max = "mac";
now so I shouldn't mess up your name again... :innocent:

I'm running into a problem though, i went ahead and tried to solve it as my teacher wrote it and came up with this:

I know that: log_a^n = lob_b^n/log_b^a

this I also know that log_a^n = c is the same as: a^c = n

solving - i came up with:

log_b a^c = log_b ^n

c*log_b ^a = log_b ^n

c = log_b ^n/log_b ^a

and I need to somehow get c = log_a ^n/ log_b ^n
Was This Post Helpful? 0
  • +
  • -

#9 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Computer Science Proof

Posted 13 March 2014 - 07:57 PM

Look- the ^ symbol denotes an exponent. Nowhere does the change of base formula use an exponent. It's getting a little notationally confusing. If you want to use TeX notation, that is fine, but please adhere to standards so we can all keep on the same page. :)

So log_a(n) = log_b(n)/log_b(a). So if we have log_a(n)/log_b(n), we get log_a(n) * log_a(b)/log_a(n) = log_a(b) = O(1).
Was This Post Helpful? 0
  • +
  • -

#10 shamieh   User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 146
  • Joined: 14-September 13

Re: Computer Science Proof

Posted 13 March 2014 - 08:04 PM

View Postmacosxnerd101, on 14 March 2014 - 02:57 AM, said:

Look- the ^ symbol denotes an exponent. Nowhere does the change of base formula use an exponent. It's getting a little notationally confusing. If you want to use TeX notation, that is fine, but please adhere to standards so we can all keep on the same page. :)

So log_a(n) = log_b(n)/log_b(a). So if we have log_a(n)/log_b(n), we get log_a(n) * log_a(B)/log_a(n) = log_a(B) = O(1).


OH!!! I was reading it wrong!!! I was thinking its an exponent. I quit life. WOw im dumb
Was This Post Helpful? 0
  • +
  • -

#11 shamieh   User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 146
  • Joined: 14-September 13

Re: Computer Science Proof

Posted 13 March 2014 - 08:16 PM

View Postmacosxnerd101, on 14 March 2014 - 02:57 AM, said:

Look- the ^ symbol denotes an exponent. Nowhere does the change of base formula use an exponent. It's getting a little notationally confusing. If you want to use TeX notation, that is fine, but please adhere to standards so we can all keep on the same page. :)

So log_a(n) = log_b(n)/log_b(a). So if we have log_a(n)/log_b(n), we get log_a(n) * log_a(B)/log_a(n) = log_a(B) = O(1).



log_a(n) = log_b(n)/log_b(a)

so how are you going to take the numerator and randomly take it out to divide it by log_a(n)?

Did you mean to say log_a(n)/ ((log_b(n)/log_b(a))) ?
Was This Post Helpful? 0
  • +
  • -

#12 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Computer Science Proof

Posted 13 March 2014 - 08:24 PM

I changed the base from b to a.
Was This Post Helpful? 0
  • +
  • -

#13 shamieh   User is offline

  • D.I.C Head

Reputation: -4
  • View blog
  • Posts: 146
  • Joined: 14-September 13

Re: Computer Science Proof

Posted 13 March 2014 - 08:31 PM

Ok I understand you changed the base.

But then you would have log_a(n)/log_b(n) which would
= log_a(n) * 1/log_b(n) .... so how exactly are you getting:

log_a(n) * (log_a(BE)/log_a(n))?


NOTE: BE = b in the second line for some reason if i type what you have it generates a smiley face

This post has been edited by shamieh: 13 March 2014 - 08:36 PM

Was This Post Helpful? 0
  • +
  • -

#14 Momerath   User is offline

  • D.I.C Lover
  • member icon

Reputation: 1021
  • View blog
  • Posts: 2,463
  • Joined: 04-October 09

Re: Computer Science Proof

Posted 13 March 2014 - 09:24 PM

In the original equation, we have

log_a(n) / log_b(n) = C

We know that

log_a(n) = log_b(n)/log_b(a) (base conversion)

We now substitute into the original equation

(log_b(n)/log_b(a)) / log_b(n) = C

We also know that division is inverse multiplication, so we get

(log_b(n) / log_b(a)) * (1 / log_b(n)) = C

The two 'log_b(n)' cancel, leaving

1/log_b(a) = C

n has vanished and we are just left with our constants, proof done.
Was This Post Helpful? 1
  • +
  • -

#15 mojo666   User is offline

  • D.I.C Addict
  • member icon

Reputation: 409
  • View blog
  • Posts: 885
  • Joined: 27-June 09

Re: Computer Science Proof

Posted 13 March 2014 - 09:25 PM

I think using the change of base formula is somewhat circular since what you are trying to prove is almost the change of base formula. Rather just let b = a^c where c is some constant. Rewrite your log formulas

log_a(n) = x
log_b(n) = y

can be rewritten as

a^x = n
b^y = n


substitute a^c for b and see what you can come up with from there.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2