## Collatz ... again

Maple 13

Hi everybody,

The Collatz conjecture can be used to give students a taste of a topic in Number Theory.  See the Wikipedia article for a good explaination.

https://en.wikipedia.org/wiki/Collatz_conjecture

Also, a conjecture is something that is probrably true.  Enjoy my little Maple procedure.  (in .mw and .pdf forms)

Collatz_third_time.mw

Collatz_third_time.pdf

Matt

## SEEMOUS 2017

by: Maple

Here is a problem from SEEMOUS 2017 (South Eastern European Mathematical Olympiad for University Students)
which Maple can solve (with a little help).

For k a fixed nonnegative integer, compute:

Sum( binomial(i,k) * ( exp(1) - Sum(1/j!, j=0..i) ), i=k..infinity );

(It is the last one, theoretically the most difficult.)

## Statistics Social - Cronbach - Pearson

Maple 2015

Application that allows us to measure the reliability of a group of data through a row and columns called cronbach alpha at the same time to measure the correlation of items through the pearson correlation of even and odd items. It can run on maple 18 to maple 2017. This will be useful when we are developing a thesis in the statistical part.

In Spanish

StatisticsSocialCronbachPearson.zip

Lenin Araujo Castillo

## Bad help and needless command in SignalProcessing

Maple

Let us consider the help to RectangleWindow SignalProcessing-RectangleWindow.pdf SignalProcessing-RectangleWindow.mw.
Let us execute the example, taking N:=4 (in order to display the outputs).

```with(SignalProcessing):
N := 4;
a := GenerateUniform(N, -1, 1);
Matrix(1, 4, [[.396167882718146, -.826878267806025, -0.908376742154361e-2, .324899681378156]])
RectangleWindow(a);
Vector[row](4, [.396167882718146, -.826878267806025, -0.908376742154361e-2, .324899681378156])
c := Array(1 .. N, 'datatype' = 'float'[8], 'order' = 'C_order'):
RectangleWindow(Array(1 .. N, 'fill' = 1, 'datatype' = 'float'[8], 'order' = 'C_order'), 'container' = c);
Vector[row](4, [1., 1., 1., 1.])
u := `~`[log](FFT(c)):
plots:-display(Array([plots:-listplot(Re(u)), plots:-listplot(Im(u))]));
```

We see an uncommented code which (intentionally or unintentionally) produces two empty plots.
The questions arise:

• What is the aim of the RectangleWindow command which does nothing
but the conversion of a Matrix(1,N,...) /Array(1..N,...) to a Vector[row](N,...)?
• Could such help be called friendly to Maple users?

There are many questions to Maplesoft and there are no answers from them: strategic silence.
RectangleWindow.mw

## Star database procedure query of Simbad

Maple

Here's a little procedure to fish out data from the Simbad database.  Some star names may not work if the page Simbad brings up is not completely filled, but it should work for most queries.

 (1)

 (2)

 (3)

 (4)

## Main Stars within 50 ly

Maple

I found this http://www.atlasoftheuniverse.com/50lys.html and wondered how to do it in Maple. With a bit of data file editing I came up with this.  All stars within 50 light years that are visible to the naked eye.

 (1)

 (2)

The modified data file and the maple worksheet below

stars3.txt

## StackExchange site for maple

by: Maple
 I have proposed a SE site for maple. This will help to put maple on SE. Please follow this site. http://area51.stackexchange.com/proposals/107315/maple

Update

We have moved to the next phase Commitment. Come and join us.

## Teaching Mathematics in China

Maple

Ilias Kotsireas is a Professor and Director of the CARGO lab at Wilfrid Laurier University, in Waterloo Ontario.

Throughout my career as a teacher, I’ve had the opportunity to work with students from around the globe. I’ve been able to work with students in other countries, immersing myself in their culture and learning environment. This has allowed me to experience the differences in educational delivery first hand, and to assess how education is viewed in other parts of the world.

On more than one occasion, I’ve visited the city of Guangzhou, China, to teach summer and winter school courses, beginning in 2007 and most recently in 2015 and 2016. During this time, I have witnessed tremendous growth in the development of Chinese Universities, as well as Chinese culture as a whole.  For example, the two largest supercomputers in the world - according to the website www.top500.org  - are located in China.  Another indication of the scale of this extraordinary growth is the fact that China currently has more than 2,000 universities, government research facilities and laboratories.  Furthermore, China Central Television (CCTV) programs report that China is planning the creation of an additional 10 mega-cities, each comparable in size to Shanghai.

Ilias Kotserias stands with students and fellow professors at South China Normal University (SCNU) in Guangzhou, China.

Summer and winter school courses in China are incredibly intensive. Such courses can run for one or two weeks and include two lectures per day, one on the morning and one in the afternoon. A tremendous amount of material must be covered in a short amount of time to accommodate the entire course.

