Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7050295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:07:34+00:00 2026-05-28T03:07:34+00:00

I have a row with numbers 1:n . I’m looking to add a second

  • 0

I have a row with numbers 1:n. I’m looking to add a second row also with the numbers 1:n but these should be in a random order while satisfying the following:

  1. No positions have the same number in both rows
  2. No combination of numbers occurs twice

For example, in the following

Row 1:  1  2  3  4  5  6  7 ...
Row 2:  3  6  15 8  13 12 7 ...  

the number 7 occurs at the same position in both rows 1 and 2 (namely position 7; thereby not satisfying rule 1)

while in the following

Row 1:  1  2  3  4  5  6  7 ...
Row 2:  3  7  15 8  13 12 2 ...

the combination of 2+7 appears twice (in positions 2 and 7; thereby not satisfying rule 2).

It would perhaps be possible – but unnecessarily time-consuming – to do this by hand (at least up until a reasonable number), but there must be quite an elegant solution for this in MATLAB.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:07:35+00:00Added an answer on May 28, 2026 at 3:07 am

    This is fairly straightforward. Create a random permutation of the nodes, but interpret the list as follows: Interpret it as a random walk around the nodes, and if node ‘b’ appears after node ‘a’, it means that node ‘b’ appears below node ‘a’ in the lists:

    So if your initial random permutation is

    3 2 5 1 4
    

    Then the walk in this case is 3 -> 2 -> 5 -> 1 -> 4 and you creates the rows as follows:

    Row 1:  1 2 3 4 5
    Row 2:  4 5 2 3 1
    

    This random walk will satisfy both conditions.

    But do you wish to allow more than one cycle in your network? I know you don’t want two people to have each other’s hat. But what about 7 people, where 3 of them have each other’s hats and the other 4 have each other’s hats? Is this acceptable and/or desirable?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, basically what is needed is a way to have row numbers while using
i have found several examples/questions about getting row numbers of the selected cells but
I have a text file containing the row numbers of the rows that should
Sybase db tables do not have a concept of self updating row numbers. However
I have a problem when adding row numbers using Apache Pig. The problem is
I can have any number row which consists from 2 to 10 numbers. And
I have a file the structure as follow Each row contain 3 numbers with
I have this row of data with actual numbers. For a specific reason ...
I have a 2 row table pertaining of a number, and that numbers cube.
I'm trying to have a single row of numbers, and if the row is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.