Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 12 Professional
Maple 12 Academic
Maple 12 Student Use
Recorded Online Seminars
FREE Training Resources
Maple Application Briefs
Maple Adoption Program

MapleNet
Maple T.A.
MapleConnect
BlockImporter for Simulink
BlockBuilder for Simulink
Maple Toolboxes
Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

Latest Information

New Features: Professional
New Features: Academic
Maple Features
The Maple Reporter Online
Numerical Algorithms Group
(NAG)


Service & Support

Maple Primes
blogs, forums etc

Elite Maintenance Program
Application Centre
Powertools
Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] Re: testeq

Search email archive for  

[MUG] Re: testeq
Author: Maple User Group    Posted: 22/08/2001 16:11:03 GDT
>> From: Maple User Group "maple_gr"

|On Thu, 16 Aug 2001, Bill Whiten wrote:
|> In Maple Vr5.1 Mac:
|>
|> > ex1:=n*k!/n!/(k-n)!*p^n*(1 - p)^(k-n);
|> > ex2:=k*(k-1)!/(k-n)!/(n-1)!*p^(n-1)*(1 - p)^(k-n)*p;

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 17 Aug 2001 15:16:20 -0700 (PDT)
From: Robert Israel "israel"
To: "maple-list"
Subject: testeq


This bug seems to be fixed in Maple 6, to the extent that the result is
FAIL rather than "false". Note that the help for testeq does not mention
factorial:

- This function will succeed over expressions formed with rational constants,
independent variables, and I, combined by arithmetic operations,
exponentials, trigonometrics and a few others. It may also succeed with some
expressions involving radicals, Pi as an argument of trigonometrics, and
algebraic constants and functions. If the expressions do not fall in this
class, testeq returns FAIL. Testeq may also return FAIL if it cannot find an
appropriate modulus that works after seven trials.

So FAIL should be an acceptable result in this context. Still, it's
curious that Maple 6 does not come up with "true" here, because it does
produce "true" for testeq(k*(k-1)!, k!).

Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 17 Aug 2001 23:10:12 -0400 (EDT)
From: Carl DeVore "devore"
To: "maple-list" "W.Whiten"
Subject: testeq



You do not need such a complicated example to catch this bug. In Maple
5.1, try
> testeq(n*(n-1)!, n!);
and you still get "false".

There seems to be much flip-flopping among versions with how testeq
handles this expression. Maple 6 returns "true". Maple 7 returns "FAIL".
FAIL is not incorrect per se, but if Maple 6 can find the answer, why not
Maple 7?

The testeq command does not try to simplify the difference. Therefore, I
think that testeq is intended for expressions where the simplify command
would take too long.

To verify equality, first try simplifying the difference.

--
Carl Devore
Maple programs written for hire. Maple advisor for hire.
"devore"



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Sun, 19 Aug 2001 16:24:13 +0100 (BST)
From: J H Davenport "jhd"
To: "maple-list"
Subject: testeq

Maple 6 returns 'FAIL' for me, which is not the same as false.

The HELP for testeq in Maple 6 says:
This function will succeed over expressions formed with rational
constants, independent variables, and I, combined by arithmetic
operations, exponentials, trigonometrics and a few others. It may also
succeed with some expressions involving radicals, Pi as an argument of
trigonometrics, and algebraic constants and functions. If the expressions
do not fall in this class, testeq returns FAIL. Testeq may also return
FAIL if it cannot find an appropriate modulus that works after seven
trials.

A quick use of printlevel shows that it is the second case (no modulus)
which is happening, essentially because Maple is refusing to work out the
factorials (which are converted into Gamma) since the arguments are too
large.

James Davenport



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Tue, 21 Aug 2001 11:02:23 +0200
From: Helmut Kahovec "helmut.kahovec"
To: "maple-list"
Subject: testeq

Well, this weakness of testeq() is present in the Windows version of
MapleV/Release5.1, too. It can be easily removed by changing the third
and fourth source code line of testeq() from

testeq := proc(a, b)
local expr, e1, e2, i, ig, preverror, s, t;
1 if nargs = 1 and type(a,algebraic) then
2 expr := a
elif nargs = 1 and type(a,`=`) and type(op(1,a),algebraic)
and type(op(2,a),algebraic) then
3 expr := op(1,a)-op(2,a)
elif nargs = 2 and type(a,algebraic) and type(b,algebraic)
then
4 expr := a-b
else
5 ERROR(`invalid arguments`)
fi;

...

to

testeq := proc(a, b)
local expr, e1, e2, i, ig, preverror, s, t;
1 if nargs = 1 and type(a,algebraic) then
2 expr := a
elif nargs = 1 and type(a,`=`) and type(op(1,a),algebraic)
and type(op(2,a),algebraic) then
3 expr := simplify(op(1,a)-op(2,a))
elif nargs = 2 and type(a,algebraic) and type(b,algebraic)
then
4 expr := simplify(a-b)
else
5 ERROR(`invalid arguments`)
fi;

...

Then we get:

> restart;

> ex1:=n*k!/n!/(k-n)!*p^n*(1-p)^(k-n);
> ex2:=k*(k-1)!/(k-n)!/(n-1)!*p^(n-1)*(1-p)^(k-n)*p;

> testeq(ex1,ex2),testeq(ex1=ex2);

true, true


With kind regards,

Helmut


[View Complete Thread]



Previous by date: [MUG] Re: Using data from a spreadsheet, Maple User Group
Next by date: [MUG] Re: Text Parsing, Maple User Group
Previous thread: [MUG] Testing Random Procedure.,  Jason C Leach
Next thread: [MUG] Re: Text Parsing, Maple User Group



Ready to buy?

Maple Professional
Add to shopping basket
$ 2,274.00
Upgrade to Maple 13 from v11 or v10
Add to shopping basket
$ 1,374.00
Maple Professional - for concurrent use
Add to shopping basket
$ 4,548.00

Featured Downloads

Maple White Paper: Technical Knowledge - An Asset You Can Afford to Lose?
Maple in Electronics Application Pack
Maple in Robotics & Aerospace Application Pack
Maple in Finance Application Pack

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks
adept

Top of the Page

Popular Links: ChemDraw | ChemOffice | Data Acquisition | Data Analysis | Easy-PC | EndNote | Maple | MapleSim | Mathcad | MathType | Quality Analyst | Reference Manager | VisSim

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2009, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055