Hi

I am recently trying a rating concept in php.

The project is, peoples will post the images of house and ask everyone to rate it as which is beautiful home.

I've placed a 5 rating stars and doing all the vote captures.

But i am confused in picking the right beautiful house.

Calculation i'm used:

**Avg. Rating = Sum of rates/count of votes**

This is working fine. But i am not sure is this is the correct method. Because, this is had loophole.

**For ex: **

house #1 : 5 votes & (1+2+3+4+5)15 rates = Avg Rating = (15/5) is 3.0

where as

house #2 : 1 votes & 5 rate = Avg Rating = (5/1)5.0

based on the above calculation,

house#1 is the highest scorer. is it correct?

but what i'm thinking is. house #1 got major votes(5) and rating(3.0) where as house#1 got (1)vote only and rating(5.0).

So, house#2 is the beautiful house? is this right?

If my theory of logic is right? How do i implement that in my project ?

What calculation i need to place?

Thanks in advance