A river should be crossed by a father, a mother and their two sons and two daughters.
There are some rules that should be followed while crossing the river. There can be only two people in the raft while crossing. The daughters cannot be with their father unless there is the presence of the mother. The sons cannot be with their mothers unless the father is present. Unless the guard is on the board, the criminals cannot be with any of the family members. Only the adults like the father, the guard, and the mother knows to use the raft.
How will they cross the river?
Solution:
The guard and the prisoner cross the river
The guard comes back
The guard and the girl cross the river.
The guard and the prisoner comes back.
The mother and the girl cross the river.
Mother comes back
The mother and the father cross the river
Father comes back
The guard and the prisoner cross the river
Mother comes back
The father and the mother cross the river
Father comes back
The father and the boy cross the river
The guard and the prisoner comes back
The guard and the boy cross the river
The guard comes back
The guard and the prisoner cross the river.