The existence of three envelopes is just to aid with the understanding of the scenario. It all happens behind the scenes and is invisible to the participant for the purposes of determining the probabilities involved, and so is irrelevant to the scenario. I could have just as easily hypothesized a machine that randomly fills a single envelope with one of two specified amounts (M/2 or 2xM) which it either leaves as an alternative in the second scenario or gives to the participant in the third scenario.
For those wanting a more concrete challenge, I submit the following, which may also help elucidate or possibly confound what is going on.
Imagine that the games master is an expert mathematician, and he has two envelopes, which he says he had a machine fill with money according to some random process he programmed into it and fully understands. He gives you one envelope and holds onto the second
Scenario A)
He peeks into your envelope runs off and makes some calculations and say “interesting, according to my calculations based on the way the machine works, and the amount contained in this envelope there is a 50% chance this other envelope contains either twice that amount and a %50 chance it contains half that amount, do you want to take it instead?”
Scenario B)
Same scenario but this time he peeks into his own envelope. and makes the statement that according to his calculations your envelope contains either twice or half of what his does with equal probability.
Which should you pick in either situation or does it make a difference?
Answer:
In this case it does make a difference and you should pick whatever envelope he didn’t look in. This is different from the OP situation because the probability of double or half is calculated based on the amount actually observed in one of the envelopes and the underlying process. So it really is M in the observed envelope and either M/2 or 2*M in the other.
What is not possible is to design a machine such that no matter which envelope is picked and what the value is inside it, that there is always a %50 chance the other contains either double or half the amount of the one that was looked at.
As long as the player doesn’t know the bounds, would a machine that always picks a multiple of 2 work (is that the right way to describe it: 10, 20, 40… or 8, 16, 32… for example)? So you look in an envelope that contains $128, the other has a 50% chance of being $64 and a 50% chance of being $256. If you had picked the (let’s say) $256 envelope instead of the $128 one, you wouldn’t know if the first contained $128 (which it does) or $512.
Of course, if you know there is a lower bound, then when you get a $2 envelope, you can know the other one is $4. Similar if the machine is 16 bits you would know to always keep $65536. It still wouldn’t help you if you peeked and saw $32768.
Going back to earlier in the thread, if we don’t have to worry about whole dollars and cents, then any value could work, because it could always be halved or doubled. $8.92675 could be paired with $4.463375 or $17.8535.
Not as specified in my revised version. In that version the master was specified as knowing the full distribution of the machine outputs, including any upper and lower bound and the probability of each, and it is after looking at this and taking it into account that he makes his final observation.
This is just going in loops.
If the envelope filler nonrandomly puts, say, x and 2x dollars in two envelopes and the chooser is given no further information then no, repeat no, formula for expected winnings can be given based on opening the first envelope.
Yes, you can write down a formula but it is completely without any basis since you don’t know how the 2nd envelope’s value was chosen.
The other main option is to claim that some random process was used to decide the contents of the envelopes. But as quite clearly stated there is no such random way of doing this that doesn’t have at least one major problem.
And, in some scenarios given here, it really is just like the naïve (that is wrong) analysis of the Monte Hall problem. People think that since there are two options therefore the odds are 5050.
I think we are mostly in agreement, but I am not sure I am correctly understanding some of the things you wrote.
I agree with the above entirely
I agree that trying to do calculations based on an assumed random process is incorrect since we don’t know what process was used, but I disagree that no random process could have generated the envelopes. I gave three possible processes in my first post.
This statement confuses me. We aren’t assuming all odds are 5050 because there are two options, we are assuming that all odds are 5050 because in the formulation of the problem it specifically stated that getting half or double had “equal chance”.
Ah, but is Monte:

Picking a door at random amongst the doors you didn’t choose and opening it (and just happened to reveal a goat), then giving you the choice of switching?

With full knowledge of where the goats are, opening a door to revealing a goat, and Monty then offers you the choice of switching, and he must perform this exact process every time the game is played for every contestant

With full knowledge of where the goats are, opening a door to reveal a goat, but this doesn’t happen every time the game is played, and its completely up to Monte as to when to offer the choice of switching
With 1. you have an equal probability of getting the prize by switching doors.
With 2. you have a greater probability of getting the prize by switching doors.
With 3. you have anywhere between 0% and 100% chance of getting the prize by switching, as a devious Monte could (for example) only offer the choice when contestants initially picked the correct door.
The only way you’re going to know the odds is if you know for certain whether the rules are 1,2, or 3 ahead of time. Imagine you’re the first or second contestant ever on Monte Hall, and you have no idea what the rules are other than what is presented to you. One could maybe logic that 1. doesn’t really make much sense for an entertaining game show, but could you completely rule out 3.?
Its somewhat the same thing here with this. Until the second envelope is flipped over with the same statement as the first envelope, you have incomplete information as to the rules of the game, and can’t correctly assign a probability to keep/switch. Up until that moment, one could assume there there were originally three envelopes, (x, 1/2x, and 2x) with x given to you and the other two pulled from a hat, so it makes sense to switch based on the theoretical third envelope. Its only when the second envelope is flipped over when the theoretical third envelope vanishes from existence, and so does the increased EV for switching.
Most of the wordings of the Monte Hall problem I’ve seen explicitly state option 2. But I agree if that is not stated then its not clear that switching is best.
I still disagree with your second point though. If there there is a 50/50 shot that the second envelope contains either half or twice as much as the first then by definition there is the same 50/50 shot for the second envelope, because if the second envelope has double the first, then the first envelope has half the second and vice versa. So turning over the other envelope provides no additional information.
The question is what information did the person who made the 50/50 claim arrive at that conclusion use to make that claim. The must know something about the method used to put the money in envelopes or else they couldn’t have come up with the 50/50 claim. The question is whether they used any knowledge of the envelope contents.
The three possible cases are,
 They used no knowledge of envelopes contents in making the prediction and both could be random. There is no way to decide what to do in this case.
 They used knowledge of the first envelope’s contents in making the statement and so knew that since that envelope had $X then the second must randomly contain either $2X or $X/2 with equal probability, and if the player knew this was how the probability was chosen the player should switch
 They used knowledge of the fsecond envelope’s contents in making the statement and so knew that since that envelope had $X then the first must randomly contain either $2X or $X/2 with equal probability and so if the player knew that this was the way the probabilities were calculated he should stay.
There is no case 4 where they know the contents of both envelopes since in that case there can be no randomess and no probability.
In the case like the OP where both envelopes are closed then we have no idea and no good way to go forward.
However, as in some versions of the problem the player opens the envelope and then after seeing it the game master makes his claim then it could be argued that Case two was in effect or else the games master was lying, about his best guess as to the probabilities and so you should switch.
Exactly. Let’s say that we know our envelope contains $10 but what we don’t know is whether the second envelope contains $5 or $20. With the analysis I see here, it seems once we switch (and let’s say it is the $5) some are saying what if the first envelope was half of that one so $2.50. Likewise it could be $40. No. If B is double the amount then A is half of that and if B is half then A is double that. Since each is equally likely the expected value of switching envelopes and back is 0.5(2 x 0.5) + 0.5(0.5 x 2) = 1 or in other words the amount you started with.