CrazyEngineers
  • select m*m matrix from m*n matrix

    spp

    Member

    Updated: Oct 26, 2024
    Views: 982
    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.
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • pradeep_agrawal

    MemberAug 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
    Are you sure? This action cannot be undone.
    Cancel
  • spp

    MemberAug 21, 2009

    pradeep_agrawal
    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
    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.
    Are you sure? This action cannot be undone.
    Cancel
  • Saandeep Sreerambatla

    MemberAug 25, 2009

    pradeep_agrawal
    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

    I didnt get this Pradeep, How is it n-m and n*m can you give a small example ?
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register