sand15

1648 Reputation

16 Badges

11 years, 208 days

MaplePrimes Activity


These are replies submitted by sand15

@dharr Interesting...

From wiki "entiers naturels" (which translates into "natural integer", eventually English is not that difficult) you read

whose translation is "Thus, in textbooks that include 0 among the natural numbers—which is the case in most school textbooks in France—we find the notations ...".

I was always taught 0 was the smallest natural integer and never realized that other cultures could suse other conventions.
As @Alfred_F seems to be French-speaking (maybe French) I implicitely understood 0 was a natural number... which is why I was quite surprised by the "big" solution he gives at the end of its post.

Never mind:  I "demonstrated" in my reply that there was no other solution but 'w = 0'... which is obviously wrong because this "big" solution is indeed a solution.
This prove I did some mistake in my reasoning. I will try to track it if I have some time.

Isn't {u = 2, v = 2, w = 0, x = 0, y = 2, z = 2} the smallest solution (up to an arbitrary permutation on x, y, z)? 

My point of view:

  • The set E := {x*y*z = w^2, x+y+z = u^2, x*y+x*z+y*z = v^2} of conditions can be interpreted this way:
    • Let Z(t) = t^3 + b*t^2 + c*t + d and let (x, y, z) the rootsof the equation Z(t) = 0.
    • The symetric functions of (x, y, z) are
      x+y+z = -b
      x*y+y*z+z*x = c
      x*y*z = -d
    • Thus the equation Z(t) = 0 writes 
      t^3 - u^2*t^2 + v^2*t - w^2 = 0
  • Note that by Descarte's rule of signs this 3rd degree polynom with indeterminate 't' has 3 sign chsnges and thus 3 positive roots (x, y, z)
     
  • After some algebra one can show (if i did no mistake) that one root, let's say 'x' has multiplicity 1 and that y = z, meaning the second root (let's say 'y') has multiplicity 2.
    This means Z(t)  = 0 writes
    (t-x)*(t-y)^2 = t^3 - u^2*t^2 + v^2*t - w^2
  • Let EQ this equation.
    Here are all the (u, v, w, x, y, z} solutions we get
    sol := { solve(identity(EQ, t), {x, y, u, v, w}) }:
    print~(sol):
  • Let us take w = 0 (∎).
    We get
  • The first solution is basically the trivial one you got (take u = 0)/
    Among the four other ones, only one contains no minus sign and is thus the "generator" for other solutions based on the choice w = 0.
    It is  easy to see that y = 2 (and thus  z = 2) gives the smallest, non identically null, solution I presented at the top of this reply.
    All other solutions are given by y = 2*p^2 where p is any positive number.

(∎) One might think the choice  w = 0 is arbitrary. But for other integer positive values of 'w', we need that the system

sys := {2*y^3+w^2 = p^2, y*(y^3+2*w^2) = q^2}

have integer solutions (p::posint, q::posint) in order that positive integer (x, y, u, v, w) could exist.
Multiplying sys[1] by 'y' and substractind twice sys[2] gives

-3*w^2*y = p^2*y-2*q^2

whose the only integer solution is


As you see we return to the 'w = 0' initial choice and noother value of 'w' can lead to a solution.

@acer 

Thanks for all these details.
Funny to see that you were able to see "that the conditional block of the original code... the inert representation of that original procedure ..". This doesn't seem that obvious to me at first sight, but I guess I will undoubtedly always be a bit of a DIYer when it comes to using Maple.

And to end this reply, yes, you're right writing "that if this kind of manipulation gets too involved then one might as well print the proc, copy, and edit the new version as desired".
I already did that sometimes and, after all, sparsematrixplot is quite easy rewrite or customize.

By the way, my own question was motivated by this question from  @Mac Dude.

@acer 

Great, and thanks a lot.

I use to use the gap option with matrixplot and I was disappointred not to find it for sparsematrixplot.
Your first proposal is quite “technical,” but very effective, because, but if I understand correctly, it's a fairly general method for overriding the default options of any (?) tracing procedure.

