60 Reputation

6 Badges

5 years, 96 days

MaplePrimes Activity

These are answers submitted by mschneider

number := rand(-90 .. 90);
angle := number()*i;
seq([angle(), convert(angle()*degrees, radians)], i = 1 .. 4);

The below algorithm does work for finding an exact side length of a hypotenuse....  it is not pretty, if you have a more efficient way please advise...  Essentially if a student finds the hypotenuse to be sqrt(360), I only want 6*sqrt(10) to be the accepted answer, which the below does quite well, but perhaps inefficiently.

$a=range(12,24,6);  #generate random side length a on right triangle
$b=$a/switch(rint(2),2,3);  #generate random side length b on right triangle that shorter than a
$c_radicand=($a)^2+($b)^2; #use pythag to find c squared
$c_approx=decimal(1,sqrt($c_radicand)); #find the approx value of c
#the below function finds the simplified exact value of c
$factors_radicand=maple("lista := numtheory:-divisors($c_radicand): select(issqr, lista)"); #generate list of divisors of c squared and select only the perfect squares from the list
$max_per_sq=maple("f:= $factors_radicand: max(f);"); #determine the max perfect square from the above
$root_a_value=sqrt($max_per_sq); #use the max perfect square to find out what will come out of the root
$root_b_value=$c_radicand/(($root_a_value)^2); #determine what will stay in the new radicand
$entire_radical=maple("'sqrt(($a)^2+($b)^2)';"); #write out the entire radical, use for partial points
$mixed_radical=maple("'$root_a_value*sqrt($root_b_value)'"); #write out the mixed radical

Page 1 of 1