······@hotmail.com (Mohamed El-Zahaby) writes:
> i need a lisp code to calculate the effecitve branching facot b*
>
> N=1+b*+b*^2+..............+b*^d
>
> i know N and d want to know b*
The easy way
(loop for e from 0 upto d
sum (expt b e))
Cheers
--
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
719 Broadway 12th Floor fax +1 - 212 - 995 4122
New York, NY 10003, USA http://bioinformatics.cat.nyu.edu
"Hello New York! We'll do what we can!"
Bill Murray in `Ghostbusters'.
In article <···············@octagon.mrl.nyu.edu>,
Marco Antoniotti <·······@cs.nyu.edu> wrote:
>
>······@hotmail.com (Mohamed El-Zahaby) writes:
>
>> i need a lisp code to calculate the effecitve branching facot b*
>>
>> N=1+b*+b*^2+..............+b*^d
>>
>> i know N and d want to know b*
>
>The easy way
>
> (loop for e from 0 upto d
> sum (expt b e))
That's how to calculate N if you know b and d. He said he knows N but
needs to calculate b.
--
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
Barry Margolin <······@genuity.net> writes:
> In article <···············@octagon.mrl.nyu.edu>,
> Marco Antoniotti <·······@cs.nyu.edu> wrote:
> >
> >······@hotmail.com (Mohamed El-Zahaby) writes:
> >
> >> i need a lisp code to calculate the effecitve branching facot b*
> >>
> >> N=1+b*+b*^2+..............+b*^d
> >>
> >> i know N and d want to know b*
> >
> >The easy way
> >
> > (loop for e from 0 upto d
> > sum (expt b e))
>
> That's how to calculate N if you know b and d. He said he knows N but
> needs to calculate b.
Note to self: NEVER, I repeat NEVER, post messages before having your
morning coffe. :}
Sorry
--
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
719 Broadway 12th Floor fax +1 - 212 - 995 4122
New York, NY 10003, USA http://bioinformatics.cat.nyu.edu
"Hello New York! We'll do what we can!"
Bill Murray in `Ghostbusters'.
In article <·················@burlma1-snr2>, Barry Margolin
<······@genuity.net> wrote:
> In article <···············@octagon.mrl.nyu.edu>,
> Marco Antoniotti <·······@cs.nyu.edu> wrote:
> >
> >······@hotmail.com (Mohamed El-Zahaby) writes:
> >
> >> i need a lisp code to calculate the effecitve branching facot b*
> >>
> >> N=1+b*+b*^2+..............+b*^d
> >>
> >> i know N and d want to know b*
> >
> >The easy way
> >
> > (loop for e from 0 upto d
> > sum (expt b e))
>
> That's how to calculate N if you know b and d. He said he knows N but
> needs to calculate b.
So put a binary search around the outside of the above code.
Of course if you know highschool math regarding the sum of a geometric
series then you can come up with a closed-form expression. But that's
too easy.
-- Bruce
I dont want to calculate N
N is give and d is given
i want to calculate b*
the equation is
20= 1 + (b*) + (b*) ^2 + (b*) ^3 + (b*) ^4 + (b*) ^5 + (b*) ^6 + (b*)
^7 + (b*) ^8 + (b*) ^9
want to calc (b*)
Marco Antoniotti <·······@cs.nyu.edu> wrote in message news:<···············@octagon.mrl.nyu.edu>...
> ······@hotmail.com (Mohamed El-Zahaby) writes:
>
> > i need a lisp code to calculate the effecitve branching facot b*
> >
> > N=1+b*+b*^2+..............+b*^d
> >
> > i know N and d want to know b*
>
> The easy way
>
> (loop for e from 0 upto d
> sum (expt b e))
>
> Cheers