Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.2K Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Generate new lists with the same order using RandomSample?

Hi

I have two lists as below :

List1 = {a1, b1, c1, d1}

List2 = {a2, b2, c2, d2}

with using RandomSample[ ] how I can generate new lists with the same order for both lists. For example :

RandomSample[List1]

{b1, d1, a1, c1}

RandomSample[List2]

{b2, d2, a2, c2}

Many thanks for your help.

POSTED BY: M.A. Ghorbani
4 Replies
POSTED BY: Daniel Lichtblau

Dear Daniel,

Your assistance is always appreciated. A great solution!

Mohammad

POSTED BY: M.A. Ghorbani

1 Approach: Use SeedRandom[].

SeedRandom[3];
RandomSample[List1]
SeedRandom[3];
RandomSamplet2]

Regards,

Neil

POSTED BY: Neil Singer

You're the best Neil. Thanks so much.

POSTED BY: M.A. Ghorbani
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard