I wanted to ask that which formula to use in a question of Statistics Class 11?

I am confused.. sometimes we use discrete data formula and sometimes we use the continuous frequency formula...

How to know?

||Pls answer||

Tahan's image