Carl Love

Carl Love

27636 Reputation

25 Badges

12 years, 105 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

The command is solve(..., B). It is not clear what you mean by h and by "equation". Is h meant to be a variable in the equation? Then your := should be =. Or do you mean that the expression assigned to h should be set to 0? Either way, the answer is not so simple: You have a degree-6 polynomial in B.

Notation: I'll use juxtaposition to indicate intersection, `+` for union, `-` for minus, with `+` having precedence. |A| is nops(A), and (n C k) is a binomial coefficient.

We split cases via |AB|. There are three cases, |AB| = 3, 4, or 5. Regardless of the case, we have a factor of (30 C 5) for the choice of A+B and a factor of 2^25 choices for C - A+B.

Case |AB| = 5: Thus A=B. There are (5 C 3) = 10 choices for ABC in AB.

Case |AB| = 4: Either |A|=4 and |B|=5 or vice versa. This dichotomy contributes a factor of 2, and we will consider only the |A|=4 case without loss of generality. There are (5 C 4) choices of A within A+B and (4 C 3) choices of ABC in A. Total factor for this case 2*(5 C 4)*(4 C 3) = 40.

Case |AB| = 3:

  • Subcase |A|=3, |B|=5 or vice versa. Factor of 2 for the dichotomy. (5 C 3) choices of A in A+B, and only 1 choice of ABC in A. Total factor: 20
  • Subcase |A|=4, |B|=4. (5 C 4) choices of A in A+B, (4 C 3) choices of AB in A, and(3 C 3) choices of ABC in AB, for a total of 20.

Grand total: (20+20+40+10)*(30 C 5)*2^25 = 430353709793280 =

Edit: Corrections to the above.

Case |AB| = 4: Either |A|=4 and |B|=5 or vice versa. This dichotomy contributes a factor of 2, and we will consider only the |A|=4 case without loss of generality. There are (5 C 4) choices of A within A+B and (4 C 3) choices of ABC in A. The choice of whether the lone element of B-A is or is not in C contributes a factor of 2. Total factor for this case 2*(5 C 4)*(4 C 3)*2 = 80.

Case |AB| = 3:

  • Subcase |A|=3, |B|=5 or vice versa. Factor of 2 for the dichotomy. (5 C 3) choices of A in A+B, and only 1 choice of ABC in A. For each of the 2 elements of B-A, there is a choice of whether it is in C, for a factor of 2^2. Total factor: 2*(5 C 3)*2^2 = 80.
  • Subcase |A|=4, |B|=4. (5 C 4) choices of A in A+B, (4 C 3) choices of AB in A, and(3 C 3) choices of ABC in AB. For each of the 2 elements of (A-B)+(B-A), there is the choice of whether it is in C. Total factor: (5 C 4)*(4 C 3)*2^2 = 80.

Grand total: (10+80+80+80)*(30 C 5)*2^25 = 250*binomial(30,5)*2^25 = evalf[5](250*binomial(30,5)*2^25)

There must have been a floating-point number introduced into the computation, either explicitly or through use of evalf or a similar command. What were the steps that led to your 2.*I*q*r? This is a phenomenon called "floating-point contagion", (which makes it sound like a bug, but it it the intended behavior). Basically, the decimal points spread from number to number in your expression. To get rid of them,

subsindets(ex, float, convert, rational);

where ex is the expression that you want to correct.

You can't use subs to substitute for something that doesn't exist as a distinct entity. Notice the difference in the following two uses of subs.

restart;

ex:= (x+y)^2 + (a+b+c)^2;

(x+y)^2+(a+b+c)^2

subs(x+y= 2, ex);

4+(a+b+c)^2

subs(a+b= 2, ex);

(x+y)^2+(a+b+c)^2

To be precise about what I mean by "distinct entity" requires some knowledge of Maple's internal representations of objects.

But, we can ignore that, because there is a command that is much more sophisticated than subs, and which doesn't care about the internal representations. That command is algsubs. It only does one substitution at a time. So, to use it for your case, we need to put it into a loop.

Replace the line

Eqs1:= subs(BC, Eqs);

with

for s in BC do Eqs:= algsubs(s, Eqs) end do; Eqs1:= Eqs;