Your second one is based on the use of the sparse option in matrixplot and looks more like a trick, but a very astute one (and indeed Maple 2015 does not support this option, so it's a dead line for me).

Given I'm stuck with Maple 2015 right now I will then use your first approach.

A question: how did you end writting this

`plots/sparsematrixplot` := FromInert(
    subsop(
      [5,3]=[
              op([5,3], ToInert(eval(`plots/sparsematrixplot`)))
              ,_Inert_STATSEQ(_Inert_ASSIGN(_Inert_LOCAL(8), _Inert_FLOAT(_Inert_INTPOS(0), _Inert_INTPOS(0))))
            ][]
            ,ToInert(eval(`plots/sparsematrixplot`))
   )
):

?
This is all but trivial to find and writting

showstat(`plots/sparsematrixplot`)

didn't help me to understand your  intellectual journey.

Thanks again

@Mac Dude 

Meanwhile here is slight variant of my Histogram3D procedure described in my previous reply (usable for both dependent and independent random variables).

I also included a new feature to draw the equivalent of what plots:-densityplot does for functions. The code is very simple but strongly benefits from @acer's help, see HERE.

NOTE: In my code (I forgot to mention it uses Maple 2015) I used the first method acer proposed (in the code below his piece of code is reproduced in green highlighted b
lue font: it should be easy for you to locate it and replace it by one of the other solutions acer proposed, depending on your Maple version).

3DHist_3DDensity_2.mw



As I told you before one can get far better rendering for both the histogram and, in case this would interest you, the density plot.
But doing so requires some time to develop a proper code based upon PLOT/POLYGONS and/or plottools built-in functions. The plots:-matrixplot I used is a quick shortcut to drax the histogram you have in mind, but it is versatile enough to produce pretty outputs.
The same observationholds for plots:-sparsematrixplot as a workaround to a "discrete" plots:-densityplot.

To jump on your initial remark "I could of course program one myself, but as I am lazy and this seems like a common kind of plot (at least in statistics and in physics), someone may well have done such a thing. DDG search did not find anything, at least not wrt. Maple."
I'm sure you can and I understand your reluctance to do it.
And yes, it's a very common plot in Statistics and that's unfortunate Maple doesn't offer any feature to draw 3D histograms and density plotof a cloud of points (as a lot of other languages do).


This is the kind of result you can obtain using an Histogram3D procedure based upon plottools:
3DHist_using_plottools.mw

@Mac Dude

Code: 3DHist_dependent.mw

Scatterplot of a sample drawn from a couple ofdependent random variables:
 
3D histogram of this same sample

Watchout: I assumed xvec and yvec are samples of two independent random variables X and Y

In my initial answer the procedure Histogram3D might produce an error when xtally or ytally were sparse (meaning for instance that some indices did not existed in one or two of these tables).
The new Histogram3D procedure in worksheet 3DHist_robustified.mw accounts for this situation (see text in [courier black] font).

Example 
             3D histogram over a 30-by-30 grid                                     sparse structure of the 30-by-30 grid

@dharr 

It works for me (Mac OSX, Firefox).
Maybe you could try this one  https://arxiv.org/abs/2111.03817
The one in my comment is      https://arxiv.org/pdf/2111.03817

@Alfred_F 

The largest octahedron (up to some symmetries) is necessarily the octahedron whose the base is the largest square S  contained in the cube.
From Prince Rupert's cube (Prince Rupert of the Rhine 1619-1682) is "the largest cube that can pass through a hole cut through a unit cube without splitting it into separate pieces". This is thus the cube which passes through the square hole S.

The solution, as those of several other Prince Rupert's passages, can be found in Bezdek, Guan, Huojter and Joos: S is a square of side length  a = 3*sqrt(2)/4.
The volume V = sqrt(2)/2*a3 of the largest octahedron is thus V = 9/16.

@dharr 
Given this property of the largest octahedron you could probably simplify your code by searching this mximal square S instead of the octahedron.
Not long ago Kitonum published this post on a closely similar problem.

@C_R 

What I get.
Which is obviously not an answer to your initial question, simply my observing what happens with an older maple version.

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

one := ``(1);

``(1)

(2)

lprint(%)

``(1)

 

lprint((2))

``(1)

 

lprint(one)

``(1)

 

one;
lprint('%')

``(1)

 

``(1)

 

one;
lprint(`%`)

``(1)

 

``(1)

 

 

``(1)

``(1)

(3)

lprint(%)

``(1)

 

one := ``(1)

``(1)

(4)

lprint(%)

``(1)

 

Download With_Maple_2015_loaded_with_Maple_2026_reloaded_with_Maple_2015.mw

With_Maple_2015.mw

(file can be uploaded)

There exists an infinity of "triangle spirals" (look here  for instance) and without more information it is impossble to go futher on.
If I'm not mistaken you speak French, so you can also look to this issue of the APMEP journal (Théodore's spirals).

So you have to provide us the the transformation which defines a triangle given its predecessor and 
the intitial triangle.

By the way, you write  "I am looking to improve my animation..." which, I guess, mean that you already wrote some Maple code? It would be helpful if you could upload it.

@WD0HHU 


Change

dM1 := diff~(dM1, [a, c, d]);

into

dM1 := diff~(M1, [a, c, d]);

 

@WD0HHU 

Use the big green up arrow in the menubar to upload your worksheet (mw file).
Be careful, the name of mile must not contain special characters to be uploaded.

@WD0HHU 

Are the outputs of dM1 in your worksheet and mine (Maple 2015) the same?

If it is so try to replace this

Sol := solve(%, [a, c, d]):

by this

Sol := solve(dM1, [a, c, d]);

and tell me what you get.
Idealy upload your worksheet and send it to me.

1 2 3 4 5 6 7 Last Page 2 of 42