Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Automatic expansion of Log[a^n] for a,nexplicit positive integers?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28255] Re: [mg28229] Re: [mg28180] Automatic expansion of Log[a^n] for a,nexplicit positive integers?
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Fri, 6 Apr 2001 01:53:03 -0400 (EDT)
  • References: <Pine.LNX.4.30.0104051017290.3276-100000@carmen.nikhef.nl>
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Mianlai,

You are absolutely right and I am absolutely wrong. This happens when one
talks before thinking.
Thanks,
Tomas
----- Original Message -----
From: "Mianlai Zhou" <lailai at carmen.nikhef.nl>
To: mathgroup at smc.vnet.net
Subject: [mg28255] Re: [mg28229] Re: [mg28180] Automatic expansion of Log[a^n] for
a,nexplicit positive integers?


> Dear Tomas,
>
> By the way, there is problem in your definition of lg. In your code you
> tested for all cases that Mod[n, 2] == 0, and returned Log[2] times the
> power of 2 whenever it is true. So lg[6] will give the answer Log[2].
> Apparently it is wrong.
>
> Regards,
> Mianlai
>
> > On Thu, 5 Apr 2001, Tomas Garza wrote:
> >
> > > If you are only concerned about powers of 2, then you may define the
> > > functiion lg and use it always instead of Log:
> > >
> > > In[1]:=
> > > lg[n_] := If[Mod[n, 2] == 0, IntegerExponent[n, 2]*Log[2], Log[n]]
> > >
> > > Then, e.g.,
> > >
> > > In[1]:=
> > > {lg[2], lg[4], lg[8], lg[16], lg[32], lg[3]}
> > > Out[1]=
> > > {Log[2], 2 Log[2], 3 Log[2], 4 Log[2], 5 Log[2], Log[3]}
> > >
> > > Tomas Garza
> > > Mexico City
> > > ----- Original Message -----
> > > From: "Harald Anlauf" <anlauf at hep.tu-darmstadt.de>
To: mathgroup at smc.vnet.net
> > > To: mathgroup at smc.vnet.net
> > > Subject: [mg28255] [mg28229] [mg28180] Automatic expansion of Log[a^n] for a,n
explicit positive
> > > integers?
> > >
> > >
> > > > Hi,
> > > >
> > > > is there a way to force Mathematica 4.0 to always expand expressions
like
> > > >
> > > > Log[4], Log[8], Log[16], etc. to 2*Log[2] etc.
> > > >
> > > > automatically?
> > > >
> > > > It is very annoying to have such logarithms expanded manually each
> > > > time they pop up again...
> > > >
> > > > PowerExpand[] apparently does not help/work.
> > > >
> > > > --
> > > > Ciao,
> > > > -ha
> > > >
> > >
> > >
> >
> >
> >
>



  • Prev by Date: Re: Help
  • Next by Date: Re: Ordering of output question
  • Previous by thread: Re: A universal simulation interface: database, input/output, plotting and visualization
  • Next by thread: implicit function