Categories
-
Recent Posts
Recent Comments
Tags
- a-ha moment
- algorithms
- anagrams
- binary trees
- birthday pairings
- Dynamic Programming
- finance
- geometric progressions
- graphs
- interview questions
- linked lists
- logarithms
- mathematics
- monte carlo
- numpy
- permutations
- prime numbers
- probability
- programming
- puzzle
- puzzles
- python
- quants
- recursion
- shortest path
- simulations
- stirling's approximation
- yield curves
- zero curves
November 2024 M T W T F S S « Mar 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Archives
Meta
Author Archives: nolfonzo
Alternating coin toss – redux
I want to revisit a probability puzzle from a previous post: see Alternating coin toss game. You play a game where you alternate tossing a coin with a friend, and the first person to toss heads wins. But let’s make … Continue reading
Puzzle – Take your seats
Another problem that has an immediate intuitive answer, but can be tricky if you don’t have that insight. Question Let’s say there are 100 people, including you, waiting to board a fully booked flight, each with an assigned seat. The … Continue reading
Puzzle – Leaning Tower of Pisa
Let’s say you drop a ball from the Leaning Tower of Pisa, which is 179 ft high, and it bounces back 10% of the dropped height – 17.9 ft. Then on the second bounce it bounces up 10% again – … Continue reading
Puzzle – Break a stick to get a triangle
I read somewhere this is a Google interview question: Let’s say you drop a stick, breaking it randomly in 2 places, leaving you with 3 smaller sticks. What’s the probability you can make a triangle out of the 3 resulting … Continue reading
Puzzle – 4 Bugs chasing each other
The answer to this problem is either really obvious, or it’s not. Say there are four bugs standing at the corners of an imaginary 1m * 1m square. Each of the bugs is facing the bug that is on the … Continue reading
Puzzle – Liars and Truthtellers
This is another probability question that seems straightforward but can be deceptive… You’re an FBI agent and have been monitoring a large gang, and you know that 1/4 of its members always tell the truth, the rest always lie. Then … Continue reading
Puzzle – shortest road system
Let’s say you’re contracted to build roads to connect four towns that are at the corners of an imaginary square with sides 1 mile. What’s the shortest length of road system you can build so that every town can get … Continue reading
Puzzle – Clock
It’s 3 O’Clock. What will be the time when the minute and hour hands are next in the same position (coincident)? One way to solve this problem: start with the minute hand at the 12 and hour hand at the … Continue reading
More puzzles…
Some of these are from Heard on the Street – a book of interview questions for Quants I’m trying to get through. Well worth a read if you’re into this sort of thing… 1. Two ropes of different lengths, and … Continue reading
Mth to last – a recursive approach in Python
A collegue of mine was pondering the mthToLast problem for a LinkedList I’d blogged about previously and sent me the following IM message: just a guess – but can you use recursion to solve your link list m problem? a … Continue reading