Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 34 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Christopher2222 wrote:

  • What value could someone get out of determining that a dataset contains two particular distributions?

Well, for example, if you were to sample the heights of a population of adult humans, you'd likely find that the data were not normally distributed, which may be contrary to your expectation. Why? It's because of the different distributions of the heights of men and women. A computer analysis of the dataset could show that it's a combination of two normal distributions.

@Christopher2222 Your method has this flaw:

has(ifactor(2^7), 7);

      true

It's also extremely inefficient compared to the other methods. Compare using
n:= nextprime(2^(2^6))*nextprime(2^(2^7)).

What does it mean to "solve" a derivative?

@taro I'm having a bit of trouble understanding your English. The word "could" makes no sense to me in this context.

Regarding the effect of restart: If the random order of things is based on the explicit use of the random number generator, then restart will cause the same order to be used. However, if the random order is based on the memory addresses where things are stored, then restart won't fix the order.

It may be possible to enforce a certain order of the parts of an expression by using sort, but I have tried this several times before, and although it is possible, I decided that it wasn't worth the effort.

@roman_pearce By what algorithm do you expect to get a 30-fold improvement? I can get a 7-8-fold improvement with chrem. I don't know a better algorithm than that.

restart:

n:= 100:

A:= Matrix((n$2), ()-> rand(), order= C_order):

#Naive method:
CodeTools:-Usage(1/A):
memory used=5.68GiB, alloc change=164.00MiB, cpu time=78.91s, real time=77.12s, gc time=3.44s
#Use casting to select the method:
CodeTools:-Usage(1/Matrix(A, datatype= integer)):
memory used=5.46GiB, alloc change=360.00MiB, cpu time=14.78s, real time=12.78s, gc time=2.95s
#My best quick attempt at a faster integer inverse:
IntInv:= (A::Matrix(square, integer))-> 
   (n-> LinearAlgebra:-Modular:-IntegerLinearSolve(
      <A | LinearAlgebra:-IdentityMatrix(n)>, n, _rest
   ))
      (op([1,1], A), _rest)
:
CodeTools:-Usage(IntInv(A)):
memory used=1.57GiB, alloc change=0 bytes, cpu time=25.89s, real time=24.38s, gc time=2.08s
CodeTools:-Usage(IntInv(A, method= chrem)):
memory used=1.84GiB, alloc change=0 bytes, cpu time=13.16s, real time=10.25s, gc time=3.75s

 

@YasH How can one use your function and also effectively use plot option discont; i.e., how can one avoid the vertical lines at the discontinuities? There seems to be a subtle distinction---which I can't yet make precise---between functions for which discont will work and those for which it won't. I can't make it work with your function.

Another thing that I like about the new editor is that I can copy-and-paste plots direct from a worksheet. That's much easier than uploading a file.

@nika The chi-squared test won't tell you a suitable distribution. It'll only tell you whether or not the normal distribution is suitable. If the test fails, it tells you nothing.

@vahid65 How about

plots:-animate(
    plots:-polarplot,
    [[[r, 0, r= 0..1], [r, 9*Pi/4*k/50, r= 0..1]], color= magenta],
    k= 0..50, thickness= 6
);

@Mihrab Oops, I changed the parentheses from your original. My command should've been

plot([seq(-arctan(2*m*x/(1-x^2)), m= 1..10)], x= 0..10, discont);

@tomleslie You're right that I was too quick to say that those were the first 10.

@ETM1697 So, does f[x] mean the derivative of f with respect to x?

The comment below pertains to the originally posted form of the equations:

Your formulas are not clear enough. Obviously, they weren't given to you in the form above in your instructions. Please use square brackets to indicate subscripting, for example, the left side of the first equation almost certainly should be x[i+1]. I think that you're missing paretheses also. And why do you have both asterisks and centered dots? Do they both represent multiplication?

@Joe Riel I think that what he wants is a programmatic control so that his program's output appears in an otherwise empty window. Unless his output is strictly a plot, this'll require either some sort of embedded component or a Maplet.

All of your functions are functions of a single variable, so it's not clear what you mean by 3D. They could be done as a single 2D plot if you want.

First 375 376 377 378 379 380 381 Last Page 377 of 709