I have a set of tuples . How can I define the matrix M in a formal way:
How can I define the matrix in the following two cases:
Case 1: There is no duplicate (i, j) pairs in the set S.
Case 2: There might be some duplicate (i, j) pairs, and I want to choose the pair that has the largest k. For example: S ={(1,1,2), (1,1,5)}, and I want