Professor influences character of Marshall on ‘How I Met Your Mother’