Message Boards Message Boards

1
|
2355 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Random Sampling

Posted 11 years ago
PLEASE  I  HAVE  A  SIMPLE QUESTION

WELL  I  AM  BRAND  NEW TO MATHEMATICA.  THEN  I  STILL  EXPERIENCE  SOME  DIFICULTY  TO  DEAL  WITH THIS  LANGUAGE  AND  I  CANT  FIND  SOME    more SIMPLE NOTATIONS.

FOR  THE  MOMENT  I  NEED  TO  PICK   A RANDOM  SAMPLING OF  "4"  NUMBERS  FROM  A  SET  " t " OF PREVIOUSLY  SELECTED NUMBERS ,  FOR  "n"  TIMES.

EXAMPLE  t = { 1,4, 6,27, 34, 56,78,82, 100, 123,222, 232...}   THEN OUPUT  FOR  2  TIMES { 4,27 ,222,56};  { 1,34, 56,123} -- AND  SO  ON. 

THANKS A  LOTS  IF  SOMEONE  AT MORE  ADVANCED LEVEL  COULD  SOLVE  A  SUCH  SIMPLE  QUESTION,.  THIS  IS  FOR A  PROJECT  OF  ANALYTICAL  CHEMISTRY.
POSTED BY: ANDRE MOREIRA
2 Replies
Dear Andre,

I am not sure whether I understand what you want but it is similar to what this does?
t = {1, 4, 6, 27, 34, 56, 78, 82, 100, 123, 222, 232}

Table[RandomChoice[t, 4], {k, 1, 5}]

Cheers,
M.
POSTED BY: Marco Thiel
Typing your question in all caps pretty much guarantees that most people who might otherwise consider answering won't even read the title.
POSTED BY: Szabolcs Horvát
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract