Simple answer: You ask "is head movement random", it is as random as the punches flying at your head require it to be.......
Head movement in terms of slipping/ducking is defensive head movement to evade a strike and is completely random as it is dictated by what your slipping or ducking to evade. Don't confuse "head movement" as a generality that just means slip or duck, although slipping and ducking require you to move your head out of the way, they are purely reactionary or reflexive..... (i.E: opponent swings hook high, you duck under, it is a reaction that is randomly dictated by your opponents reaction). Head movement holistically (all aspects combined) has more to do with overall body movement and posturing. Good head movement comes from staying relaxed, particularly in the shoulders, neck and core. If your upper body remains relaxed and your moving fluidly on the balls of your feet, not hopping around, but instead a relaxed back n forth weight transfer on the balls of your feet, using proper footwork to move front n back, side to side. Then by keeping your upper body relaxed and not tensing up, the headmovement becomes a bi-product of relaxed and poised overall body movement (starts at the feet). If your tense your movement becomes robotic and reactionary movements are much more difficult to time effectively or preemptively (slipping, ducking, etc), not to mention you become predictable as any rehearsed or forced movement will eventually and inevitably create a pattern and once your opponent recognizes that pattern you are much more vulnerable to taking shots, the kinda shots that provide you with a great view of ceiling! The key to "head movement" is staying relaxed and creating good overall movement, being reactionary not robotic!
in hurricanes or high wind storms big oak and pine trees are the first to get snapped and toppled over, but you will rarely see a willow tree get torn down, one resists and the other reacts accordingly by being "pliable" or relaxed, same concept applies to movement in the ring against opposing force! Good examples: BJ Penn or Anderson Silva, notice how relaxed they keep their movement in the ring. A good fighter expends allot of effort and it is evident in the way they win fights through athleticism and attrition. A great fighter expends just as much effort, but makes it look effortless because they dont rely solely on athleticism or attrition, they stay relaxed and adapt as the situation demands.