## 19974 Reputation

15 years, 236 days

## Solution...

Here's a straight forward solution that doesn't use any special formulas.

Let us denote by  x  the number of students who made only the 1st and 3rd trips, by  y - only the 1st and 2 trips, by  z - only the 2nd and 3rd trips. In total we have  x+y+z+160  students at this School. The problem is reduced to solving a system of 3 equations with 3 unknowns:

```restart;
Total:=x+y+z+160:
solve({x+160+y=50/100*Total, y+160+z=80/100*Total, z+160+x=90/100*Total});
eval(Total, %);```

## convert( ... , parfrac)...

```restart;
convert((3*n-8)/(n-3), parfrac);
```

## Solution with Maple...

Colors are encoded as integers from 1 to 5.

```restart;
L:=[seq(i\$4, i=1..5)]:
P:=combinat:-permute(L,4):
k:=0:
for p in P do
if p[1]<>p[2] and p[2]<>p[3] and p[3]<>p[4] and p[4]<>p[1]
then k:=k+1 fi;
od:
k;
```

260

## Solution...

Since  C=Pi-A-B , we have the problem of finding the minimum (or maximum) of a continuous function of two variables in a closed bounded area (this is a triangle  EFG  in the figure below). mmcdara showed that this function has no critical points in this region, so the minimum (or maximum) is necessarily reached at the boundary of the region. Therefore, the problem is reduced to finding the minimum of a function of one variable on the segments  EG, EF  and  FG .

We see that the minimum is equal to 1/4 and is reached at the points  E(Pi/3, Pi/3)  and  G(Pi/2, Pi/4) , but if  A<Pi/2 , then only at the point  E .

## Solution...

```restart;
P:=map(p->convert(p,Matrix,3,3), combinat:-permute([0\$9,1\$9],9)):
n:=0:
for p in P do
S:=convert~([p[1],p[2],p[3],p[..,1],p[..,2],p[..,3]],set);
if andmap(t->{0,1} subset t, S) then n:=n+1 fi;
od:
n;
```

102

## A way...

Unfortunately, Maple doesn't think to simplify the sum of the first and third terms after the simplification, but we can tell him to do so:

 > restart; Expr:=G1*P3 + G1*P5 + G1*P6 + G2*P3 + G2*P6 + G3*P2 + G3*P5 + G4*P2 + G4*P3 + G4*P5 + G4*P6 + G5*P2 + G5*P3 + G5*P5 + G5*P6 + G6*P3 + G6*P6 + G7*P2 + G7*P5 + G8*P2 + G8*P3 + G8*P5 + G8*P6; Expr1:=simplify(Expr); L:=[op(Expr1)]: t:=op(1,L)+op(3,L): factor(t)+simplify(Expr-t); # The final result
 (1)
 >

If we want the number  n  to match the number of petals, then

```restart;
Rose:= (n::integer)-> plots:-polarplot(`if`(n::even,sin(n/2*t),sin(n*t)), filled, color= `if`(n::odd, pink, aquamarine)):

Rose(4);  Rose(3); # Examples```

## Two options...

@mylikes  You didn't specify your version of Maple. It's probably a pretty old version if your code doesn't work. Try the two options below. The first option is the standard way to calculate the double integral. If it doesn't work, then try the second option, which reduces the double integral to a repeated one:

```restart;
r:=-36*u^3*v*(-1 + u + v)*(3*u^2 + u*v - 5*u - 2*v + 2)/(-1 + u)^2;
int(r, [u=0..1-v, v=0..1]); # The first option
int(int(r, u=0..1-v), v=0..1);  # The second option```

## ilog10...

Examples:

```ilog10(10110)+1;
ilog10(111010110)+1;
```

5
9

## plottools:-getdata...

```restart;
de := plot3d(y*sin(x), x = 0 .. 2*Pi, y = -2 .. 2):
plottools:-getdata(de);```

## Without the geometry package...

```restart;
ell:=(9/4)*X^2+9*Y^2=1;
a:=sqrt(1/coeff(lhs(ell),X^2));
b:=sqrt(1/coeff(lhs(ell),Y^2));
max(2*a,2*b); # Major axis
min(2*a,2*b); # Minor axis
```

## The reason...

```restart;
z1:=2+3*I:
z2:=I:
op(z1);
op(z2);```

2, 3
1

A reliable way to iterate over the sum of multiple terms is to simply make those terms elements of a list.

## seq, plottools:-line, plots:-arrow...

```restart:
with(plottools): with(plots):
u:=[2,2]: v:=[2,-1]:
G1:=seq(line(-5*u+t*v,5*u+t*v,linestyle=2), t=-5..5):
G2:=seq(line(s*u-5*v,s*u+5*v,linestyle=2), s=-5..5):
U:=arrow(u, color=red, width=0.2):
V:=arrow(v, color=red, width=0.2):
plots:-display(U,V,G1,G2, size=[700,700], scaling=constrained, axes=none);
```

## parametric...

We have to use the  parametric  option:

```restart;
solve({-x1+2*x2+(2-p)*x3=0,(2-p)*x2+x3=2, (1-p)*x1+2*x2+2*x3=p+3}, {x1,x2,x3}, parametric=true):
value(%);```

## Minor improvements...

Your syntax is correct and works successfully, but the following small improvements can be made:

1. The inequality  y>-1  can be omitted, since your region is itself above the line  y=-1 .
2. The  optionsexcluded = (color = white)  option can also be omitted, as it is done by default.
3. I equalized the ranges along the axes and shortened them a bit. With equal ranges, all shapes are unchanged and the  scaling=constrained  option is not required.

```restart: with(plots):
inequal({y >= x^2+1, (x-1)^2+(y-1)^2 <= 16}, x = -3.5 .. 5.5, y = -3.5 .. 5.5, optionsfeasible = (color = grey));```

 First 6 7 8 9 10 11 12 Last Page 8 of 279
﻿