Pregunta de entrevista de Engelhart Commodities Trading Partners

Coding question in python and a math question involving quant prob/stats