Modify

Opened 9 years ago

Closed 9 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 Changed 9 years ago by anonymous

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

comment:2 Changed 9 years ago by jchd18

  • Resolution set to Fixed
  • Status changed from new to closed

Exactly, latest beta fixes that.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.