ahmeng

35 Reputation

3 Badges

3 years, 108 days

MaplePrimes Activity


These are questions asked by ahmeng

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


 

Suppose I am given the following summation:

 

sum(a*i, i = 1 .. n)

``

Can Maple write the first few terms of the summation? For example, if I want to see first three terms of the summation, I'd like Maple to output the following:

 

a + 2 a + 3 a

 

My use case is that if I am given a complicated summation, it can be useful to look at the first few terms to see if there are any patterns.

 

The things I've tried are:

 

sum(a*i, i = 1 .. 3)

6*a

(1)

'sum(a*i, i = 1 .. 3)'

sum(a*i, i = 1 .. 3)

(2)

eval(sum(a*i, i = 1 .. 3))

6*a

(3)

expand(sum(a*i, i = 1 .. 3))

6*a````

(4)

``


 

Download expandsum.mw

1 2 Page 1 of 2