I was given this question by a friend and tooled around with it a bit in excel. I'm sure I could brute force it, but I wanted to see if people smarter than me could help me optimize this and find a mathematical way to solve it.
The problem is this: You have a character in a text box. You want to make as many characters as possible using only 100 keystrokes. The possible keystrokes are Ctrl+A (select all), Ctrl+C (Copy), and Ctrl+V (Paste). The text starts unselected with nothing on the clipboard. Of course, there is the 2^x growth characterized by
- Ctrl A 2. Ctrl C 3. Ctrl V... and repeat to get 2^x growth
But even in my experimentation if you paste a few more times before selecting and copying, you can easily outpace 2^x growth.
So my question is, how can I represent this mathematically so I can optimize it and find the best combination of select/copy/paste?