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 7753831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:09:07+00:00 2026-06-01T12:09:07+00:00

I have a matrix and I need to find a pattern inside this matrix.

  • 0

I have a matrix and I need to find a pattern inside this matrix.
Matrix is:

1 0 0 1 1 1 0 0 0 1
0 0 0 1 1 0 1 0 0 1
0 1 1 1 0 0 0 1 0 1
1 0 1 0 0 1 1 0 1 0
1 1 1 0 0 0 1 1 0 1
0 1 0 0 1 1 0 1 0 1
1 1 1 0 0 0 1 0 0 1
1 0 0 1 0 1 1 1 0 1

Rules:

  1. We choose one number from every row.
  2. The next choosen number from second row must be an opposite of the precedent.
  3. Positions of the numbers choosed by the 1 and 2 rules, must be a precise pattern.

So the question would be:

Find the best pattern that respect the 3 rules.
Example from the matrix shown:

  1. Choosed a number: 0(2) //what is in “()” represents the position of the value..position start from 1 to 10 on rows.
  2. 1(4)
  3. For the positions 2 and 4 to be a pattern must support rules 1 and 2 for the rest of the matrix.

So we go further on the 3rd row and we check 2nd position:1. We go 4th row, we check 4th position:0. Seems to respect the rules. There are opposite numbers on 2nd and 4th position, so we continue: 5th row, 2nd position:, and so on, but you will see on 7th row 2nd position:1 and 8th row 4th position:1; so the pattern of positions 2-4 is not good.

How could I make an algorithm based on these rules?

  • 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-06-01T12:09:08+00:00Added an answer on June 1, 2026 at 12:09 pm

    Maybe this will help (motivated by the comment to your question). This is a C++ sort of answer. This answer assumes 0 is always the number you pick, but you can easily edit this to allow 1 to be first.

    int firstPos, secondPos;
    
    for(int i = 0; i < 10; ++i)
        if(matrix[0][i] == 0)
            firstPos = i;
    
    for(int i = 0; i < 10; ++i)
        if(matrix[0][i] == 1)
            secondPos= i;
    
    bool success = true;
    
    for(int i = 0; i < 10/2; ++i)
        if(matrix[2*i][firstPos] == matrix[2*i][secondPos])
            success == false;
    
    if(success)
        cout << "success" << endl;
    else 
        cout << "failure" << endl;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a matrix in MATLAB and I need to find the 99% value
everyone. I need to find matrix n*n (or 5*5 ) determinant. I have a
I have a matrix. And I need to get 1D arrays from my matrix.
I need some help in this problem I have this matrix in MATLAB: A
I have a nxm matrix and I need to find the maximum of sum
I have a 2D matrix that I need to add into a 3D matrix,
I have a feature matrix implemented with Silverlight's Grid where users need to select
I have a need for a sparse matrix in up to 4 dimensions in
I have a need to basically create a matrix of values in my Silverlight
I have a 30000x14000 sparse matrix in MATLAB (version 7), which I need to

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.