• Nem Talált Eredményt

The Sopron Issue

In document Solving Math Problems with Maple (Pldal 129-135)

4. 2 The Polar Equation of the Conic Sections

6. Mathematical Modelling with Discrete Tools

6.3 The Sopron Issue

(6.3.1) (6.3.1)

>

>

>

>

>

>

instruction creates a table data type object. We can refer to the elements of the table with their indexes, e.g. Tindex

1

. The sequence of the indexes in the table is provided by the indices procedure and the sequence of the elements is provided by the entries procedure.

If the break name is evaluated in the body of the loop then the controlling is executed after the od keyword which closes the body of the loop, that is, with the help of the break we can exit the cycle. Contrary to this, the next name is used to skip the remaining instructions of the body of the loop and to execute the cycle again with the next value (if there is one) of the cycle variable.

The system executes repeatedly the sequence of instructions closed between the do and od keywords without checking.

Excersise

1. Generate an 8x8 arbitrary 0-1 matrix and denote it with M.

2. Interpret the elements of the M in a way that they should stand for the existing routes of a package delivery company. More precisely, assume that Mi,j=1 only if the company has a route from the si spot to the sj.

a) Determine the number of loads with which the company is able to deliver goods from the s1 spot to the s6. Try this for other situation pairs as well.

b) Determine those two spots where the most loads are needed for the goods to get from one place to the other.

c) Are there such two spots between which the goods cannot be delivered? Determine all these pairs.

6.3 The Sopron Issue

Consider the 0<a and b<1 real numbers and the A = 1Ka b

a 1Kb matrix. Determine the limit of the A, A2, A3, ..., An,... sequence.

The task came up at the University of West Hungary (previously called the University of Forestry and Wood Sciences) during a discussion held after a lecture on Maple. We immediately got down to solving the task like this:

restart

A:=Matrix 1Ka,b , a, 1Kb

A:= 1Ka b a 1Kb

n/infinitylim An

>

>

>

>

(6.3.2) (6.3.2)

(6.3.3) (6.3.3)

>

>

(6.3.4) (6.3.4)

>

>

(6.3.5) (6.3.5)

nlim/N

1Ka b a 1Kb

n

n/infinitylim evalm An

nlim/N

1Ka b a 1Kb

n

map limit,An,n=infinity

Error, invalid input: limit expects its 1st argument, expr, to be of type Or(equation, algebraic), but received Matrix(2, 2, {(1, 1) = 1-a, (1, 2) = b, (2, 1) = a, (2, 2) = 1-b})

We made the procedures of the linalg package be available then entered the A matrix. And that was the last successful command. What followed could be called the solo performance of the Beginner Maple User (BMU).

BMU enthusiastically gets down to solving the task. He firmly believes in Maple and that he will achieve a huge success. This behaviour is typical of Maple users: let’s spoil the task with a specific instruction then go and solve it! So BMU enters the first command and in return Maple responds the input. This occurs when the system is unable to execute the command given. BMU is a bit surprised but it crosses his mind that the evalm procedure is useful to be used during the matrix operations. He enters the second command while remaining highly optimistic but without careful thinking. Still no results. At this point BMU suspects that something has gone wrong so he desperately enters the map procedure without thinking. The result is disastrous. BMU collapses.

Maybe Maple does not know everything. Then BMU starts to use his common sense which is useful for a user working with a computer-algebra system.

Let’s look at two powers of the A matrix, for example its square and fifth power.

A2

1Ka 2Cb a 1Ka bCb 1Kb a 1Ka C 1Kb a b aC 1Kb 2 A5

1Ka 2Cb a 2C 1Ka bCb 1Kb a 1Ka C 1Kb a 1Ka C 1Ka 2Cb a 1Ka bCb 1Kb C 1Ka bCb 1Kb b a C 1Kb 2 a, 1Ka 2Cb a 2C 1Ka bCb 1Kb a 1Ka C 1 Kb a bC 1Ka 2Cb a 1Ka bCb 1Kb C 1Ka bCb 1 Kb b aC 1Kb 2 1Kb ,

a 1Ka C 1Kb a 1Ka 2Cb a C b aC 1Kb 2 a 1Ka C 1 Kb a 1Ka C 1Ka bCb 1Kb a 1Ka C 1Kb a C b a C 1Kb 2 2 a, a 1Ka C 1Kb a 1Ka 2Cb a C b aC 1

Kb 2 a 1Ka C 1Kb a bC 1Ka bCb 1Kb a 1Ka C 1

>

In the case of the larger power the result is messy so it is useless. Our aim is to find a closed formula for the elements of the An matrix because in this case we could try to determine the limits of these formulas.

So we are looking for a formula for the elements of the An. Why could not we consider the identical index elements of the powers of the A separately? Let’s start with the elements with the [1,1] index.

for i to 4 do B:=A^i; s[i]:=B[1,1]; print(expand(B[1,1])) od:

1Ka a2Ca bK2 aC1

