Q2: "A family has two children. You're told that at least one of them is a boy. What's the probability both are boys?"
Note that these are symmetric problems, and must have the same answer.
Q3: "A family has two children. You're told that a gender, that applies to at least one, is written inside a sealed envelope. What's the probability both have that gender?"
In Q3, we have no information. So the answer is the proportion of two-child families that are single gendered. That is, 1/2.
But if we open the envelope, and read what is written inside, the problem becomes either Q1 or Q2. Which have the same answer. So we don't have to open it; whatever the answer to Q1 and Q2 is, opening the envelope in Q3 make its answer the same. If that answer is 1/3, we have a paradox. The answer has to be 1/2 of we don't look.
This is what is known as "Bertrand's Box Paradox." Well, if we add a fourth box to his problem, with one gold and one silver coin. I realize that in modern times the problem itself is called the paradox, but what Bertrand actually wrote (edited to this problem) was "How can it be that opening the envelope suffices to change the probability from 1/2 to 1/3?"
The resolution is that probability must be based on the full set of possibilities, not the possibilities that _could_ result from the full set of _states._ These are the possibilities for this problem:
1) BB and you are told that there is at least one boy. 2A) BG and you are told that there is at least one boy. 2B) BG and you are told that there is at least one girl. 3A) GB and you are told that there is at least one boy. 3B) GB and you are told that there is at least one girl. 4) GG and you are told that there is at least one girl.
Each numbered case has a prior probability of 1/4. Let's say the "A" subcases have a probability of Q/4, so the "B" subcases have a probability of (1-Q)/4.
The answer to the first problem is the probability of case 1, which is 1/4, divided by the total probability of cases 1, 2A, which is (1+2Q)/4. That's 1/(1+2Q).
The answer to the second problem is the probability of case 4, divided by the total probability of cases 4, 2B, and 3B. Which is (3-2Q)/4.
Bertrand's paradox, stated another way, is that these must be equal, but can only be equal if Q=1/2 and both answers are 1/2.
https://en.m.wikipedia.org/wiki/Monty_Hall_problem
Case 1: The prize is behind door #1, and the host must open door #2. Probability 1/3.
Case 2: The prize is behind door #2, and the host must open door #1. Probability 1/3.
Case 3: The prize is behind door #3, and the host has a choice. Case 3A: The host opens door #1. Probability Q/3. Case 3B: The host opens door #2. Probability (1-Q)/3.
If the host actually opens door #1, the probability that door #2 has the prize is (Case 2)/(Case 2 + Case 3A) = (1/3)/(1/3+Q/3) = 1/(1+Q).
If the host actually opens door #2, the probability that door #1 has the prize is (Case 1)/(Case 1 + Case 3B) = (1/3)/(1/3+(1-Q)/3) = 1/(2-Q).
My point is that, since you get to see which door is opened, 2/3 is correct only if you assume Q=1/2. We aren't told what Q is, but we must assume it is 1/2 because otherwise the answer is different depending on which door is chosen.