select m*m matrix from m*n matrix

spp

spp

@spp-8ADGRN Oct 26, 2024

selection of m*m matrix from m*n matrix can be done in c(n,m) ways.

so can anyone sgeest me an algorithm or c/c++ programme to get all the possible selections.

thank you.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Aug 20, 2009

    Could you please add more details on how the number of combinations can be c(n,m).

    As per me if you do simple selection (without crossing boundaries of matrix) then the number of combinations will be (n-m) and if you do complex selection (by crossing the boundaries of matrix) then the number of combination will be nxm.

    Crossing the boundaries of matrix mean considering the first element is adjacent to last element in a row and first element is adjacent to last element in a column.

    -Pradeep

  • spp

    spp

    @spp-8ADGRN Aug 21, 2009

    pradeep_agrawalCould you please add more details on how the number of combinations can be c(n,m).

    As per me if you do simple selection (without crossing boundaries of matrix) then the number of combinations will be (n-m) and if you do complex selection (by crossing the boundaries of matrix) then the number of combination will be nxm.

    Crossing the boundaries of matrix mean considering the first element is adjacent to last element in a row and first element is adjacent to last element in a column.

    -Pradeep

    suppose we take a 2*5 matrix ie
    1 5 7 8 9
    2 6 4 8 9
    then from this i have to select all 2*2 matrices
    so the possibilities are
    1 5 1 7 1 8 1 9 5 7 5 8 5 9 7 8 7 9 8 9
    2 6, 2 4, 2 8, 2 9, 6 4, 6 8, 6 9, 4 8, 4 9, 8 9
    so its c(5,2)=10 which is equal to the no of selection.

  • Saandeep Sreerambatla

    Saandeep Sreerambatla

    @saandeep-sreerambatla-hWHU1M Aug 25, 2009

    pradeep_agrawalCould you please add more details on how the number of combinations can be c(n,m).

    As per me if you do simple selection (without crossing boundaries of matrix) then the number of combinations will be (n-m) and if you do complex selection (by crossing the boundaries of matrix) then the number of combination will be nxm.

    Crossing the boundaries of matrix mean considering the first element is adjacent to last element in a row and first element is adjacent to last element in a column.

    -Pradeep


    I didnt get this Pradeep, How is it n-m and n*m can you give a small example ?