I'll muse on X for a bit.
If X is too large - such as when designers make puzzles comparatively easy to solve yet difficult to execute - then it can lead to player frustration.
I remember the infuriated screams of one of my friends as he played Tomb Raider. He had figured out which jumps to make, and he knew when and where to make them, but because the timing was so delicate, he ended up failing too many times. When he finally made it to the next area, he was still quite angry about having wasted so much time. I saw his fiero change from a potentially cheerful "Hurray, I did it!" to an angry "Finally!" Not only that, but the negative emotions of his frustration likely overran the "Cool" emotion he would have felt at discovering and exploring the next level.
That brings up an interesting aside. One player behavior I've noticed frequently in myself is that I prefer to save games in the middle of levels. After completing a level, I find that my curiosity about the next level is so high, I seek relief (Cool!) by going and exploring it. Once that need has been met, I feel more comfortable ending the game session.
Back on topic, an example of highly variable X can be found in Shadow of the Colossus, where players fight nothing but bosses called colossi. Each fight is a puzzle, and depending on the boss, the battle requires more or less dexterity of the player. For a few of the colossi, once I figured out how to defeat them, I killed them on my very next attempt. For most of the colossi, it took me a few tries once I solved the puzzle. And, for a few of the colossi, it took me a frustratingly large number of attempts to take them down even after I knew exactly what to do.
So, how do we keep X from becoming frustratingly large? I think that after players have solved a puzzle, they should be able to execute the successful strategy in just one or two tries. X can (and probably should) be greater for boss fights, since players have emotionally invested more in the game by the time they reach a boss, and will be more tolerant of failure.
On the opposite end of the spectrum, if X is too small, it may be possible for designers to prevent players from savoring their "Aha!" moments by overwriting them with potentially more powerful "I did it!" moments. Then again, if players are allowed "I did it!" right after "Aha!," the effect of both forms of relief might be magnified. It warrants observation.