1. The majority of people were happy.

2. The majority of the people were happy.

3.The majority of milk was thrown away.
4. the majority of the milk was thrown away.
-------------------------------
Are they grammatical? Do we have to use 'the'?

2 and 4 are best.

1 is OK, but 3 isn't.

1. The majority of people were happy.

2. The majority of the people were happy.

3. The majority of milk was thrown away.
4. The majority of the milk was thrown away.
.............................

Thank you.

You're welcome.

Yes, all four sentences are grammatically correct. However, the inclusion or omission of the definite article "the" can change the meaning and emphasis in each sentence.

In sentences 1 and 2, the use of "the majority" without the definite article "the" implies a general reference to a group of people, without specifying any particular group. So both sentences mean that a large number of people, without specifying who they are, were happy.

In sentences 3 and 4, the use of "the majority" with the definite article "the" implies a specific group or amount of milk, distinguishing it from other milk. Therefore, these sentences indicate that a specific amount of milk was thrown away.

In summary, the use of "the" before "majority" depends on whether you want to refer to a specific group (use "the") or make a more general statement (omit "the").