I did this in your code, and it ran through to the end, generating the point plot.

Assuming that ex is set to the expression that you want to manipulate, it can be done as

sort(-numer(-ex)/denom(ex), x);

The second argument to sort, the x, is to tell it which variable that you want to appear first.

I can show you how to do it by TypeTools if that's what you really want. But isn't this preferable?

select(has, G1, w);

Let me know.

Also, you are using the wrong quotes again, you mean 'w', not `w`. The latter does nothing to something which is already a name. As for the '[]', I doubt that that's what you really want. There's `[]`, [], and [][]. They all do different things when applied as functions.

I got 5/4*5^(m+1)/m, but that is asymptotically equivalent to your result (since the limit at infinity of their ratios is 1). I did it by integrating, getting the series for that, and then applying a correction factor.

restart;

interface(typesetting= standard): interface(prettyprint= 3):

Order:= 2:

assume(m > 0);

s:= j-> 5^j/j:

Verify that getting the asypmtotic series the normal way won't work.

S1:= sum(s(j), j= 1..m+1);

-2*ln(2)-I*Pi-25*5^m*((1/25)*LerchPhi(5, 1, m)-(1/25)/m-(1/5)/(m+1))

asympt(S1, m);

Error, (in asympt) unable to compute series

The summand s(j) is increasing for j > 1. Imagine approximating the integral of s(j) with rectangles under the curve. Then the sum S1 would represent the integral on 1..m+2. Likewise, the integral can approximate the sum.

int(s(j), j= 1..m+2);

Ei(1, -ln(5))-Ei(1, -m*ln(5)-2*ln(5))

asympt(%, m);

(25/(ln(5)*m)+O(1/m^2))*5^m

A1:= op(1,expand(%));

25*5^m/(ln(5)*m)

Estimate the error factor: that is, the factor by which the integral over the last rectangle overestimates that rectangle.

int(s(x)/s(m+1), x= m+1..m+2);

-5^(-1-m)*(m+1)*(-Ei(1, -m*ln(5)-ln(5))+Ei(1, -m*ln(5)-2*ln(5)))

asympt(%,m);

4/ln(5)+O(1/m)

Since this is asymptotic to O(1), we are justified in applying a constant correction factor A1. So, the final first term of the asymptotic series for S1 is

A:= A1/op(1,%);

(25/4)*5^m/m

Verify with a plot.

plot(S1/A, m= 30..1000);

 

Download asympt_sum_by_int.mw

First, I'll create Z and its CDF again. (CDF stands for Cumulative Distribution Function, if that helps.) But, you only need to do this once per session. This Z is the same N(0,1) as in your first problem.

Z:= Statistics:-Distribution(Normal(0,1)):

And I'll also define Φ for convenience (less to type):

Phi:= evalf@Z:-CDF:

You can use the above for all your "Z" problems.

Now, to the problem at hand. First some identities that I hope that you already know. If you don't know these, find them in your textbook and memorize them.

  1. For any random variable (r.v.) Z and any real z ≥ 0, P(|Z| > z) = P(Z > z) + P(Z < -z).
  2. For any continuous r.v. Z and any z, P(Z ≥ z) = P(Z > z), (i.e. isolated points don't matter).
  3. For any continuous r.v. Z and any z, P(Z > z) = 1 - P(Z < z).
  4. For Z ~ N(0,1) and any z, P(Z > z) = P(Z < -z) (symmetry).

Putting those together, the answer to your problem is

2*(1 - Phi(1.39));

The factor of 2 comes from applying rule 1, then rule 4. The "1 minus" comes from rule 3.

Try this for the function definition:

w:= (xi, eta, dxi, deta)-> value;

A function must be defined with pure names for the parameters. When you call the function w, then you can pass it whatever as arguments:

w(xi(t), eta(t), diff(xi(t), t), diff(eta(t), t));

 

Variable x has been assigned a value already, probably in your previous problem. One solution is to use a different variable in the integral. You could replace the three occurences of x with chi, X, or xi (or any other unused variable name).

Has Psi been assigned a value by your instructor? If it hasn't, then it's also a bad choice of name because Psi is a predefined function in Maple. It would be better to use psi instead.

I can't help you with the palettes, but if you're willing to type your commands then do

Z:= Statistics:-Distribution(Normal(0,1));
Z:-CDF(.87) - Z:-CDF(0);
evalf(%);

The following answers apply to the transcendental RootOf. The situation for the polynomial RootOf is slightly different.

Q1)  How can I evaluate the RootOf?

You can substitute values for the variables and apply commands to it just as you can with any other expression. Just don't substitute for the "with respect to" variable (the _Z). That wouldn't make sense, just like substituting a nonatomic expression for x in int(f(x), x) or solve(f(x), x) wouldn't make sense.

Q2) In other words, What is it saying?

A ?RootOf is Maple's way of expressing an inverse function (usually with multiple branches) for which it otherwise has no expression. Another way of thinking about it is that it's Maple's way of expressing an implicitly defined function (usually one with multiple branches).

Q3) Is there any way that I can get an expression without RootOf for the variable that I am solving for?

For an exact symbolic solution, generally, no, not unless you are aware of some solving technique which Maple is not using. A floating-point solution is usually possible if you supply numeric values to the parameters. In either case, you can try to apply the command ?allvalues. That is the command specifically designed for expressions containing RootOf. Especially, try to reduce the RootOf expression with allvalues if you have assigned numeric values to some of the parameters. If you've applied assumptions to some of the parameters, then try simplify.

Q4) Is there any way that I can get an analytical expression for the variable that I am solving for?

I am guessing that what you really meant by this question is what I answered in Q3 above. But I separated out this question so that I coud point out that an expression with RootOf is an analytic expression. You can generally apply to it all the Maple commands that you would apply to any other analytic expression, including diff, series, simplify.

Q5)  Or from here we can only get numerical means to solve for the variable. If so, how to proceed?

Use ?eval to supply numeric values to the parameters, then apply allvalues. At this point, you may need to select a branch. Then apply evalf. There are cases where not all branches will satisfy the original equation, so plug back into the original to check.

First, you have a small error. It has no effect for this current question, but you should fix it. The command restart must be in lowercase letters.

You could apply a DataTable to this situation, as in your previous question. But I'll show you another way. Define q[1] with a variable as one of the numeric components, and still include the units. For example, I replaced the numerator 14.6 with a variable Luftmængde. Then execute the rest of the commands. Some of them will have symbolic answers expressed in terms of Luftmængde, but the units will carry through. After the end, you can use the command

eval(P[dyn1], Luftmængde= 14.6);

Of course, you'll be able to use any number that you want.

There are many other ways to do what you want, and if the above is not satisfactory, then I can show you another.

You may have an older version of Maple. There have been some recent improvements in RealDomain. You may be able to solve your equation without using RealDomain if you first convert  it to surd form.

restart;

kernelopts(version);

`Maple 16.02, X86 64 WINDOWS, Nov 18 2012, Build ID 788210`

expr:= convert((2*x-x*sqrt(x)-1)^(1/3)+sqrt(x)+(1-2*x)^(1/3), surd);

surd(2*x-x^(3/2)-1, 3)+x^(1/2)+surd(1-2*x, 3)

solve(expr = 0, x);

0, 1, 1/2, (1/4)*(5^(1/2)+1)^2


Download surd_solve.mw

Go back to your question from one month ago, "how many routes in a 6x6 square?" Careully study the lengthy answers to that. I covered there many of the questions that are posed here, including

  1. how to represent the vertices as pairs of integers
  2. how to label the vertices with convenient two-character letter-number combinations while maintaining the underlying integer-pair representation
  3. how to create the graph in GraphTheory using the simple criterion that vertices u and v are adjacent iff LinearAlgebra:-Norm( < u - v > ) = 1
  4. how to use GraphTheory:-Departures to construct paths (words) in the graph
  5. how to plot the board and the paths (words).

It would be much quicker to start with the above base, which is already coded in the post, than to work from the Mathematica. The project is already half done. It would be nice to know that my prior work on it was not for naught.

What needs doing?

  1. Setting the distribution of letters. Counting the letters in a real Boggle game would help for this.
  2. Assigning the letters to the vertices.
  3. Dictionary lookups.
  4. Scoring. Having the actual game would help with this.
  5. Adding the letters to the plot.
First 380 381 382 383 384 385 386 Last Page 382 of 392