This comparison is carried out on the basis of matrix multiplication approach in which document representatives are converted into an id by term matrix(where no. of terms equal to all terms together in all documents and id means file id assigned initially) and a matrix is generated for query terms. Multiplication of both provides necessary result to identify which document is more relevant to the query. Mathematically it can be shown as: