To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=80637





------- Additional comments from neilfbr...@openoffice.org Thu Oct 14 10:35:34 
+0000 2010 -------
Mathematical problem:
  The current algorithm generates 'nElements' random numbers ranging from
0 to nElements-1.  This means that the number of distinct values generated will
be significantly less than nElements, as there will be repeats.
To demonstrate, the following 1 line bash script:

for i in `seq 1 256` ; do echo $[RANDOM/128] ; done | sort -u | wc -l

generates 256 (16*16) random numbers from 0 to 255 and counts unique values.
It produces counts from 149 to 178 in 1024 runs.  Thus when used in the
'dissolve' transition, between 78 and 107 (30% - 40%) of squares will not be
shuffled. and so will appear to change in sequence.
This is not a random shuffling.

The alternate code is slightly wrong. the 'swap' should be for positions
'i' and 'i+j'.
The reasoning which shows that this is a correctly random shuffle is simply that
the first swap places a completely random element in the first position.
The second swap places a random choice from the remaining elements in the
second position.  The third swap places a random choice from the remaining
elements in the third position. etc.

Yes, it does move some elements multiple times, but so does the current code.

Visually:  At 16x16, you can see the effect, but it is not very pronounced.  It
depends on how lucky you are with your random numbers.  If you increase it to
64x64 (to match the competition) you will see that it is more noticeable.

Up to you if you fix it of course.

Thanks for taking the time to look at it.


---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@graphics.openoffice.org
For additional commands, e-mail: issues-h...@graphics.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to