Kitonum

20084 Reputation

26 Badges

17 years, 22 days

MaplePrimes Activity


These are replies submitted by Kitonum

@brian bovril  In total there will be 2592 examples under such conditions. Below are some examples of these:

restart:
TA := [A, B, C]:
TB := [X, Y, Z]:
n:=nops(TA):
L:=convert(Matrix(n, (i,j)->[TA[i],TB[j]]), list):
P:=combinat:-permute(L):
k:=0:
for p in P do
if `and`(seq(nops({p[i][],p[i+1][],p[i+2][]})=6, i=1..nops(L)-2, 3)) then k:=k+1; M[k]:=p fi; 
od:
M:=convert(M, list):
k;
for i from 1 to k by 300 do
print(M[i]);
od:  

                  

@brian bovril  But in your example this condition is not met:

                             [[A,X], [B,Y],[C,Z],[B,X], [A,Z], [C,Y],[B,Z],[C,X], [A,Y]]
 

This is basically impossible, as a slight modification of the code from my answer above shows:

restart:
TA := [A, B, C]:
TB := [X, Y, Z]:
n:=nops(TA):
L:=convert(Matrix(n, (i,j)->[TA[i],TB[j]]), list):
P:=combinat:-permute(L):
k:=0:
for p in P do
if `and`(seq(nops({p[i][],p[i+1][],p[i+2][]})=6, i=1..nops(L)-2)) then k:=k+1; 
print(p) fi;
od:
k;  

                                                                     0
                        

@bstuan  Maple is not needed for the solution. We make the change  x=t+3/2  and use the fact that the integral of an odd function over a symmetric (with respect to the origin) interval is equal to 0:

int(x*f(x), x=1..2) = int((t+3/2)*f(t+3/2), t=-1/2..1/2) = int(t*f(t+3/2),  t=-1/2..1/2) + 3/2*int(f(t+3/2), t=-1/2..1/2) = 0 + (3/2)*4 = 6

The function g(t) = t*f(t+3/2)  is odd.

@ommy03  See my procedure at the link above for plotting a triangle given the lengths of three sides.

@bstuan The problem with the changed point  M  also has no solutions, because the distance from M to the line is less than 3:

restart;
with(geom3d):
point(P1,[1,0,3]): point(P2,[1,0,3]+[-1,1,2]):
line(l,[P1,P2]):
point(M,[1,0,2]):
distance(M,l);
evalf(%);

                                         0 .5773502693

@logan35  I have already answered you what needs to be corrected in your 2 "for" loops program. Your program is a little strange. Because  N[i,j]  depends only on  i , it turns out that all students in each individual exam receive the same marks.

@logan35  You don't seem to understand the meaning of my answer. The procedure named  Mean  is the shortest way to find the average of any sequence of numbers. This is the program that answers the question posed in the title of your question. Your program with 2 nested loops finds the average for a particular sequence of numbers. It will work correctly if you replace the line  numb:=numb+i  with the line  numb:=numb+1 .  But with the procedure  Mean , the same is  solved much easier and shorter:

Mean:=proc() `+`(args)/nargs; end proc:
S:=seq(seq(20*i, i=1..3), j=1..5);
Mean(S);

         S := 20, 40, 60, 20, 40, 60, 20, 40, 60, 20, 40, 60, 20, 40, 60
                                                     40

 

@Mariusz Iwaniuk  I think you understand perfectly well that from the standpoint of rigorous mathematics, no finite number of terms (even 1,000,000 ones) is a proof.

@lcz  I don't know this proof.

@Mariusz Iwaniuk  Your solution uses the first few terms of the sequence  [k, f(k)] . But it does not prove that this will be true for any  k . The same result can be obtained using the first   values, since the polynomial of degree  <=n  is uniquely found of values at  n+1 points:

restart;
f := k -> sum((-1)^i*(k - i + 1)^(2*k + 4)/(i!*(2*k - i + 2)!), i = 0 .. k);
L := [seq([k,f(k)], k = 0 .. 3)];
factor(CurveFitting:-PolynomialInterpolation(L, k));

@bstuan  I am using Maple 2018.2. You didn't specify which version of Maple you are using. This can be seen from the picture you provided, your Maple is missing one solution. This is reason for the error message, because you can't link to the second solution. So to find the missing solution try the other code below where I added another system where  cos(Pi/4)  is replaced with cos(3*Pi/4) :

restart:
local D:
np:=<A,B,C>: nq:=<1,-1,0>: P:=A*x+B*y+C*z+D=0: M:=[1,0,0]: N:=[0,0,-1]:
Eq1:=eval(P,[x,y,z]=~M);
Eq2:=eval(P,[x,y,z]=~N);
Eq31:=(np.nq)/sqrt(np.np)/sqrt(nq.nq)=cos(Pi/4) assuming real;
Eq32:=(np.nq)/sqrt(np.np)/sqrt(nq.nq)=cos(3*Pi/4) assuming real;
Sol1:=solve({Eq1,Eq2,Eq31});
Sol2:=solve({Eq1,Eq2,Eq32});
simplify(eval(P,Sol1)/B); # The first solution
simplify(eval(P,Sol2)/B); # The second solution


 

Here is another way to draw a similar curve using parametric equations. This method makes it easy to animate this curve:

plots:-animate(plot,[[sin(t)^3, 13*cos(t)/15-cos(2*t)/3-2*cos(3*t)/15-cos(4*t)/15, t = -Pi .. a], color=red, thickness=3, scaling=constrained], a=-Pi..Pi, frames=90, axes=none, paraminfo=false);

                     

 

@JAMET  But you have already received instructions from  vv  on what to do so that there is no confusion between  parabola and ellipse.

@bstuan Submit your code here (as text not an image) or upload your worksheet here. You may have forgotten to download the LinearAlgebra package when using the  CrossProduct  command. Should be the  LinearAlgebra:- CrossProduct  command. 

@vv  For these examples, the  expand command does the work. But everyone would like the simplify command to do the same.

expand(tan(x+k*Pi))    assuming   k::integer;
expand(sin(x+2*k*Pi)) assuming   k::integer;

 

3 4 5 6 7 8 9 Last Page 5 of 126