We have A=(21−2−1) and B=(−1−122).
A2=(21−2−1)(21−2−1)=(4−22−1−4+2−2+1)=(21−2−1)=A. Since A2=A, we have An=A for all n≥1 (that is, A is idempotent).
B2=(−1−122)(−1−122)=(1−21−2−2+4−2+4)=(−1−122)=B. Since B2=B, we have Bm=B for all m≥1.
Since An=A and Bm=B, the equation nAn+mBm=I becomes nA+mB=I, namely
n(21−2−1)+m(−1−122)=(1001) which gives the system:
2n−m=1⋯(1)
−2n+2m=0⋯(2)
n−m=0⋯(3)
−n+2m=1⋯(4)
From equation (3) we have n=m. Substituting into (1) gives 2n−n=1⟹n=1, and checking in (4) yields −1+2(1)=1 ✓.
Therefore, the only solution is (n,m)=(1,1), which lies in {1,2,…,10}2. Hence, the number of elements in the set is 1.