# MAPLE ASSIGNMENT 1 # # SET THEORY # # You can use the following commands to check your understanding of set # operations. That is, do you agree with Maple's answers? > S1:={1,2,a,b}; > S2:={a,1,b,2}; > S3:={a,x,y,z,17}; > evalb(S1=S2); > evalb(S1=S3); > X:=S1 union S3; > X1:= S1 intersect S3; > X2:=S1 minus S3; > X3:=S3 minus S1; > X2 intersect X3; > X4:=X1 union X2 union X3; > evalb(X4=S1 union S3); # Define a set S4 which has a nonempty intersection with both S1 and S3 # but is not a subset of X=S1 union S3. Test your answer by (i) # computing # S1 intersect S3 intersect S4 and (ii) by using the evalb command to # show that S4 union X = X is false. > U:= S1 union S3 union {3,4,5,b,c}; # Calculate the complements of S1, S3, X and X1 with respect to the U # above, call them cS1, cS3 etc. and use evalb to show that # cS1 union cS3 = c(S1 intersect S3) = cX1 # cS1 intersect cS3 = c(S1 union S3) = cX # # The other distributive law for sets is (A union B) intersect C = (A # intersect C) union (B intersect C). Use S1, S3 and S4 as your sets A, # B and C in any order. Calculate the LHS and the RHS of the above # equation and compare the two results to test the law. If you give the # 2 expressions names you can use evalb to test the law. # # NUMBERS # # The arithmetic operations are represented in Maple by +, -, *, / and # ^. > a:=(3+4)/5; > b:=(3*4)/5; > c:=exp(1)^2; # For precision of calculation, Maple does not convert fractions or # expressions with exponents unless it is forced to by making one of the # numbers decimal such as replacing 3 by 3. or by using the evalf # command. exp(1) is Maple's way of inputting the number e. > (3.+4)/5; > evalf(a); > evalf(exp(1)); > evalf(Pi); > 3^(1/3); > evalf(3^(1/3)); # # You can use Maple to check your arithmetical skills. For example use # +, * and brackets to write an expression involving 3, 4 and 7 which # gives # the answer 49. Does (3/4)+(5/6) = (3+5)/(4+6)? Check it out. What is # an alternative expression for calculating (3/4)*(5/6)? # # Maple does symbolic calculations as well as numerical calculations. > (x+y)/(w+z); > (x/w)+(y/z); > simplify("-""); # The answer is not zero so the two expressions were not equal. You can # also use Maple to review the laws of exponents. > (x^m)+(x^n); > simplify("); > (x^m)*(x^n); > simplify("); > (x^m)^n; > simplify("); # Maple doesn't recognize the second law of exponents amd try the # following examples to show that Maple can make mistakes. > (5^(3/2))^(3/4); > 5^((3/2)*(3/4)); > evalf("); > 5^(9/8); > >