bugGNU Octave - Bugs: bug #51068, Incorrect result of random number...

 
 

bug #51068: Incorrect result of random number generator

Submitter:  None
Submitted:  Fri 19 May 2017 02:02:23 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Linglin Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * Other Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 22 May 2017 01:00:16 AM UTC, comment #3: 

Closing report.  There seems to be an error in the code, not in Octave.

If the original reporter can produce a simpler example that clearly shows the exprnd generator has a problem then the report can be re-opened.

Rik <rik5>
Group administrator
Sat 20 May 2017 12:13:32 PM UTC, comment #2: 

I am sure that this is not a bug in octave.
please close is bug report.

Doug Stewart <dastew>
Fri 19 May 2017 02:20:00 PM UTC, comment #1: 

If you change the round command  to floor
I think you will get what you want.

Doug Stewart <dastew>
Fri 19 May 2017 02:02:23 PM UTC, original submission:  

Hi, I am currently using esponential random number generator and uniform random generator to do some experinment. However, I found that the histogram I drawn from the data set genreated is not as expected.

I will put the result I got in the document.

For the exponential random number generator, I am using this:

t4_real=mod(exprnd(lambda4,1,2*n),9) + 1 ;

This function is used to generate a exponential random number from range [1,10]. According to the property of exponential random number generator, the number "1" should appear more than number "2".  However, it works the other way around.

Please let me know why it happens like this.

1. Run expo.m
2. open original.csv
3. Create a new collumn with 0 to 10
4. Select column E
5. Choose "Statistics" -> Descriptive Statistics -> Histogram
6. Using the created collumn as cut off
7. Then you will see the result.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #40736:  expo.m added by None (3KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dastew (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-05-22 rik5 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2017-05-19 None Attached File- Added expo.m, #40736

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code