select m*m matrix from m*n matrix

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

  • pradeep_agrawal
    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
  • spp
    spp
    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.
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    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 ?

You are reading an archived discussion.

Related Posts

Hey friends This is just for the Fun Write the Comments on Avatar of the Person above you... And Rate it ( Give Points out of 10 ) I am...
hi friends, due to some error or something my auto update feature of my laptop is not working. when i am restarting my laptop then the time and date changing...
can anybody tell me in detail what is y2k38 problem.
what is engineering and who are engineers ? please give your opinion ?
upto what frequency range humans can speak. i m NOT talking about hearing range(20hz to 20khz) i m talking about SPEAKING RANGE.