JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for DERIVE-NEWS Archives


DERIVE-NEWS Archives

DERIVE-NEWS Archives


DERIVE-NEWS@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

DERIVE-NEWS Home

DERIVE-NEWS Home

DERIVE-NEWS  February 2007

DERIVE-NEWS February 2007

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: R. Schorn's challenge (from DNL #13, p.3) revisited

From:

Valeriu ANISIU <[log in to unmask]>

Reply-To:

Valeriu ANISIU <[log in to unmask]>

Date:

Tue, 6 Feb 2007 23:57:48 GMT

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (108 lines)

Hello Johann,

Another thing,
Your program seems to give wrong answers and becomes much slower than
mine when the degree of p is >> 4.
Try maxterm(x^100 + 4x^3 + 3x^2 + 2x + 1, 5)
or more dramatically maxterm(x^1000 + 4x^3 + 3x^2 + 2x + 1, 5),
versus maxterm1(...).

Cheers,
Valeriu




On 2/6/2007, "Valeriu ANISIU" <[log in to unmask]> wrote:

>Hello Johann,
>
>I was aware from the beginning that your program is much faster.
>But your program does not use Derive as a CAS;
>it manipulates lists instead of polynomials
>(except for a derivative, but this can be also
>avoided).
>In an ideal CAS (an world) the manipulation of polynomials
>should be very efficient. My program is waiting
>for that moment -:).
>
>Best reards,
>Valeriu
>
>
>
>
>On 2/6/2007, "Johann Wiesenbauer" <[log in to unmask]> wrote:
>
>>Hello Valeriu,
>>
>>Great! Yes, as for brevity and elegance, your program is hard to surpass.
>>In particular, it makes excellent use of some built-in Derive features.
>>Even though, I hate to say it, but it is considerably slower (by a factor
>>of about 100 on my machine) than my program.
>>
>>You know,  I have been in the programming business for decades now, and
>>nowadays I'm no longer the merciless performance hunter I used to be. If a
>>program is so elegant and short like yours, I would certainly accept a
>>lower performance to some degree. But here, as for me, this sacrifice of
>>performance is too much though. (Just a hint: Try to increase the exponent
>>n in this example up to say n=1000 and compare!)
>>
>>Cheers,
>>Johann
>>
>>At 19:57 06.02.2007, you wrote:
>>>Hello Johann, hello everybody,
>>>
>>>My solution is slower but simpler:
>>>
>>>maxterm1(u,n,x,c_,v_):=PROG(
>>>v_:=TERMS(EXPAND(u^n),x),c_:=SUBST(v_,x,1),v_ SUB POSITION(MAX(c_),c_)
>>>)
>>>
>>>However, the result of
>>>maxterm1(4*x^3 + 3*x^2 + 2*x + 1,100)
>>>
>>>namely
>>>
>>>39824366720341062302484823668460396313761926035630933326602206546298515593960~
>>>4195463780443664821745*x^200
>>>
>>>is obtained in < 2 seconds.
>>>
>>>Best regards,
>>>Valeriu
>>>
>>>
>>>
>>>On 2/6/2007, "Johann Wiesenbauer" <[log in to unmask]> wrote:
>>>
>>> >Hi folks,
>>> >
>>> >Now that Josef Boehm is about to reissue the DNL #13, I had a look at R.
>>> >Schorn's problem on page 3, namely to compute the maximal coefficient of
>>> >the polynomial
>>> >
>>> >(4x^3+3x^2+2x+1)^20
>>> >
>>> >Well, that was almost 13 years ago and it took Derive 387.2s then to find
>>> >the answer 8842311087597693745, which turns out to be the coefficient of
>>> x^40.
>>> >
>>> >Just to take into account the advances of both Derive and computers since
>>> >then, I would like to increase the exponent to say 100, and pose this as a
>>> >new challenge. (As there are vacations at the universities right now, I
>>> >thought, you might feel like a challenge!) In other words, what is the
>>> >maximal coefficient in the expansion of
>>> >
>>> >(4x^3+3x^2+2x+1)^100
>>> >
>>> >and in which monomial does it occur?
>>> >
>>> >I for my part also got my teeth into this nice problem and just in case you
>>> >want to compare with my solution (in Derive 6.10), you will find it in the
>>> >attachment.
>>> >
>>> >Cheers,
>>> >Johann)

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

November 2022
October 2022
May 2022
April 2020
December 2019
September 2019
April 2019
June 2016
January 2016
November 2015
June 2015
December 2014
July 2014
June 2014
April 2014
March 2014
January 2014
December 2013
November 2013
October 2013
September 2013
April 2013
March 2013
January 2013
November 2012
August 2012
April 2012
December 2011
October 2011
September 2011
February 2011
January 2011
December 2010
September 2010
May 2010
March 2010
February 2010
January 2010
November 2009
October 2009
September 2009
August 2009
May 2009
April 2009
January 2009
December 2008
October 2008
September 2008
August 2008
July 2008
May 2008
December 2007
October 2007
September 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
May 2006
April 2006
March 2006
February 2006
December 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
March 2005
February 2005
January 2005
December 2004
October 2004
September 2004
August 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
January 2001
December 2000
November 2000
October 2000
September 2000
August 2000
July 2000
June 2000
May 2000
April 2000
March 2000
February 2000
January 2000
December 1999
November 1999
October 1999
September 1999
August 1999
July 1999
June 1999
May 1999
April 1999
March 1999
February 1999
January 1999
December 1998
November 1998
October 1998
September 1998


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager