Carl Love

Carl Love

28035 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@mlog In your summary of VV's Answer, your point (3) is "get the normalization coefficient with the use of simplify(convert(f, rational))". That's not correct. That command is what accomplishes your point (2). The command that VV used to get the normalization coefficient is denom, which extracts the denominator of an expression, which is not necessarily purely numeric. So the general case could possibly involve many more steps to get down to a number.

@Adam Ledger Those curly braces, in this context, mean the same thing as parentheses.

You must never numerically evaluate the expression inside the O as part of numerically evaluating the expression that contains the O. That's because the O is "hiding" a constant coefficient. Without knowing that coefficient, numeric evaluation is meaningless. And almost always when you see a formula like that, the author doesn't know the coefficient either.

You can sometimes do some experimental mathematics to estimate the coefficient. If you have a formula f(n) = g(n) + O(h(n)), and you have some way (perhaps expensive) to also compute f(n) exactly, then compute

abs(f(k) - g(k))/h(k)

for some large number of values of k. Some statistical analysis of that, perhaps just a scatterplot, may reveal an estimate of the coefficient. I suggest that you try this.

Here's a procedure to numerically evaluate that formula:

Cesaro_ithprime:= proc(k::posint)
description `An approximation to ithprime(k)`;
local L:= ln(k), L2:= ln(L);
   round(k*(L+L2-1+(L2-2)/L-(L2^2-6*L2+11)/2/L^2))
end proc:

This little code snippet (below) will tell you the largest rank k that ithprime has stored knowledge about. Calling ithprime(K) for K > > k will get unbearably slow due an idiosyncracy of Maple's handling of lists.

max(rhs~(op(op(4,eval(`ithprime/large`)))));
      22299999

I discussed and analyzed this extensively in another thread a few days ago. The Questioner was David Sycamore.

@Adam Ledger If you call frac(ex) where ex is some exact expression (no floats), you get back ex - M where M is some integer. This expression is what is passed to evalf; neither frac nor `evalf/frac` are involved anymore. As in well known, computing the decimal approximation of the difference of two large quantities of nearly equal magnitude requires a significant increase in Digits. I am working on a solution.

@rahinui Thanks. I can download and easily work with that file. I'll be posting an Answer to your Question in a few minutes.

Also, I can confirm now that the .maple file extension is meant to apply to workbooks, which are a kind of superset of worksheets.

@Markiyan Hirnyk The question remains for me for all of these plots (including your very strange initial plot): Is it just the line b = 4*p? I haven't yet tried to prove/disprove that. I would need to simplify to get around a divide-by-zero.

@Adam Ledger Functions that appear inside O(...) or o(...) (and the related order/asymptotic symbols) should be:

  1. in some sense simpler, or at least simpler to compute, than the function being approximated;
  2. eventually positive;
  3. eventually strictly monotonic;
  4. eventually analytic;
  5. have no coefficient (or perhaps we should say that the coefficient is 1 or -1).

(Those are my own criteria; I haven't read all those rules anywhere.) Rule 2 is required by the definitions of the Bachmann-Landau symbols. Usually having of 3 and 4 imply 1. Violating Rule 5 would make your writing look ridiculous to anyone who understands O, etc. We could violate the rules (other than 2) and still satisfy the definitions. But is there ever a good reason to do so? I think not. If we can satisfy 2, 3, 4, and 5, then I'm willing to call it a "generic" function. Good/common candidates are n^p, ln(n)^p, n! (or GAMMA), n^n, e^n (for any real constant p) or any products of those. That's by no means a complete list.

Sometimes those are given with a small range of values for the p. In those cases, one can often publish a paper if one can simply narrow the range. I've seen publishable results that narrow the range in the 7th decimal place![1] In the linked paper, the author reduces the asymptotic time complexity of a matrix-multiplication algotithm for two n x n matrices from O(n2.3728642) to O(n2.3728639). See the Wikipedia article "Coppersmith-Winograd algorithm".

You should also read the Wikipedia articles "big O notation" and "Computational complexity of mathematical operations".

[1] Le Gall, François (2014), "Powers of tensors and fast matrix multiplication", Proceedings of the 39th International Symposium on Symbolic and Algebraic Computation (ISSAC 2014), arXiv:1401.7714

@Markiyan Hirnyk Here is my understanding of VV's Answer. Of course, we must ask if it is possible to obtain his parameterization somewhat automatically with Maple.

#This is the lhs of your plotted equation:
F:= unapply(sqrt(b)*sqrt(1-4*p/b)-2*arctan(sqrt((9*p/b-22201/10000)/(9/4-9*p/b))), (b,p)):
#This is VV's parameterization:
P:=5625*t^2*tan((1/2)*t)^2*(1/299)+22201*t^2*(1/1196): # 0 < t < Pi
#By plotting P vs. 4*P+t^2, he's implicitly claiming that 
#F(4*P+t^2, P) = 0 assuming 0 < t, t < Pi
#Let's verify that.

#I needed to restrict to t < Pi/2 to make progress:
zero:= simplify(F(4*P+t^2, P)) assuming 0 < t, t < Pi/2;
                           /              (1/2)\    
                           |/       2    \     |    
                           |\-cos(t)  + 1/     |    
            zero := -arctan|-------------------| + t
                           \      cos(t)       /    
simplify(convert(zero, tan)) assuming 0 < t, t < Pi/2;
                               0
#For t in the 2nd quadrant, it appears to be not true: 
simplify(convert(zero, tan)) assuming Pi/2 < t, t < Pi;
                             /sin(t)\    
                      -arctan|------| + t
                             \cos(t)/    
#A good pre-calculus student should be able to simplify the above
#to Pi, but Maple can't!
plot(%, t= Pi/2+0.01..Pi);

@vv add has special evaluation rules; sum has the same evaluation as the vast, vast majority of Maple commands: evaluate first, then pass. It's just that that seems "special" for sum because it's usually add's evaluation rules that are desired.

@das1404 Thanks, I like it! These can be nice as electronic greeting cards.

Some possibilities for improvement:

  1. I think the left upright of the R should be thicker.
  2. The football should start smaller than it currently starts.
  3. The football should end larger than it currently ends.
  4. Speed up the transformation of the Y. It should be fully upright by the time that the football reaches it and stay fixed that way until the end.

@vv VV, I was trying to give Adam some gentle guidance and instruction in asymptotics, Bachmann-Landau notation, and "experimental mathematics with Maple" by using the function that he's interested in. If that function turns out to be not very interesting, that's not very relevant to me; there's still value in the instruction itself.

Adam, regression coeffiecients tend to become unstable when we know that one of them "is supposed to be" a certain value, especially if it's a coefficient of a high-order term. Let's accept that the coefficient of n is 1. Now we go for a second asymptotic term, a2(n). So, we want to find a2(n) such that (f(n) - a1(n)) ~ a2(n) and limit(a2(n)/a1(n), n= infinity) = 0.[1] (And we'd strongly prefer that a2(n) be eventually monotonic and analytic.) You may use regression or other experimental mathematics to explore this: Perhaps try a2(n) = A*sqrt(n) + B or A*ln(n) + B or A*log[2](n)+B. And perhaps the second term is too erratic to classify this way, in which case we'd at least like an upper bound for abs(n - f(n)).

[1] This latter limit is usually expressed as a2(n) = o(a1(n)). That's little-o, not big-O.

@rahinui That's interesting that .mpl is not listed as valid by MaplePrimes. I would change the extension to .txt, which is listed as valid. I don't know what .maple is supposed to represent (perhaps the new workbooks, collections of worksheets?)

And now that I know that you were trying to upload a .mpl, please do upload it as a .txt, because the .mw is giving me some trouble.

@Adam Ledger Your notation with the ~ is correct: The statements "a1(n) is the 1st term of the asymtotic expansion (or series) of f(n)" and "limit(f(n)/a1(n), n= infinity) = 1" are both often abbreviated f(n) ~ a1(n). (Although I'm not yet prepared to say that your statement (1) is a rigorously proven theorem!)

In your statement (2), you've correctly used the big-O. However, if (1) is true, then (2) is ridiculously redundant. Indeed, if there exists any positive constant C such that limit(f(n)/a1(n), n= infinity) = C, then we could write f(n) = O(a1(n)); whereas statement (1) says that C = 1, exactly.

@minhthien2016 I anticipated this complication, (yet I gave Kitonum's Answer a Vote Up anyway). Here's an adjustment that'll guarantee that they come in the correct order (even if there's more than two extrema):

restart;
f:= x-> (4*cos(x)+sin(x))/(-2*cos(x)+sin(x)+3);
ex:= simplify(rationalize([extrema(f(x), {}, x)[]]));
(Min,Max):= ex[[(min[index],max[index])(evalf(ex))]][];
evalf([Min,Max]);

 

@das1404 Don't use a macro for that. Use a procedure, such as

Col2:= ()-> 'color' = 'COLOR'('RGB', 'evalf[8](rand()/10.^12)' $ 3);

I'm having trouble downloading your file. That may be due to the .maple file extension. Can you upload a (Standard) Maple worksheet with .mw extension?

First 326 327 328 329 330 331 332 Last Page 328 of 708