Dr. John May

## 2616 Reputation

16 years, 342 days
Maplesoft

## Social Networks and Content at Maplesoft.com

I have been a part of the Mathematical Software Group at Maplesoft since 2007. I have a Ph.D in Mathematics from North Carolina State University as well as Masters and Bachelors degrees from the University of Oregon. I have been working on research in computational mathematics since 1997. I currently work on symbolic solvers and visualization as well as other subsystems of Maple.

## Cloud Pro Tip...

In case anyone is wondering why I chose to use a button to load the data instead of using the startup code region: For worksheets downloaded from the Maple Cloud in Maple 14, the default security settings prevent the automatic execution of the startup code region.  Since I wanted to post this worksheet to the cloud and have people be able to use it without saving it and then reloading it, I put the startup code in a button component.

@acer Scary.

## @JacquesC Not to imply that I am disinte...

@JacquesC Not to imply that I am disinterested.  I just can imagine myself being in the top 10.

## @Robert Israel That is a really good poi...

@Robert Israel That is a really good point.  These tests are not able to detect deviation from randomness at that level so they should be combined with some other tests as well.  Which means the followup post to this one practically writes itself.

## simple useful example...

For people like me who are not among that ~10 in the world, the example on the help page doesn't really give a good idea of why you might want to use ::uneval. When I use it, it is mostly for testing or measuring the evaluation of expressions. So, for those people who might end up here, here is a small example:

``` benchmark := proc(e::uneval)
local t, b;
t, b := time(), kernelopts(':-bytesused');
eval(e);
return (time() - t)*Unit(second), (kernelopts(':-bytesused') - b)*Unit(byte);
end proc```

This is a simple extention of ?time that also records the memory used to evaluate the expression 'e'.

```(**) benchmark(solve(x^50-1));
0.201 [s], 10924456 [byte]```

## @Alejandro Jakubi I do not remember what...

@Alejandro Jakubi I do not remember what my answer was exactly and I do not know why it was removed (perhaps it was inaudible in the recording from the studio mic too).  But I can say that I have visited with Al Rich and had fruitful discussions with him about his indefinite integration project. We are certainly looking at ways to improve some of the weaknesses his tests show.

When looking at the test results however, it is important to keep in mind the following from the Rubi test suite description:

Since Rubi was developed in conjunction with the test suite, its good performance is to be expected. And no doubt there are many problems Rubi is unable to integrate.

Also, if I recall correctly, the test suite doesn't address continuity of results so it is not clear how his work would apply to the problem of definite integration.

## Array...

Or as a Vector constructor:

`  v:= Vector(5, i->exp(i));`

## Array...

Or as a Vector constructor:

`  v:= Vector(5, i->exp(i));`

## @gotamo You should be able to compute th...

@gotamo You should be able to compute the variance using ?Statitics and ?ArrayTools in the following way.

`(**) Statistics:-Variance( ArrayTools:-Reshape( img, 1..ArrayTools:-NumElems(img) ) );`

Basically, ?Statistics:-Variance wants a one dimensional Array, and ?ArrayTools:-Reshape allows you to convert your two dimensional image into one. (In fact, it doesn't actually convert, it just provides an alias to the same piece of memory).

Hope that helps.

John

## @gotamo You should be able to compute th...

@gotamo You should be able to compute the variance using ?Statitics and ?ArrayTools in the following way.

`(**) Statistics:-Variance( ArrayTools:-Reshape( img, 1..ArrayTools:-NumElems(img) ) );`

Basically, ?Statistics:-Variance wants a one dimensional Array, and ?ArrayTools:-Reshape allows you to convert your two dimensional image into one. (In fact, it doesn't actually convert, it just provides an alias to the same piece of memory).

Hope that helps.

John

## No need to be Rude...

I don't work on the GUI team, and so I don't really have a horse in this race; I am just providing my honest advice on how to get the best Maple experience on a modern platform.

## No need to be Rude...

I don't work on the GUI team, and so I don't really have a horse in this race; I am just providing my honest advice on how to get the best Maple experience on a modern platform.

## You'll need to include your system and t...

You'll need to include your system and the details of the problem in order for people to be able to help you.

## Nice Start...

One of the really cool parts of wordle is how it "packs" words around each other without overlapping.  The creator of wordle briefly describes how he did that at StackOverflow. The most difficult part of implementing that in Maple might be converting the words into polygons in order to detect collisions when creating the layout.

## @acer Here is a (very slow) rule 30 base...

@acer Here is a (very slow) rule 30 based bit generator:

```_30size := 232;
_30state := Vector(RandomTools:-Generate(list(integer(range=0..1), _30size)));

rand30 := proc()
local tmp0, tmp1, tmp2, i;
global _30state, _30size;
tmp0 := _30state(1);
tmp1 := _30state(_30size);
for i from 1 to _30size-1 do
tmp2 := _30state(i);
_30state(i) := (tmp1 + tmp2*_30state(i + 1)) mod 2;
tmp1 := tmp2;
end do;
_30state(_30size) := tmp1 + _30state(_30size)*tmp0 mod 2;
return _30state[floor(_30size/2)];
end proc;```

I ran binary rank, Wald-Wolfowitz, and autocorrelation tests on it, and it does seem to be about as good as the PRNGs in Maple. (The first sequence of 10,000 bits generated did fail the 16x16 Binary rank test, but the next 10,000 passed)

 4 5 6 7 8 9 10 Last Page 6 of 19
﻿