Search code examples
integerdisplaydigitsmaple

How to ascending order the following integers with maple (should not display any digit)


In this exercise you should not display any digit. Display only the minimal output required to establish your result. (a) Place the following integers in ascending order 100^(100); 80^(120); 60^(140); 40^(160)

evalb(-3<-2)

anyone can help what's next?


Solution

  • It's unclear whether you have to show it by steps, or whether you can simply get Maple to sort the quantities directly.

    Consider these three comparisons, which should be enough for you to figure out the ascending order:

    evalb( 80^(120) > 100^(100) );
    
               true
    
    evalb( 60^140 > 80^(120) );
    
               true
    
    evalb( 40^(160) > 60^140 );
    
               true
    

    Or, starting with a random rearrangement, you can get Maple to sort them.

    restart;
    
    # separate paragraph or execution group
    interface(typesetting=extended):
    
    S := [100%^(100), 40%^(160), 60%^(140), 80%^(120) ];
    
    answer := sort(S, (a,b)->value(a)<value(b));