Four investment bankers need to cross a bridge at night to get to a meeting. They have only one flashlight and 17 minutes to get there. The bridge must be crossed with the flashlight and can only support two bankers at a time. The Analyst can cross in 1 minute, the Associate can cross in 2 minutes, the VP can cross in 5 minutes and the MD takes 10 minutes to cross. How can they all make it to the meeting in time? (set: $analystPos to false) (set: $associatePos to false) (set: $VPPos to false) (set: $MDPos to false) Who do you send on the first trip? (if: not $analystPos and not $associatePos)[[Analyst + Associate ]] (if: not $analystPos and not $VPPos)[[Analyst + VP]] (if: not $analystPos and not $MDPos)[[Analyst + MD]] (if: not $associatePos and not $VPPos)[[Associate + VP]] (if: not $associatePos and not $MDPos)[[Associate + MD]] (if: not $VPPos and not $MDPos)[[VP + MD]] (set: $elapsedTime to 0) The elapsed time is $et(set: $elapsedTime += 1) (set: $analystPos to false) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should go next? (if: not $analystPos and not $associatePos)[[Analyst + Associate ]] (if: not $analystPos and not $VPPos)[[Analyst + VP]] (if: not $analystPos and not $MDPos)[[Analyst + MD]] (if: not $associatePos and not $VPPos)[[Associate + VP]] (if: not $associatePos and not $MDPos)[[Associate + MD]] (if: not $VPPos and not $MDPos)[[VP + MD]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)](set: $elapsedTime += 2) (set: $associatePos = false) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should go next? (if: not $analystPos and not $associatePos)[[Analyst + Associate ]] (if: not $analystPos and not $VPPos)[[Analyst + VP]] (if: not $analystPos and not $MDPos)[[Analyst + MD]] (if: not $associatePos and not $VPPos)[[Associate + VP]] (if: not $associatePos and not $MDPos)[[Associate + MD]] (if: not $VPPos and not $MDPos)[[VP + MD]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)](set: $elapsedTime += 5) (set: $VPPos = false) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should go next? (if: not $analystPos and not $associatePos)[[Analyst + Associate ]] (if: not $analystPos and not $VPPos)[[Analyst + VP]] (if: not $analystPos and not $MDPos)[[Analyst + MD]] (if: not $associatePos and not $VPPos)[[Associate + VP]] (if: not $associatePos and not $MDPos)[[Associate + MD]] (if: not $VPPos and not $MDPos)[[VP + MD]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)](set: $elapsedTime += 10) (set: $MDPos = false) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should go next? (if: not $analystPos and not $associatePos)[[Analyst + Associate ]] (if: not $analystPos and not $VPPos)[[Analyst + VP]] (if: not $analystPos and not $MDPos)[[Analyst + MD]] (if: not $associatePos and not $VPPos)[[Associate + VP]] (if: not $associatePos and not $MDPos)[[Associate + MD]] (if: not $VPPos and not $MDPos)[[VP + MD]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)](set: $elapsedTime += 2) (set: $analystPos to true) (set: $associatePos to true) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should head back? (if: $elapsedTime <= 17)[ (if: $analystPos)[[Analyst]] (if: $associatePos)[[Associate]] (if: $MDPos)[[MD]] (if: $VPPos)[[VP]]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)](set: $elapsedTime += 5) (set: $analystPos to true) (set: $VPPos to true) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should head back? (if: $elapsedTime <= 17)[ (if: $analystPos)[[Analyst]] (if: $associatePos)[[Associate]] (if: $MDPos)[[MD]] (if: $VPPos)[[VP]]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)](set: $elapsedTime += 10) (set: $analystPos to true) (set: $MDPos to true) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should head back? (if: $elapsedTime <= 17)[ (if: $analystPos)[[Analyst]] (if: $associatePos)[[Associate]] (if: $MDPos)[[MD]] (if: $VPPos)[[VP]]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)](set: $elapsedTime += 5) (set: $VPPos to true) (set: $associatePos to true) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should head back? (if: $elapsedTime <= 17)[ (if: $analystPos)[[Analyst]] (if: $associatePos)[[Associate]] (if: $MDPos)[[MD]] (if: $VPPos)[[VP]]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)](set: $elapsedTime += 10) (set: $MDPos to true) (set: $associatePos to true) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should head back? (if: $elapsedTime <= 17)[ (if: $analystPos)[[Analyst]] (if: $associatePos)[[Associate]] (if: $MDPos)[[MD]] (if: $VPPos)[[VP]]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)](set: $elapsedTime += 10) (set: $VPPos to true) (set: $MDPos to true) $elapsedTime minutes have passed. (if: $associatePos)[The Associate is on the far side] (if: not $associatePos)[The Associate is on the near side] (if: $analystPos)[The Analyst is on the far side] (if: not $analystPos)[The Analyst is on the near side] (if: $VPPos)[The VP is on the far side] (if: not $VPPos)[The VP is on the near side] (if: $MDPos)[The MD is on the far side] (if: not $MDPos)[The MD is on the near side] Analyst (1m) Associate (2m) VP (5m) MD (10m) Who should head back? (if: $elapsedTime <= 17)[ (if: $analystPos)[[Analyst]] (if: $associatePos)[[Associate]] (if: $MDPos)[[MD]] (if: $VPPos)[[VP]]] (if: $elapsedTime > 17)[(go-to: "LOSE")] (if: $analystPos and $associatePos and $MDPos and $VPPos)[(go-to: "WIN")] (link: "Restart")[(reload:)]YOU LOSE The meeting has already begun. You took $elapsedTime minutes, and you only had 17 minutes. (if: $analystPos and $associatePos and $VPPos and $MDPos)[At least you got them all safely over the bridge.] (if: not $analystPos and not $associatePos and not $VPPos and not $MDPos)[You didn't even manage to get them all over the bridge.] Don't worry, though, you can try again! (link: "Restart")[(reload:)]YOU WIN They all made it to the meeting in time. Congratulations, you are a master of optimization, this should get you a promotion! (link: "Restart")[(reload:)]