In D1:-
R1={M,N,O} R2={M,P,Q} R3={N,R} R4={R,S,T}
Observe that M can be the key for R1 and R2:
Now checking the dependency, M+ ={M,P,Q}, which is satisfying the given dependency M--> PQ
Similarly N can be the key for R1 and R3:
N+ = {NR}, satisfying the dependency N--> R
R can be the key for R3 and R4:
R+ ={R,S,T}, satisfies the dependency R --> ST
Hence D1 is lossless.
In D2:-
Given R1 = {M,N,O,P} R2 = {P,Q} R3 = {N,R} R4={R,S,T}
For R2 the key attribute can P with R1, But P+ = {P}, which isn't a dependency provided. We can observe there is no other key attribute that can join R2.
Hence D2 is lossy.