Robert Israel

6577 Reputation

21 Badges

18 years, 212 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are answers submitted by Robert Israel

The solutions using op assume the terms are in a specific order (which may or may not be true, and might change from one session to another).  Also, could some of the numerators be 0, or some denominators be 1?  Here's a more "algebraic" solution:

 a, b:= (numer, denom)(coeff(expr, Pi, 0));

 c, d:= (numer, denom)(coeff(expr,Pi,-1));

 

 

Yes indeed:

a := proc(p:: {polynom, set(polynom), list(polynom)})
   ...
  end proc;

 

1.  No, it's not "dy/dx of a point".  I assume you have some equation y = f(x) and you want to find the derivative dy/dx at x = (some value you found).  If you have defined f as a function, e.g.

> f := x -> x^2 + sin(x);

then what you want is

> D(f)(the value you found);

2. (a) See above.  Note that in Maple you want Pi, not pi.
    (b) Hint: a point is given by its x and y coordinates.
    (c) Hint: what's the equation of a straight line with a given slope through a given point?

Suppose your list L has length n.
Let M be the n x n matrix with entries M[i,j] = 1 if i < j and L[i] < L[j], 0 otherwise.
The length of the longest increasing subsequence is the greatest m such that
M^m <> 0.  So this method should work:

> longestIncreasingLength:= proc(L::list)
    local n, M, Mp, Z, count;
    uses LinearAlgebra;
    n := nops(L);
    M := Matrix(n,n, (i,j) -> `if`(i<j and L[i]<L[j], 1, 0), 
             storage=sparse);
    Mp := Copy(M);
    Z:= ZeroMatrix(n,n);
    for count from 1 do
       MatrixMatrixMultiply(Mp, M, inplace);
       if Equal(Mp,Z) then return count end if;
    end do
   end proc;
      

It could be made more efficient by using repeated squaring and binary search.

All these fancy GUI features do require processing time.  If you want to reduce this,
I think your best bet is to use 1d input instead of 2d, worksheet mode instead of document, and maybe even Classic GUI instead of Standard.

One interesting thing about your worksheet: you reference a label (11), but there is no such label visible: after (10) comes (12). 

There is an orthonormal basis of eigenvectors if and only if A is a normal matrix.

There may be issues of premature evaluation.  This works for me:

> Q:= MathML[Export](1):
   with(Maplets[Elements]):
   maplet := Maplet([
      [MathMLViewer['ML']()],
      [Button("1",Evaluate('ML'='Q')),
       Button("Done", Shutdown())]
   ]):
 Maplets[Display](maplet);

Yes, it is separable: "quadrature", for odeadvisor, is the special case of separable where the right side depends only on either the independent or the dependent variable.

Maple didn't "forget" about those trivial solutions, or the other one (y=0).  dsolve returns the general solution.  It is very common to have special solutions corresponding to limits as the arbitrary parameter _C1 goes to +infinity or -infinity.

 

y' in 2D math is really D(y).  So instead of substituting for y(t) you have to substitute for the function y.  Thus:

(D(y))(t) = x(t)+y(t)*(1-x(t)^2-y(t)^2)

> eval(%,{x=(t -> r(t)*cos(Theta(t))),y=(t->r(t)*sin(Theta(t)))});

(D(r))(t)*sin(Theta(t))+r(t)*cos(Theta(t))*(D(Theta))(t) = r(t)*cos(Theta(t))+r(t)*sin(Theta(t))*(1-r(t)^2*cos(Theta(t))^2-r(t)^2*sin(Theta(t))^2)

What does your equation say for x = 1?

The basic method for solving an equation of this type is
1) check what happens when the endpoints of the integral are equal
2) take the derivative.

 

Sorry, that method will not work.  If you apply the inverse correlation matrix to a vector of independent uniform random variables, they cease to be uniform.  Moreover, if you did have a vector of correlated uniform random variables, applying the inverse CDF of some non-uniform distribution to each random variable would change the correlations.

Actually, I think the first thing to think about is what you really mean by correlated logistic random variables.  What is the joint distribution?  It's not at all obvious (not like the multivariate normal distribution, where there's an obvious choice).  The second thing to do is to consult a statistician, which I am not...

 

This? > map(diff, y^2+(x-c)^2=c^2, x);

Try this:

> matrixMaplet:= proc(m::posint, n::posint)
     local maplet;
     uses Maplets[Elements];
     maplet:= Maplet([
      ["Enter the matrix, please"],
      seq([seq(TextBox[_entry||i||j](width = 5),j = 1..n)],
                i = 1..m),
      [Button("Return the matrix",
          Shutdown([seq(seq(_entry||i||j,j=1..n),i=1..m)]))]
   ]);
   Matrix(m,n,map(parse,Maplets[Display](maplet)));
  end proc:
  matrixMaplet(3,4);

  

 

 

> solve(eqns,x);

Warning, solutions may have been lost

RootOf((2*a*Pi^2+Pi^2)*_Z^6+(-a^2*Pi^2-4*a*Pi^2-2*Pi^2)*_Z^4+(-4*a*Pi-4*a^2*Pi)*_Z^3+(Pi^2+a^2*Pi^2+2*a*Pi^2)*_Z^2+(4*a*Pi+4*a^2*Pi)*_Z+4*a^2)

> P := subs(_Z=x,op(%));
  galois(subs(Pi=pi,P), x);

"6T16", {"S(6)"}, "-", 720, {"(1 6)", "(2 6)", "(3 6)", "(4 6)", "(5 6)"}

In this case we have a polynomial of degree 6 that, in general, is not solvable by radicals.   So the option of an "exact" solution does not exist.

Again, there are branches of the RootOf solution that are not solutions of your equation: note that P has degree 2 in a, but eqns is of degree 1 in a.  For almost all x with |x| > 1 there will be two real values of a satisfying P, but since eqns is only of degree 1 in a, only one of these can be a solution of eqns.

 

Of course, to get a plot you'll need numerical values for the parameters a and eps.

> a:= 2; eps:= 0.1;
   plot([u0, diff(u0,t), t=-2..10],labels=[u[0],`u'`[0]],numpoints=1000,view=[-3..3,-2..40]);

First 109 110 111 112 113 114 115 Last Page 111 of 138