The total arrangements possible = 5! = 120
If the two girls sit at both ends, we can seat the girls in two ways and everyone else in the middle 3! = 6 ways. So, the number of possible arrangements = 2 * 3! = 12
And we can choose any 2 of the 3 boys to sit at both ends and we can arrange them in two ways. And for each of these arrangements, everyone else in the middle can be arranged in 3! = 6 ways. So the number of possible arrangements = C(3,2) *2 * 3! * = 36
So........the probability that a girll sits at both ends or a boy sits at both ends = [ 12 + 36] / 120 = 48/120 = 2.5 = 0.40