Overall, my experiences have shown that students in China are very enthusiastic about education. They are heavily engaged with the learning materials and often spend time with professors at the conclusion of a lecture to converse and ask questions about what they have just learned. Class sizes are significantly smaller and there is a lot of one-on-one time with students. Students in China take their studies very seriously; they are very focused and motivated to do well in their studies, and they bring a great deal of knowledge and curiosity to the classroom.  Professors cannot gloss over material or deliver a scripted lecture. Students hold professors accountable, and expect them to be knowledgeable and have a strong understanding of the material. They have a strong desire to learn and gain experiences and relevant skills that they can carry forward with them in their educational and professional careers.

Maplesoft graciously offered short term licenses to my students in China, so they could use Maple in the mathematics courses I was teaching. Using Maple allowed me to continue using an experimental approach to teaching that I use for my students back home in Canada.  This approach encourages students to start with simple experimentation that may also contain visual components, develop a plausible conjecture and subsequently attempt to solve it step by step.  This promotes a “learn by doing” paradigm that promotes active learning and helps students better understand key mathematical concepts. In a delightful episode, one Chinese student told me “I don’t understand your English accent,” but in teaching with Maple there are no accents I need to worry about!  Chinese students are inquisitive, respectful and conscientious; it is an absolutely gratifying experience working with them.

I was first introduced to Maple when I was completing my Masters and Ph.D in France in the late 1990s. When I began teaching in 2001, I introduced Maple into my classrooms to improve my students’ ability to learn the materials, understand difficult concepts, and to create more sustainable engagement with them. Initially, it took some work to convince them to use Maple, as it was not among the conventional learning methods they were used to. Eventually students came to embrace Maple as a learning tool and I was able to use visual and interactive examples to engage them. With Maple, experimentation is at your fingertips and it allows me to incorporate an example-driven learning experience for my students.

It was a valuable experience to work with students from another culture and be able to engage them using the same method I use to engage my students back home. Maple is not only a powerful and convenient teaching tool, but it can also assist in bridging cultural gaps and creating a learning experience that is uniform across the globe.

## Inspiring Young People to be Science and Technology...

Maplesoft aims to promote innovation in science, technology, engineering and math (STEM) in high school students by partnering with various organizations, and sponsoring initiatives in education, research and innovation. Every year, Maplesoft commits time, funds and people to enhance the quality of math-based learning and discovery and to encourage high school students to strengthen their math skills.

One such organization we partner with is The Perimeter Institute, a leading centre for scientific research, training and educational outreach in foundational theoretical physics.  Maplesoft currently serves as its Educational Outreach Champion, supporting various initiatives that promote math learning and exploration. Perhaps the most popular of its student outreach program is the annual International Summer School for Young Physicists (ISSYP), a two-week camp that brings together 40 exceptional students from high schools across the globe.  Each year students receive a complimentary copy of Maple, and use the product to practice and strengthen their math skills.  The ISSYP program also uses Möbius, the comprehensive online STEM courseware platform from Maplesoft, to offer preparatory course materials to students.  Completing lessons in Möbius aid in making the summer program a more productive and dynamic experience for the students.

International Summer School for Young Scientists at Perimeter Institute

Who Wants to Be a Mathematician is a competition organized by the American Mathematical Society (AMS) for high school students in North America. Maplesoft has been a sponsor of the contest for many years.  Maple T.A., the testing and assessment tool by Maplesoft, is used to administer the tests online, saving significant time and money for the organizers. When Maplesoft first introduced Maple T.A. to the contest, taking the competition from pen-and-paper tests to online tests, the number of contestants doubled, with about 2000 students participating in the contest. Maplesoft also donates prizes to the games in order to promote the use and love of math by high school students.  This year will be first time the competition moves international. Six students in the UK took the Round 2 qualifying test, with the use of Maple T.A., and qualified for the live, on-stage finals of the UK edition of the competition that took place at the 2017 Maths Fest in London. Maplesoft is also supporting the spread of the WWTBAM contest to Canada in 2017.

Who Wants to be a Mathematician finals

Maplesoft also sponsors two outreach initiatives in Texas A&M University.  The Summer Educational Enrichment (SEE) Math Program is a summer workshop attended by gifted middle school students. Students spend two weeks exploring ideas such as algebra, geometry, graph theory, and topology.  The University also conducts the Integral Bee every year, a math based contest for high school students.

In addition to the above key projects, throughout the year Maplesoft also sponsors and is associated with a number of other competitions, conferences, and educational initiatives. A few of these are listed below.

• The Connecticut Science & Engineering Fair is a yearly, statewide science and engineering fair open to all 7th through 12th grade students.  An important objective of their program is to attract young people to careers in science and engineering while developing skills essential to critical thinking.
• FIRST Robotics Competition is a high school robotics competition. Each year, teams of high school students and mentors work during a six-week period to build game-playing robots that weigh up to 120 pounds.

