ahmeng

40 Reputation

4 Badges

6 years, 315 days

MaplePrimes Activity


These are questions asked by ahmeng

When trying to understand what a proof is trying to show, I like to construct some examples to see what the proof is trying to show. For example, constructing some sequence to show whether it converges, visualizing some functions to understand the squeeze theorem in calculus, etc. I found Maple has worked well for this kind of work.

Now I am taking course in Measure Theory and everything is so abstract and I am not sure if Maple is capable of building the objects discussed. For example, this is from the book Probability Essentials:

How can I use Maple to support understanding the proofs? It would be nice if I can build the objects discussed and write functions to verify their properties and just play around with them in general to get an intuition of how the proof works.

 

 

 

 

I am trying to solve this type of problem:

I thought I could double check my answers by creating a RandomVariable and calculating the probablity using the Probability function.

But from the RandomVariables documentation,  it seems only univariate random variables are supported.

Is there really no way to define a RandomVariable given a joint distribution?

I have two functions, f(x) and g(x).

Based the plot, I can see that they intersect around x equals 0, 1, around 4.5 and 10.

So I tried to find the numerical solution by solving f(x) -  g(x) for x assuming x is real.

I'm stuck here because the aswer involves RootOf and _Z and I don't know what to do next.

This is what I've tried so far:
 

``

``

"f(x):=18*log10(x)"

proc (x) options operator, arrow; 18*log10(x) end proc

(1)

"g(x):=1/(2) x^(3)-8*x^(2)+(69/(2))^()*x-27"

proc (x) options operator, arrow; (1/2)*x^3-8*x^2+(69/2)*x-27 end proc

(2)

plot([f(x), g(x)], x = -1 .. 11)

 

``

`assuming`([solve(f(x)-g(x), x)], [x::real])

exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z))

(3)

allvalues(exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z)))

exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, 1.505446443)), exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, -3.291052648)), exp(RootOf(-(exp(_Z))^3*ln(10)+16*(exp(_Z))^2*ln(10)-69*exp(_Z)*ln(10)+54*ln(10)+36*_Z, 2.302585093)), 1

(4)

``

``


 

Download intersect_curve.mw

 

I know there's an answer to this because I can get the expected answer from Wolfram Alpha (see here).

How can I accomplish this in Maple? 


 

M := `<,>`(`<|>`(1, 2, 3), `<|>`(4, 5, 6), `<|>`(7, 8, 9))

Matrix(%id = 18446745804653824710)

(1)

b := `<|>`(10, 11, 12)

Vector[row](%id = 18446745804653819654)

(2)

M+b

Error, (in rtable/Sum) invalid input: dimensions do not match: Matrix(1 .. 3, 1 .. 3) cannot be added to Vector[row](1 .. 3)

 

``

Of course the above addition will throw an error because M and b have different dimensions. But if broadcasting was allowed, then the row vector b is added to each row in the matrix M. For example, in Python:

 

 

Is there a similar feature in Maple?


 

Download question.mw


 

Suppose I want to do some manipulations on this inequality:

 

(1/2)*k*n <= m

(1/2)*k*n <= m

(1)

I know I can use the map() function to move terms around, like so:

 

map(proc (x) options operator, arrow; 2*x end proc, (1/2)*k*n <= m)

k*n <= 2*m

(2)

map(proc (x) options operator, arrow; x/n end proc, k*n <= 2*m)

k <= 2*m/n

(3)

map(proc (x) options operator, arrow; x/m end proc, k <= 2*m/n)

k/m <= 2/n

(4)

But this method fails if I want to multiply both sides of the inequality by a negative number, for example:

map(proc (x) options operator, arrow; -x end proc, k/m <= 2/n)

-k/m <= -2/n``

(5)

How do I get Maple to switch the inequality sign to ≥ ?


 

Download tmp.mw

1 2 Page 1 of 2