Be the first to rate this file! 1 Download (last 30 days) File Size: 1.13 KB File ID: #22208

Bug (kind-of) in randn()

by Arvind

 

21 Nov 2008

The first number generated by randn() after a seed-reset is always positive!

| Watch this File

File Information
Description

This is a very strange bug in randn(). After every seed-reset, the first call to randn() almost invarably produces a postive number. Most of the time this is a benign defect, but sometimes folks seek to make a random sequence of 1s and 0s using randn>0. If you tried to do this, and reset the seed between every call to randn, then you will get a long sequence of ones. Not random!

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
probability Cristina McIntire 24 Nov 2008 13:42:18
bug Arvind 24 Nov 2008 13:42:22
statistics Arvind 24 Nov 2008 13:42:22

Contact us at files@mathworks.com