FIRSTRobotics Competition

• ScienceExpo Conference is a student-run event that engages students with STEM-related opportunities and workshops
• SWATposium is an annual robotics conference that brings together nearly 40 First Robotic Competition teams from both Canada and the United States for a day of guest speakers, workshops and social activities.

SWATposium

• FIRST LEGO League gives elementary and middle school students and their adult coaches the opportunity to work and create together to solve a common problem.

FIRST LEGO League at St. Luke's School in Waterloo

Maplesoft’s objective of these sponsorships is to support those who inspire and channel young minds to be STEM focussed. By engaging them in exciting contests and programs the hope is that they build science, engineering, and technology skills at a young age and grow to be innovators and technology leaders of tomorrow.

## A compact Sudoku solver via Groebner

by: Maple

Sudoku is a well known Latin square type game, see https://en.wikipedia.org/wiki/Sudoku

Here is a Sudoku game and its (unique) solution:

A,Sol:=  # A = Sudoku matrix, 0 for each empty cell
Matrix(9, [
[0,0,3,0,9,0,1,0,0],
[0,5,0,3,0,0,7,0,0],
[1,0,2,0,0,5,0,6,4],
[0,1,0,0,2,0,9,0,0],
[2,0,0,6,0,3,0,0,1],
[0,0,7,0,8,0,0,3,0],
[7,6,0,9,0,0,8,0,5],
[0,0,8,0,0,7,0,9,0],
[0,0,4,0,6,0,2,0,0]]),
Matrix(9, [
[4,7,3,2,9,6,1,5,8],
[8,5,6,3,4,1,7,2,9],
[1,9,2,8,7,5,3,6,4],
[3,1,5,7,2,4,9,8,6],
[2,8,9,6,5,3,4,7,1],
[6,4,7,1,8,9,5,3,2],
[7,6,1,9,3,2,8,4,5],
[5,2,8,4,1,7,6,9,3],
[9,3,4,5,6,8,2,1,7]]);

The procedure which follows is a very compact Sudoku solver. It uses Groebner bases. I hope that you will like it.
The input is the Sudoku matrix and the solution matrix is returned.
Note that the Sudoku matrix must be valid and must have a unique solution.
(Otherwise, theoretically, the error "Invalid Sudoku matrix" should appear.)
Note also that the procedure may be very slow for some games or Maple may crash. This happened to me once with a very "hard" matrix.

I was impressed that Maple's implementation for Groebner bases works now so well for this problem!

A few years ago on this site: http://www.mapleprimes.com/questions/131939-Calculating-Groebner-Basis-For-Sudoku
it was an attempt to solve the problem with this method but it failed (due to wrong number of polynomials).

```sudoku:=proc(A::'Matrix'(9,integer))
local x_A,x,Q,R,r, i,j,u,v,G;
Q:=proc(X,Y) normal((mul(X-i,i=1..9)-mul(Y-i,i=1..9))/(X-Y)) end;
x_A:=seq(seq( `if`(A[i,j]>0,x[i,j]-A[i,j],NULL),i=1..9),j=1..9);
R:={seq({seq(x[i,j],j=1..9)},i=1..9), seq({seq(x[i,j],i=1..9)},j=1..9),
seq(seq({seq(seq(x[3*u+i,3*v+j],i=1..3),j=1..3)},u=0..2),v=0..2)};
G:=Groebner:-Basis({seq(seq(seq(Q(u,v),u=r minus {v}),v=r),r=R),x_A},'_vv');
if nops(G)<>81 then error "Invalid Sudoku matrix" fi;
eval(Matrix(9,symbol=x), `union`(map(u->solve({u}), G)[]));
end:
```

sudoku(A) < A; # Solving the previous game

# Let's solve another one:
A:=Matrix(9,9,[[0,0,0,4,0,0,0,8,0],[0,5,2,7,0,0,4,0,0],[3,0,0,0,0,0,0,0,0],[5,1,0,8,0,0,0,0,0],[0,0,0,5,0,0,6,7,0],[0,9,0,0,7,0,0,0,3],[2,4,0,0,0,5,0,0,0],[9,0,0,0,0,0,0,3,8],[0,0,0,0,0,0,9,4,0]]):
sudoku(A) < A;

Matrix   # A Sudoku matrix which crashes Maple!
(9,[[8,0,0,0,0,0,0,0,0],[0,0,3,6,0,0,0,0,0],[0,7,0,0,9,0,2,0,0],[0,5,0,0,0,7,0,0,0],[0,0,0,0,4,5,7,0,0],[0,0,0,1,0,0,0,3,0],[0,0,1,0,0,0,0,6,8],[0,0,8,5,0,0,0,1,0],[0,9,0,0,0,0,4,0,0]]):

