Kitonum

12851 Reputation

18 Badges

10 years, 316 days

MaplePrimes Activity


These are answers submitted by Kitonum

A:=<a,b; c,d>;
B:=<e, f>;
<A | B>; 

 

I have not found another solution to the problem than using  InertForm  package:

restart;
with(InertForm):
plots:-textplot([1,1,Typeset(Parse("Pi/6"))]);

 

csgn(x^2) assuming real;

  Output:  1                       

f:=x->3*x^2+1:
Matrix([seq([x,f(x)], x=1..3.5,0.5)]);

 

Another way is to turn  x(t)  into a name using oblique quotes:

restart;
f:= 2*`x(t)`+5;
diff(f, `x(t)`);

You can simplify the equation  eq  significantly if you run

simplify(eq) assuming h>0;

        

@ms0439883 
Here is a simple recursive procedure that solves your problem for any  n  and  k . It does not use any packages, only commands from the Maple core.


 

restart;
P:=proc(n, k)
option remember;
if k=1 then return [[n]] else if k=n then return [[1$n]] else
[seq(map(t->[t[],i], select(r->r[-1]<=i,P(n-i,k-1)))[], i=n-k+1..ceil(n/k), -1)] fi; fi;
end proc:

# Examples of use
P(10,2);
P(10,4);
P(20,4);

[[1, 9], [2, 8], [3, 7], [4, 6], [5, 5]]

 

[[1, 1, 1, 7], [1, 1, 2, 6], [1, 1, 3, 5], [1, 2, 2, 5], [1, 1, 4, 4], [1, 2, 3, 4], [2, 2, 2, 4], [1, 3, 3, 3], [2, 2, 3, 3]]

 

[[1, 1, 1, 17], [1, 1, 2, 16], [1, 1, 3, 15], [1, 2, 2, 15], [1, 1, 4, 14], [1, 2, 3, 14], [2, 2, 2, 14], [1, 1, 5, 13], [1, 2, 4, 13], [1, 3, 3, 13], [2, 2, 3, 13], [1, 1, 6, 12], [1, 2, 5, 12], [1, 3, 4, 12], [2, 2, 4, 12], [2, 3, 3, 12], [1, 1, 7, 11], [1, 2, 6, 11], [1, 3, 5, 11], [2, 2, 5, 11], [1, 4, 4, 11], [2, 3, 4, 11], [3, 3, 3, 11], [1, 1, 8, 10], [1, 2, 7, 10], [1, 3, 6, 10], [2, 2, 6, 10], [1, 4, 5, 10], [2, 3, 5, 10], [2, 4, 4, 10], [3, 3, 4, 10], [1, 1, 9, 9], [1, 2, 8, 9], [1, 3, 7, 9], [2, 2, 7, 9], [1, 4, 6, 9], [2, 3, 6, 9], [1, 5, 5, 9], [2, 4, 5, 9], [3, 3, 5, 9], [3, 4, 4, 9], [1, 3, 8, 8], [2, 2, 8, 8], [1, 4, 7, 8], [2, 3, 7, 8], [1, 5, 6, 8], [2, 4, 6, 8], [3, 3, 6, 8], [2, 5, 5, 8], [3, 4, 5, 8], [4, 4, 4, 8], [1, 5, 7, 7], [2, 4, 7, 7], [3, 3, 7, 7], [1, 6, 6, 7], [2, 5, 6, 7], [3, 4, 6, 7], [3, 5, 5, 7], [4, 4, 5, 7], [2, 6, 6, 6], [3, 5, 6, 6], [4, 4, 6, 6], [4, 5, 5, 6], [5, 5, 5, 5]]

(1)

 


 

Download proc.mw

Look at this post  https://www.mapleprimes.com/posts/200677-Partition-Of-An-Integer-With-Restrictions , which presents the  Partition  procedure. The procedure solves a variety of problems associated with partition of an integer, in particular partition with different restrictions.

After the loading  screen appears, open the task manager, then the details, then 2 times destroy the process whose name begins with  jogamp_...

restart; 
f := (x,y)->x+y ; 
f2 :=  (x,y)->x^2+y^3 ; 
f3 := f+f2; 
f3(x,y); 
f3(5,10);

 

Replace the last line with

plots:-odeplot(sol, [[t, B(t)], [t, L(t)], [t, S(t)]], t = 0 .. .3, color = [red, blue, green], legend = [B(t), L(t), S(t)], labels = [t, ``]);

 

factor(algsubs(8*k + 2=t^2, f)) assuming t>0;
subs(t=sqrt(8*k + 2), %);

 

A simple procedure  P  allows you to create the matrix  M  for any number  N :

restart;
P:=(N::posint)->Matrix(N+1, {seq((i,i+1)=i, i=1..N)}):


Example of use:

P(9);

You can use a set of any symbols (even spaces) as a name if you surround it with slanting quotes. Many years ago, I wrote a procedure to automatically check the work of my students, in which  chi^2 (Pearson's test) was used as a name. See examples below:

chi^2:=5;
`chi^2`:=5;
`My name`:=Yury;

      


See help on  ?Names  for details.

Here is 2 options to draw - in a for loop and as a table:

restart;
with(GraphTheory):
Graphs_data3:=[NonIsomorphicGraphs(6,restrictto =[connected], output
= graphs, outputform =graph)]:
Diameter2_select:=select[flatten](t->Diameter(t)=2,Graphs_data3):
nops(%);
for G in Diameter2_select do
DrawGraph(G);
od;
plots:-display(Matrix(12,5, [seq(DrawGraph(Diameter2_select[i]), i=1..59),plot(NULL, axes=none)]));
                               

 

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