Use the complement method for an easy solution.
First, determine the number of ways that 4 and 5 ARE next to each other:
So, these 5 ways plus the 5 reverse ways where 5 precedes 4.
In total, there are 10 ways that the numbers 4 and 5 are next to each other. However, there are still 4! = 24 ways to arrange the remaining 4 numbers. So, there are
In general, there are 6! = 720 ways to arrange the 6 numbers.
Using the complement method :
P(4 and 5 not next to each other)
Hope that helped