typed text – Know when a 3-second sound is in a 4-minute song?

I have the following problem for a university job, so I do not ask for explicit code, I would like to know if you can give me ideas on how to know if a pattern, waves or as you want the call is in a broader pattern In which part would it be? They recommended Monte Carlo but I really do not know how to use it in the problem. Thank you