## The distance from the point to the surface

by: Maple 15

The distance from the point to the surface easily calculated using the NLPSolve of Optimization package. If the point is not special, we will find for it a point on the surface, the distance between these two points is the shortest between the selected point and the surface.
Two examples:  the implicit surface and the parametric surface.
To test, we restore the normals from the  calculated  points (red) by using analytical equations.
DISTANCE_TO_SURFACE.mw

## Maple in the teaching of Mathematics for Civil...

Maple 2016

In the present work it has been shown how Maple helps in the teaching of Mathematics in the different subjects that it has. Using a Maple worksheet as if it were a class preparation notebook could develop problems such as: Vector Analysis, EDO, EDP, Statistics, Algebra, Geometry, etc., among others; Taking as a method of solution the clickable-mathpopup, the right click (contextual) or at best embedded components. No criteria or prerequisite is needed to use Maple; Rather than being willing to forget the traditional slate and down and replace it with dynamic leaves that maple offers us; To achieve excellent academic profiles both individually and in groups. The proprietary methods are used to develop applications (math-apps) being a professional criterion; That is to say, according to the problematic reality, we are looking for enduring interactive solutions. Here we use the graphical algorithm and the block diagram as a solution proposal but not as something obligatory to implement solutions. We take as a teaching-learning measure the results of our students in the ability to analyze and interpret the results; Since in the times of calculation; Maple helps tremendously; Opening up this way to train students competent in basic sciences and engineering.

II_SEMINARIO_UNT_2017.pdf

In Spanish

Lenin Araujo Castillo

## Happy Valentine's Day

by: Maple 2016

In the creation of this animation the technique from here  was used.

The code of this animation:

with(plots): with(plottools):
SmallHeart:=plot([1/20*sin(t)^3, 1/20*(13*cos(t)/16-5*cos(2*t)/16-2*cos(3*t)/16-cos(4*t)/16), t = 0 .. 2*Pi], color = "Red", thickness=3, filled):
F:=t->[sin(t)^3, 13*cos(t)/16-5*cos(2*t)/16-2*cos(3*t)/16-cos(4*t)/16]:
Gf:=display(translate(SmallHeart, 0,0.37)):
Gl:=display(translate(SmallHeart, 0,-1)):
G:=t->display(translate(SmallHeart, F(t)[])):
A:=display(seq(display(op([Gf,seq(G(-Pi/20*t), t=3..k),seq(G(Pi/20*t), t=3..k)]))\$4,k=2..17),display(op([Gf,seq(G(-Pi/20*t), t=3..17),seq(G(Pi/20*t), t=3..17),Gl]))\$30, insequence=true, size=[600,600]):
B:=animate(textplot,[[-0.6,0.25, "Happy"[1..round(n)]],color="Orange", font=[times,bolditalic,40], align=right],n=0..5,frames=18, paraminfo=false):
C:=animate(textplot,[[-0.2,0, "Valentine's"[1..round(n)]],color=green, font=[times,bolditalic,40], align=right],n=1..11,frames=35, paraminfo=false):
E:=animate(textplot,[[-0.3,-0.25, "Day!"[1..round(n)]],color="Blue", font=[times,bolditalic,40], align=right],n=1..4,frames=41, paraminfo=false):
T:=display([B, display(op([1,-1,1],B),C), display(op([1,-1,1],B),op([1,-1,1],C),E)], insequence=true):
K:=display(A, T, axes=none):
K;

The last frame of this animation:

display(op([1,-1],K), size=[600,600], axes=none);  # The last frame

Edit. The code was edited - the number of frames has been increased.

## Bug in Optimization

Maple 2016

Let us consider the linear integer programming problem:

```A := Matrix([[1, 7, 1, 3], [1, 6, 4, 6], [17, 1, 5, 1], [1, 6, 10, 4]]):
n := 4; z := add(add(A[i, j]*x[i, j], j = 1 .. n), i = 1 .. n):
restr := {seq(add(x[i, j], i = 1 .. n) = 1, j = 1 .. n), seq(add(x[i, j], j = 1 .. n) = 1, i = 1 .. n)}:
sol := Optimization[LPSolve](z, restr, assume = binary);

Error, (in Optimization:-LPSolve) no feasible integer point found;
use feasibilitytolerance option to adjust tolerance

sol1 := Optimization[LPSolve](z, restr, assume = binary, feasibilitytolerance = 100, integertolerance = 1);

Error, (in Optimization:-LPSolve) no feasible integer point found;
use feasibilitytolerance option to adjust tolerance
```

That was OK in Maple 16, outputting

.

The bug in one of the principal Maple commands lasts since Maple 2015, where the above code causes "Kernel connection has been lost". The SCRs about it were submitted three times (see http://www.mapleprimes.com/questions/204750-Bug-In-LPSolve-In-Maple-20151).