## Find repetitions in a list...

I have to generate a random list of 30 elements and i have two variables: s, which is a counter for all the list which have got at least a repetition and variable n, for each list who has not repeated values, as in the code below.

I don't understand why, when i sum s and m i get a value which is not 100, why?

```for i by 1 to 100 do
list:=RandomTools[Generate](list(integer(range = 1 .. 365), 30));
if numelems(FindRepetitions(lista)) >= 1 then
s:=s+1;

else		n:=n+1;

end if;
end do;```

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

 >
 >
 >
 >
 (1)
 >
 >
 (2)

 (3)

 >

 >
 >
 >
 >
 >

## Properties of functions and simplifications...

Hi all,

I'am new to Maple and have some very basic questions. Maple can figure out that the exponential is positive.

> is(exp(x)>0) assuming x::real;
true

But it cannot figure out that a sum of exponentials is positive too:

> is(sum(exp(x*i),i=1..N)>0) assuming x::real,N::integer,N>1;
FAIL

What am I doing wrong? Moreover, what's wrong with this statement:

> is(ln(a+b)-ln(a)=ln(1-b/a)) assuming a::real,b::real,a>0,b>0,b<a;
FAIL

Finally, is there a way to declare a generic fuction f and assume that its image is always a positive real?

Thanks

Nico

## How to find a linear parameter within a matrix by ...

Pay attention to the Next Question

## Nested loops and matrix...

I have to find which column of a matrix contains repeated elements, i have done it in this but i'm afraid that the nested loops don't run correctly:

```for j by 1 to 10 do
for i by 1 to 30 do
h:=Dati[i,j];
for x by 1 to 30 do

if Dati[x,j] = h then
if x <> i then
return j;
end if;
end if;
end do;
end do;
end do;```

## Can't get an analytical solution, only numeric wit...

PDE := diff(u(x, t), t\$2) = (1/16)*(diff(u(x, t), x\$2))-(1/5)*(diff(u(x, t), t)); IBCs := u(x, 0) = x*(1-(1/2)*x), (D[2](u))(x, 0) = x*(1-(1/2)*x), u(0, t) = 0, (D[1](u))(1, t) = 0; Sol := pdsolve({IBCs, PDE}, HINT = f(x)*g(t)); Sol := subs(op([2, 2, 1], Sol) = n, Sol)

I thought that the addition of HINT wolud help but no.

The numeric solution gives the right answer but the analytical gives way too small numbers and wrong shape.

## Best way to modify this script to sum over certain...

I have a list of coefficients each assigned a triple of indices. E.g. CF_{x,y,z}. These indicies are also able to take other values between +-2. E.g. CF_{x+2,y-1,z} or CF_{x,y-2,z+1} as examples. I have a working loop that cycles through the list of these coefficients and I am able to call a particular one by specifying the triple of indicies. This script has been attached:

triple_index_script.mw

I would like to modify this script to have more control over single indexes. As an example, say I want to add up all the coefficients which have z as a subscript (so not z+1,z-2 etc...) and I don't care what the x and y subscripts are; I want to be able to call that sum using the same notation in the script but with a single index. e.g. (using a new example function called RR_MapZ):

```RR_MapZ[0]; ## This would return the sum of all coefficients that had z in their subscript
```

and this would return the sum of all the coefficients which have subscript Z. If I wanted to add up all the coefficients which had index Z+1 I would do:

```RR_MapN[1]; ## This would return the sum of all coefficients that had z+1 in their subscript
```

What would be the most efficient way to do this?

-Yeti

## Inverse CDF of the Standard Normal Distribution...

Is there a command in Maple to produce a table of z values given F(z) where F is the CDF of the Standard Normal Distribution? I know of the command ProbabilityTable to generate a table of z, F(z) values.  What I would really like is F, Inv(F) table of values. I guess  I could write my own code to do this but was wondering if there is an easier way to do this.

## Matrix and lists...

How can i convert each column of a matrix(30X10) in a list?

## Error in matrix multiplication...

Hi everybody

In the attached file, when I run the code an error appears while calculating "omegaL1" parameter. The dimensions of the matrices are correct but the source of error is unknown to me. Can anyone help me?

## Repetition (for Statement)...

```a=100
b=10

1)c=a-b
2)d=c*2-k2; k2=(b*2)
3)e=d*2-k3;k3=k2*2
4)f=e*2-k4;k4=k3*2
30) (...)
z=c+d+e+f+(...)
z=?
```

I need a for Statement that calculates this mathematical sequence.

Thanks

## subs based on a variable...

I'm trying to use subs to substitute an unknown variable with a number in a Matrix

My Matrix is called values and I have the following

change := f2:

subs(change = 5, values):

This does nothing but when I have the following, it works as expected (All f2 in the Matrix values are replaced with 5)

subs(f2,values):

I'm wondering if its trying to find and replace 'change'. If this is the case how can I get it to use whats assigned to the variable. (I've tried eval(change) but that doesn't work either)

Many thanks

## How to prove a quadratic expression is positive...

Hi everybody,

Here is a very simple question :
I have two strictly positive reals r and s and the expression
a := r^2 – r*s + s^2
Obviously a is strictly positive too

But I’m not capable to prove this with Maple (2016, Windows 7), even after having declared r and s both positive which, I thought, would have prevent Maple to consider them as potentially complex.
I failed in using "is", "coulditbe", "use RealDomain ..." and so on

Totally distressed I tried to do something simpler ... which ultimately appeared still more upsetting

restart:
assume(r, ‘positive’):
coulditbe(r, ‘complex’) ;    # the answer is (surprising ?) true

I'm probably doing some mistake bigger than I but I don't find it !

Could you be compassionate enough to enlight me !!!

## Is there any convenient tool to convert Maple work...

Is there any convenient tool to convert Maple worksheet to Matlab m file, until today?