Logic behind the pith accent of 違う, 間違う and 勘違い

All 3 of them have 違う (heiban) as a root yet 間違う goes like maCHIGAu and 勘違い goes like kaNCHIgai.

Is there a method to this madness? 🙂

What am I missing?

by JackfruitNo5267