Student Support Forum
-----
Student Support Forum: 'Bug with RandomSample ?' topicStudent Support Forum > General > Archives > "Bug with RandomSample ?"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic | Post New Topic
Author Comment/Response
S. Saralamba
06/30/08 9:21pm

Yes, your results would be 8 but when you do not use Union function.

You are sampling the numbers from the list which has the length 15 (range[12]^341 and {1,1,1}). It is possible that RandomSample will take 1 from {1,1,1} one, two or three times. If RandomSample takes 1 from {1,1,1} three times then after you use Union you will get the length 6. Please have a look at the help of Union.


URL: ,

Subject (listing for 'Bug with RandomSample ?')
Author Date Posted
Bug with RandomSample ? Xavier 06/28/08 03:35am
Re: Bug with RandomSample ? Gopinath Ven... 06/28/08 6:33pm
Re: Bug with RandomSample ? S. Saralamba 06/30/08 9:21pm
Re: Bug with RandomSample ? Xavier 07/02/08 00:13am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic | Post New Topic





 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: