Modify

Opened 11 years ago

Closed 11 years ago

#2977 closed Bug (Fixed)

Random() returns zero on statistically valid inputs

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.12.0 Severity: None
Keywords: Cc:

Description

Hi devs,

This appears to be coded intentionally to behave like this (from reading the Help documentation), but the behaviour itself is simply wrong.

$test=Random(1,1,1)
MsgBox(0,@error,$test)

This currently yields 0, presumably because the range is zero. But this is a conceptual mistake.

Consider a vase with a variable (N)umber of balls, numbered consecutively 1-N. If there are three balls (labelled 1,2,3 resp.), my chances of pulling out ball 1 are 1 in 3. If there are two balls, the chance of pulling out ball 1 is 50%. But if the vase contains only ball 1, my chances of pulling out ball 1 are of course 100%, not zero/error.

Exepcted Behaviour: If min=max, return min (or max)
Anything else is counter-intuitive and statistically indefensible.
Cheers,
RT

Attachments (0)

Change History (2)

comment:1 by anonymous, 11 years ago

This is already changed to expected behavior in latest beta versions.

comment:2 by jchd18, 11 years ago

Resolution: Fixed
Status: newclosed

Exactly, latest beta fixes that.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.