Question 8
Consider a matrix M generated from the "Words" dataset. If i and j represent two different words, when will M[i][j] be 1?
A = { }while (Table 1 has more rows) { Read the first row X from Table 1 A[X.SeqNo] = [X.PartOfSpeech, X.LetterCount] Move the row X to Table 2}n = length(keys(A))M = createMatrix (n, n)foreach i in Keys (A) { foreach j in Keys (A) { if (i ≠ j and checkSomething(A[i], A[j])) { M [i][j] = 1 } }}Procedure checkSomething(word1, word2) if (first(word1) == first(word2) and last(word1) ≠ last(word2)) { return (True) } else { return (False) }End checkSomethingIf i and j have same part of speech but different letter count
If i and j have different part of speech but same letter count.
If i and j have same part of speech and same letter count.
If i and j have different part of speech and different letter count.