Ka3K2 a2 bKa b2C3 a2C3 a bK3 aC1

a4C3 a3 bC3 a2 b2Ca b3K4 a3K8 a2 bK4 a b2C6 a2C6 a bK4 aC1 At this point we use our intuitions and maybe we will be lucky. By all means, the 1Ka, 1K2$a, 1K3$a és 1K4$a. appearing at the beginning of the formula are fairly regular.

Then when we look at the second formula we can see that it begins with (1-a)2. So the beginning of the second formula can be divided by 1-a, that is, by the first formula.

i:= 1;expand quo siC1,si,a ;expand rem siC1,si,a i:= 1

KaC1Kb b

So if the second formula is divided by the first one then the quotient of the division will be 1-a-b and the remainder will be b. After this the command above should be repeated for i=2.

i:= 2;expand quo siC1,si,a ;expand rem siC1,si,a i:= 2

KaC1Kb b

If you have also exclaimed like us then you can fully understand the hardships and the marvellous moments of mathematical problem solving. From this moment on, we can be sure that we have found the solution. Let’s try the i=3 and i=4 cases. If you have worked parallel with us then you can notice that the quotient and the remainder of the divisions have not changed.

According to this, if the T(n) is the [1,1] index element of the An matrix then it has to satisfy the following recurrent relation.

T 1 = 1Ka,T n =T nK1 KaC1Kb Cb

T 1 = 1Ka,T n =T nK1 KaC1Kb Cb Maple, the floor is yours!

rsolve T 1 = 1Ka,T n =T nK1 KaC1Kb Cb ,T

>

So we think that the X1,1 is the [1,1] index element of the An matrix. Indeed, this is a conjecture because we wrote the recurrent relation after having tried the first four elements. So although the proof is still ahead, let’s create the formulas for the other three elements in the first place. We already have the idea so we only have to apply it. Let’s see the [1,2] index elements.

for i to 4 do B:=A^i: s[i]:=simplify(B[1,2]):print(B[1,2])

od: b

for i to 3 do expand(s[i+1]-s[i]*(1-b-a)-b) od;

0

We have created the [1,2] index elements of the A, A2, A3, A4 matrixes. We executed a division then checked with the for cycle whether these values were the same for the first four powers.

Finally, we wrote the recurrent relation conjectured and solved it with the rsolve procedure. We put the result into the X1,2 variable.

In the case of the remaining X2,1 and X2,2 elements we only show the instructions beginning from the solutions of the recurrent relations.

T 1 =a,T n =T nK1 KaC1Kb Ca

(6.3.22)

Let’s enter the B matrix

B:=Matrix 2, 2, X1, 1,X1, 2 , X2, 1,X2, 2

about which we state that it is the nth power of the A matrix for every 0<n integer. Let’s prove it with a whole induction by the n..

map x/subs n= 1,x ,B

We substituted 1 into the place of the n in all the elements of the B matrix. Then by having applied the normal procedure for all the elements of the matrix received this way we reached the initial A matrix. Let’s consider that the n is B=An for an integer and substitute n+1 into the place of the n in all the elements of the B. But before this, let’s introduce the t=1-a-b notation for the sake of clarity.

BT:=map x/subs 1 K aKb=t,x ,B

(6.3.29)

According to the induction conjecture An+1 is A,B and after the introduction of the t variable it becomes A.BT.

To finish the proof we had to show that the A.BT matrix was identical with the matrix. To do this, we considered their difference then wrote the 1-a-b expression into the place of the t in the result received and applied the expand procedure for the elements of the matrix created. We got the zero matrix as a result with which we finished the induction proof.

However, the determination of the limit matrix is still ahead. Instead of the B matrix you had better use the BT matrix which was created from the B by the introduction of the t=1-a-b variable.

A

1Ka b a 1Kb B

(6.3.32) (6.3.32)

>

>

>

>

(6.3.34) (6.3.34) (6.3.33) (6.3.33) KaC1Kb n aCb

aCb K KaC1Kb nK1 b aCb

K KaC1Kb nK1 a aCb

b KaC1Kb nCa aCb

BT

tn aCb

aCb K tnK1 b aCb K tnK1 a

aCb

b tnCa aCb

The task is not too difficult and the result can be seen on the matrix. First, let’s see the degenerate cases. If the a=b=0 then the A is an identity matrix and all of its powers are itself so we are facing the A,A... constant sequence the limit of which is itself. If the A=b=1 then the t=-1 and the tn sequence are not convergent so the limit matrix being searched does not exist.

So we can assume that the -1<t<1 and the a and b are not zero at the same time. In this case the tn is convergent and its limit is 0. So the matrix we have been looking for is:

map x/subs tn= 0,x ,(6.3.33) b aCb

b aCb a

aCb a aCb

What Have You Learnt About Maple?

You have learnt that even the usage of Maple does not rule out careful thinking during mathematical problem solving.

In document Solving Math Problems with Maple (Pldal 129-135)