random numbers

Bug #107700 reported by Séb
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openoffice.org (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: openoffice.org

Hello,

I'll tried to speak approximately in English...

The random numbers' generator (ALEA in French, RADN in English, I suppose) is not correctly configured.

Random numbers must be in [0,1[ interval, but open office gives numbers of [0,1].
For a lot of people it's a detail, but when you want to teach simulation with kids, you may obtain a 7 on a die (un dé en français).

Can you change the source please ?

Sincerely your,

Sébastien DUMORTIER

Revision history for this message
Philip Paquette (pcpaquette) wrote :

With other functions, you should be able to tweak it to your needs.
For example, to obtain the dice side #, you might want to use:

=TRUNC(RAND()*6)+1

RAND() * 6 -> between 0,6
Trunc -> 0,1,2,3,4,5
+1 -> 1,2,3,4,5,6

The odds of arriving exactly at 1.00000000000000 are 0.
Hope this helps.
Rejecting.

Changed in openoffice.org:
status: Unconfirmed → Rejected
Revision history for this message
Philip Paquette (pcpaquette) wrote :

Also,

if you use the random normal generator and you don't set an approximate number of digits after the decimal, the output of rand() will be correct, but the cell will round the number by itself.

e.g. in cells rounds so it has 0 digits after the decimal.

0.423489324234 -> 0
0.543589423423 -> 1

You might want to make sure you have enough digits after the decimal.

Revision history for this message
Séb (sebastien-dumortier) wrote : Re: [Bug 107700] Re: random numbers

The function I've used with my classroom was =ENT(ALEA()*6+1) so it was
near yours. But some children said me they had 7 as result once or twice
among 10000, what I've seen. It wasn't the lastest version of
openoffice, and it was under Windows XP. Under Linux, and 2.0.4, I've
not had this problem.

To have what I want, I've finally used =ALEA.ENTRE.BORNES(1;6) but it
wasn't very interesting to teach this way...

Thank's for your response, and sorry for my english.

Sébastien DUMORTIER.

Le jeudi 19 avril 2007 à 13:24 +0000, Philip Paquette a écrit :
> With other functions, you should be able to tweak it to your needs.
> For example, to obtain the dice side #, you might want to use:
>
> =TRUNC(RAND()*6)+1
>
> RAND() * 6 -> between 0,6
> Trunc -> 0,1,2,3,4,5
> +1 -> 1,2,3,4,5,6
>
> The odds of arriving exactly at 1.00000000000000 are 0.
> Hope this helps.
> Rejecting.
>
> ** Changed in: openoffice.org (Ubuntu)
> Status: Unconfirmed => Rejected
>

Revision history for this message
Séb (sebastien-dumortier) wrote :

Yes, certainly, but it wasn't this mistake ;-)

Le jeudi 19 avril 2007 à 13:27 +0000, Philip Paquette a écrit :
> Also,
>
> if you use the random normal generator and you don't set an approximate
> number of digits after the decimal, the output of rand() will be
> correct, but the cell will round the number by itself.
>
> e.g. in cells rounds so it has 0 digits after the decimal.
>
> 0.423489324234 -> 0
> 0.543589423423 -> 1
>
> You might want to make sure you have enough digits after the decimal.
>

Revision history for this message
Andy (kakomon-collector-s-ubuntu) wrote :

I regret to say that You were wrong, Philip.

The odds of arriving exactly at 1.00000000000000 were NOT 0.
Indeed they happen once in around several tens of thousands of times.

I made this checked by doing this...

1. I used a formula "=int(rand())"
2. I pasted it in area of "A1:T50000"
    This means I tried 1,000,000 cells.
3. in cell U1 I made a formula "=MAX(A1:T50000)"
4. U1 says "1 " insted of "0". If Philip had been right, U1 should be "0".
5 Then I counted the cells which say 1.
6 There were 20-40 such cells. The number of such cells varies time to time.

You should have tried it !!

description: updated
Changed in openoffice.org (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Chris Cheney (ccheney) wrote :

Do you still have this problem with Ubuntu 10.04 LTS (Lucid)? I got a result of 0 for the test that Andy mentioned.

Changed in openoffice.org (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Chris Cheney (ccheney) wrote :

We're closing this bug since it is has been some time with no response from the original reporter. However, if the issue still exists please feel free to reopen with the requested information. Also, if you could, please test against the latest development version of Ubuntu, since this confirms the bug is one we may be able to pass upstream for help.

Changed in openoffice.org (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.