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

 
 

bug #51068: Incorrect result of random number generator

Submitted by:  None
Submitted on:  Fri 19 May 2017 02:02:23 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: LinglinOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.1
Operating System: Other

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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 File(s):
   
   
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
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by dastew (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 22 May 2017 01:00:16 AM UTCrik5StatusNone=>Invalid
      Open/ClosedOpen=>Closed
    Fri 19 May 2017 02:02:23 PM UTCNoneAttached File-=>Added expo.m, #40736

    Back to the top


    Powered by Savane 3.1-cleanup1