When is a variable chosen for a card in which that variable is not defined by the card itself?When deciding X, is it decided by the effect including X or is it decided by choosing an X and then resolving the effect with X in it? 2a. The variable is chosen whenever it is necessary to resolve the effect. So for Vamp, you do not have to set the value of X until the run is successful. For Psychographics, you have to set the value when playing it because it is part of the cost. So option 1 is correct.
2b. X is a value that is set at one time. So you spend X credits from Vamp, but you cannot spend more credits than you have. With Power Shutdown, you trash X cards from your deck, but you do not see the cards that are trashed until X is defined. You cannot trash more than the number of cards in your deck, either.
Imagine that the runner has 3 tags and an installed copy of Donut Taganes. As the corporation with a heap of money, I play Psychographics. What is the maximum I am able to pay, and what will the effect be? You cannot pay more than 3 for Psychographics due to the restriction on the card. So with Donut installed, you can pay 3 (2 +1 for Donut) and then place up to 3 advancement tokens on a card.