One of the students (Itay?) asked why an attacker cannot build his own k-long chain offline (without publishing) and then add it later on to make the recent k-1 blocks go to waste or even worst yet remove from the chain blocks that were already far from the end and considered "confirmed". I wanted to give a more elaborate answer as I'm not sure I correctly interpreted the question.
1. An attacker with > 50% of the power can definitely do this.
2. An attacker with < 50% can do this but for a relatively small k and cannot remove blocks that have been confirmed. First, it is important to note that when you create a block you include the hash of the block that you extend in your block. Accordingly, the puzzles you solve depend on the block you chose to extend (you cannot create a detached chain and then append it in an arbitrary place). This means that you need to outrun the longest chain in order to perform such an attack. As we explained, the probability of that decreases exponentially with k.





