Felipe_123

45 Reputation

3 Badges

3 years, 356 days

MaplePrimes Activity


These are questions asked by Felipe_123

Hello friends, I have the following problem:
I have two lists of vectors, L1 and L2. The lists have the same number of vectors, and all the vectors have the same length.
I need to check if there is a permutation that, when applied to all the elements of one list, will obtain all the elements of the other list. For example, consider the following lists :

L1:=[<0|0|0>,<2|1|2>,<1|2|1>];
L2:=[<1|1|2>,<2|2|1>,<0|0|0>];

In this example the vectors are of length 3. Therefore, there are 3!=6 possible permutations. Namely:

P1:=<<1,0,0>|<0,1,0>|<0,0,1>>;
P2:=<<0,1,0>|<0,0,1>|<1,0,0>>;
P3:=<<0,0,1>|<1,0,0>|<0,1,0>>;
P4:=<<0,0,1>|<0,1,0>|<1,0,0>>;
P5:=<<0,1,0>|<1,0,0>|<0,0,1>>;
P6:=<<1,0,0>|<0,0,1>|<0,1,0>>;

In this case there are two permutations that satisfy the condition above, namely:

P3:=<<0,0,1>|<1,0,0>|<0,1,0>>;
P6:=<<1,0,0>|<0,0,1>|<0,1,0>>;

Cause

for i in L1 do Multiply(i, P3) end do;
>[0 0 0]
  [2 2 1]
  [1 1 2]
 
The same result is obtained using the permutation P6.
I'm working with larger lists and longer vectors so I'm looking for a quick way to check this. Thanks for your valuable help.

Hi friends, I have a problem. From a given number 'k' I want to generate a string 's' with the first naturals before the number k. Like this:

k := 5;

s := "01234";

I want to use the above in the following command:

(parse~@Vector[row]@StringTools:-Explode)~(StringTools:-Generate(k,s));

Thank you.

 

Hi friends, I have a set of polynomials, 'a', and I want to calculate the product of all possible combinations by taking 3 elements at a time. Like this:


a := {x+1,x+2,x^2+1,x^2+x+2}
a[1]*a[2]*a[3]
a[1]*a[2]*a[4]
a[1]*a[3]*a[4]
a[2]*a[3]*a[4]

I have a larger 'a' set so I was looking for a simple method to perform these operations.
Thank you.

Hello friends,

I'm trying to get the exact result from the following operation:

I'm getting:

for i=0,

for i=1,

for i=2,

I want to get:

for i=0, 1

for i=1, -1/2 + sqrt(3)/2 i

for i=2, -1/2 - sqrt(3)/2 i

Thanks for the light.

Hello friends,

I have an image in black and white and I wanted to compute and plot the intensity distribution histogram of it. So I did it with the command PlotHistogram, here's the output:

> PlotHistogram(Lena, 256)

I established the number of buckets to 256 but I don't see them at the x-asis, and I would like to see them for clarity as I don't understand the scale that is used by default. Could you help me achieve this and maybe also understand the scale used by default?

Thanks a lot.

1 2 Page 1 of 2