maths / moodle-qtype_stack

Stack question type for Moodle
GNU General Public License v3.0
138 stars 147 forks source link

Problem with ATAlgEquiv #1109

Closed alcarola closed 5 months ago

alcarola commented 5 months ago

This issue is possibly related to #297, but I'm not sure.

Should not the following two expressions be determined to be the same by ATAlgEquiv? Currently, they are not:

ETans2:(n+1)^((n+2)/(n+1))/(n+2);
ETalt2:1/(n+2)*((n+1)^(1/(n+1)))^(n+2); 

I'm not so much asking what the reason is for them to be deemed different, but rather just asking from and user point of view if this is case works out the way we want it to work out.

$plugin->version = 2023060500; $plugin->release = '4.4.4 for Moodle 3.9+'; Maxima 5.41.0 using Lisp SBCL 1.4.6-1.fc29

sangwinc commented 5 months ago

Nice example, thanks for raising it. This is one of those design decisions in Maxima (and in mathematics) which people don't realise has been made! When is (a^b)^c really equal to a^(b*c)?!

alcarola commented 5 months ago

Indeed, I forgot to mention that n is a positive integer, and I did not declare it as such in Maxima. I added the following to the question and now it works:

declare(n,integer);
assume(n>0);
sangwinc commented 5 months ago

Yes, that's another approach!