0
$\begingroup$

What is the mathematical explanation for selecting the minimal element in the matrix row?

If I have the following matrix

$\left( \begin{array}{ccccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 1 & 1 & 1 \\ \end{array} \right)$

I need to select the minimal element in each row.

Then arrange the items as a set or vector

{0,o,1}

What is the mathematical process that was based on them.

My attempts to explain this process mathematically

Assume matrix

$M=\left( \begin{array}{ccccc} V_1 \\ V_2 \\ V_3 \\ \end{array} \right)$

Where $V_1=\{1,0,0\},V_2=\{0,1,0\}$ and $V_3=\{1,1,1\}$

$min(M)=\left( \begin{array}{ccccc} min(V_1) \\ min(V_2) \\ min(V_3) \\ \end{array} \right)=\left( \begin{array}{ccccc} 0 \\ 0 \\ 1 \\ \end{array} \right)$

therefore we get $min(M)$ as state vector :

$$V=min(M)=\{0,0,1\}$$

Is this math operation correct

$\endgroup$
  • $\begingroup$ AFAIK, this operation has no utility. $\endgroup$ – Yves Daoust Jul 26 '17 at 16:44
  • $\begingroup$ @YvesDaoust What do you mean by no utility $\endgroup$ – Emad kareem Jul 26 '17 at 16:58
  • $\begingroup$ Virtually no use. (Except maybe in graph theory, with $0/1$ matrices.) $\endgroup$ – Yves Daoust Jul 26 '17 at 16:58
  • $\begingroup$ It is unclear to me what is being asked here. Are you asking for example of aplications? asking for an algorithm? or something else. $\endgroup$ – Siong Thye Goh Jul 26 '17 at 17:01
  • $\begingroup$ @SiongThyeGoh I asking for an algorithm. $\endgroup$ – Emad kareem Jul 26 '17 at 17:03
1
$\begingroup$

Assuming you have a classical computer and given a vector $v$, find its smallest element. To do so just do a linear scan.

Now, repeat this process for each row.

Complexity of the approach: $O(mn)$.

$\endgroup$
  • $\begingroup$ Can you explain the example above. I am grateful to you for your second answer to my questions $\endgroup$ – Emad kareem Jul 26 '17 at 17:09
  • $\begingroup$ For the first row, $[1, 0, 0]$, initialize a variable$x$ with the first element, $x = 1$. now visit the second element. If it is smaller than it, update it. second element is smaller so update it, now $x=0$. visit the next element, $0$ is not smaller. In the end $x=0$. Repeat for other row. $\endgroup$ – Siong Thye Goh Jul 26 '17 at 17:21
  • $\begingroup$ If you have access to mathematica, you should used the function min, rather than write your own code. $\endgroup$ – Siong Thye Goh Jul 26 '17 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.