6 years, 17 days

## How to decrypt a message, m, using CRT ...

Maple

I have to use the Chinese Remainder Theorem but once I have found m^e I cant seem to figure out a way that works to get just the message without the exponent. I assumed that the exponent is 3 since the message was encrypted 3 different times. How can I do this with Maple?

CRA_project.mw

## Need help with the code...

Maple

(a) Plot the graph of
sin(x)*exp( -x^2)
for x in the interval [-2,2].
(b) Find to 10 decimal digits the maximum and minimum values of
sin(x)*exp( -x^2)
for x in [-2,2] AND find the corresponding values of x. [So if the maximum occurs at x=a, you should also compute sin(x)*exp( -x^2)   both to 10 digits. Similarly for the minimum. Using unapply to make the expression into a function will be useful here.]

So far I have this for a

> j := exp(-x^2)*sin(x);

> plot(j, x = -2 .. 2);

## Help writing the code...

Maple

Generate 8 random 3 by 3 matrices using the RandomMatrix command from the  LinearAlgebra package. As each matrix is generated use Eigenvalues to compute its eigenvalues. Then take the product of the eigenvalues, and check that for each matrix, this product is equal to the determinant of the matrix.

[Hint: The product will be complicated algebraically and you will need to apply first expand, then simplify to reduce the product of the eigenvalues to an integer. First try to do for a single matrix , then make a loop to do it 8 times.]

## How do I write the code?...

Maple

There is a one-to-one correspondence between subsets of {1, 2, . . . , n} and binary lists of length n, that is, lists L = [x1, x2 , . . . , xn] where x1, x2, . . . , xn are elements of the set {0,1}.  The correspondence is given by associating to the set S the list L where xi = 1 if i is in S and 0 if not. For example, the set {1,3,5} corresponds to the list [1,0,1,0,1,0,0] if n = 7.

(a) Write a procedure list_to_set whose input is a binary list and whose output is the corresponding set. E. g., list_to_set([1,0,1,0,1]) will return the set {1,3,5}. Note that nops(L) is the length of a list.

(b) Write a procedure set_to_list whose input is a pair S,n where S is a subset of {1, 2, . . . , n} and n is a positive integer and whose output is the binary list of length n corresponding to the set S. E. g., if n = 5 then set_to_list({1,3,5},5) will return [1,0,1,0,1].

(c) Show by a few tests that each procedure works. Then apply set_to_list to each set in the powerset of {1, 2, 3, 4} to form all binary lists of length 4. Make a program to print out a table of the following form. (But the order need not be the same as that started below.)

[0,0,0,0] <-->  {  }
[1,0,0 0] <--> { 1 }
[0,1,0,0] <--> { 2 }
........
etc

Some extra commas in the output is okay. You may obtain the power set of the set {1,2,...,n} by the command powerset(n); but you must first load the package combinat.

## How do I write the code?...

Maple

For each natural number n, the n-th square matrix  An is defined by
An( i, j) =0 if  i = j,   An( i, j) =1 if i ≠ j
Carry out the following computations for n=3,4 and 5.

(a) Compute the determinant of  An

(b) Compute the characteristic polynomial of  An

(c) Determine all eigenvalues of  An and determine for each eigenvalue a basis of the corresponding eigenspace.

 1 2 3 Page 1 of 3
﻿