user132451: Yes I know this is a horrible idea and not BIP39 compliant, but please help satisfy my curiosity with this "thought experiment" and applied maths exercise.
Two questions, one for 12 words, the other for 24.
Assuming "perfectly random" entropy to start, and yes the final checksum word gets changed with the new ordering, not itself included in the alphabetical sort.
Just how much entropy is lost in the phrase's re-sorting, compared to the original random sort?
I don't need the "show your work" maths, more like practically speaking about current brute-forcing capabilities,  "you would lose 70% of your entropy, and 40% respectively"
If not too inconvenient, something ELI5 like, how many supercomputer-years of effort's difference?

user76567: The number of possible 12 word phrases (disregarding the checksum) is 2048 ^ 12 = 5444517870735015415413993718908291383296
The number of alphabetically ordered 12 word phrases is

= 11005261717918037175659349191168
The second number is smaller by a factor of 500 million or a reduction of 99.9999998% but you measure such large numbers in bits in which case you get an entropy reduction of 29 bits (132 - 103)

user208: TL;DR: you get around a factor 500 million attack speedup for 12 words, bringing it not quite in the realm of feasible attacks, but it's getting close. For 24 words, the speedup is around a factor half a septillion, but still far beyond the realm of feasible attacks.
Repetition of words or not?
First I need to ask: are words permitted to occur multiple times within the same sorted phrase? If not, Mike D's answer is correct. If they are, the question just got a lot more complicated, at least if you care about the exact numbers.
The difficulty with allowing repetition
Once you allow repetition, the distribution you obtain by sorting uniformly chosen phrases, is no longer uniform. For example the sorted phrase "act act act act act act act act act act act zoo" can be obtained from 12 distinct unsorted phrases ("act ... act zoo", "act ... act zoo act", "act ... act zoo act act", ...). The sorted phrase "mad mad mad mad mad mad mad mad mad mad mad mad" can only be obtained in one way. Thus, if you start with a random unsorted phrase, and sort it, the "act ... act zoo" phrase is 12 times more likely than the "mad ... mad" phrase.
This non-uniformity has a subtle but complicated impact on our question. If the phrases are uniformly distributed, with N possibilities, then it holds that:

The number of distinct phrases is N.
The entropy (in bits) of a sampled phrase is log2(N).
The average number of tries an attacker needs to brute-force guess a sampled phrase is (N + 1) / 2.

When the phrases are not uniform (as would be the case when sorting uniform phrases with repetition), the answer to (2) and (3) cannot be simply expressed anymore as a function of N. It depends on exactly how non-uniform the distribution is. Worse, you can't even compute (3) from (2) or the other way around, because entropy is not a measure for how secure something is, but for how compressible it is. These two are strongly correlated, but not exactly the same, and the difference between the two again will depend on the exact distribution.
This is all to say that the answer to these three questions is distinct, and it depends on what you're interested in:

How many distinct sorted phrases are there?
How much entropy do phrases obtained by sorting uniform unsorted phrases have?
How hard is it for attackers to guess a phrase obtained by sorting a uniform unsorted phrase has?

1. How many distinct sorted phrases are there?
The number of distinct multisets of k elements, drawn from a set of N elements is .

For k=12 and N=2048 that is 11737947382912650038702322439680, or ~2103.211.
For k=24 and N=2048 that is 54640990776272965318633918350257589558711775320768326400, or ~2185.156

Note that these numbers only differ slightly from the corresponding numbers when repetition is not allowed (2103.118 and 2184.767 respectively)
2. How much entropy do phrases obtained by sorting uniform unsorted phrases have?
The entropy of a distribution is how many bits on average an optimal compression scheme needs per element to encode a (long) list of randomly sampled elements from that distribution. For a discrete distribution taking on possibilities a1, a2, ..., an, with respective probabilities p1, p2, ..., pn, that is . By applying this formula to the probability distribution of sorted phrases exactly, you get:

For 12 words: ~103.196 bits
For 24 words: ~185.097 bits

3. How hard is it for attackers to guess a phrase obtained by sorting a uniform unsorted phrase has?
The optimal strategy for an attacker that tries to brute force, and who knows the probability distribution, is to try values from most likely to least likely. The expected number of tries under such a strategy is , assuming the pi are sorted from high to low. Applying this formula to the exact probability distribution in question here we get:

For 12 words: ~(2103.166 + 1) / 2
For 24 words: ~(2184.985 + 1) / 2

In other words, the average time an attacker needs for guessing these sorted phrase distributions is as if they were uniform distributions with ~103.166 resp. ~184.985 bits of entropy (but, as demonstrated in the previous section, that is not exactly the entropy the sorted phrase distributions have).
Summary
The following table summarizes the numbers for all 4 scenarios (repetition allows and not allowed, sorted or not), under all 3 metrics (number of possibilities, entropy, and expected number of tries for an attacker):




12 words
# possibilities
entropy
mean tries




Normal, repetition
2132
132 bits
(2132 + 1) / 2


Normal, no repetition
~2131.953
~131.953 bits
~(2131.953 + 1) / 2


After sorting, repetition (*)
~2103.211
~103.196 bits
~(2103.166 + 1) / 2


After sorting, no repetition
~2103.118
~103.118 bits
~(2103.118 + 1) / 2







24 words
# possibilities
entropy
mean tries




Normal, repetition
2264
264 bits
(2264 + 1) / 2


Normal, no repetition
~2263.805
~263.805 bits
~(2263.805 + 1) / 2


After sorting, repetition (*)
~2185.156
~185.097 bits
~(2184.985 + 1) / 2


After sorting, no repetition
~2184.767
~184.767 bits
~(2184.767 + 1) / 2




(*) = Note that only the lines for after sorting with repetition have distinct numbers in their expressions for the three columns. For all others, they follow the pattern 2v, v, (2v + 1) / 2 for some value v perfectly, because they induce uniform distributions.

132451: <p>Yes I know this is a horrible idea and not BIP39 compliant, but please help satisfy my curiosity with this &quot;thought experiment&quot; and applied maths exercise.</p>
<p>Two questions, one for 12 words, the other for 24.</p>
<p>Assuming &quot;perfectly random&quot; entropy to start, and yes the final checksum word gets changed with the new ordering, not itself included in the alphabetical sort.</p>
<p>Just how much entropy is lost in the phrase's re-sorting, compared to the original random sort?</p>
<p>I don't need the &quot;show your work&quot; maths, more like practically speaking about current brute-forcing capabilities,  &quot;you would lose 70% of your entropy, and 40% respectively&quot;</p>
<p>If not too inconvenient, something ELI5 like, how many supercomputer-years of effort's difference?</p>
 76567: <p>The number of possible 12 word phrases (disregarding the checksum) is 2048 ^ 12 = 5444517870735015415413993718908291383296</p>
<p>The number of alphabetically ordered 12 word phrases is</p>
<p><img src="https://latex.codecogs.com/svg.image?%5Cbinom%7B2048%7D%7B12%7D" alt="" /></p>
<p>= 11005261717918037175659349191168</p>
<p>The second number is smaller by a factor of 500 million or a reduction of 99.9999998% but you measure such large numbers in bits in which case you get an entropy reduction of 29 bits (132 - 103)</p>
 208: <p>TL;DR: you get around a factor 500 million attack speedup for 12 words, bringing it not quite in the realm of feasible attacks, but it's getting close. For 24 words, the speedup is around a factor half a septillion, but still far beyond the realm of feasible attacks.</p>
<h3>Repetition of words or not?</h3>
<p>First I need to ask: are words permitted to occur multiple times within the same sorted phrase? If not, <a href="https://bitcoin.stackexchange.com/a/113440/208">Mike D's answer</a> is correct. If they are, the question just got a lot more complicated, at least if you care about the exact numbers.</p>
<h3>The difficulty with allowing repetition</h3>
<p>Once you allow repetition, the distribution you obtain by sorting uniformly chosen phrases, is no longer uniform. For example the sorted phrase &quot;act act act act act act act act act act act zoo&quot; can be obtained from 12 distinct unsorted phrases (&quot;act ... act zoo&quot;, &quot;act ... act zoo act&quot;, &quot;act ... act zoo act act&quot;, ...). The sorted phrase &quot;mad mad mad mad mad mad mad mad mad mad mad mad&quot; can only be obtained in one way. Thus, if you start with a random unsorted phrase, and sort it, the &quot;act ... act zoo&quot; phrase is 12 times more likely than the &quot;mad ... mad&quot; phrase.</p>
<p>This non-uniformity has a subtle but complicated impact on our question. If the phrases <em>are</em> uniformly distributed, with <em>N</em> possibilities, then it holds that:</p>
<ol>
<li>The number of distinct phrases is <em>N</em>.</li>
<li>The entropy (in bits) of a sampled phrase is <em>log<sub>2</sub>(N)</em>.</li>
<li>The average number of tries an attacker needs to brute-force guess a sampled phrase is <em>(N + 1) / 2</em>.</li>
</ol>
<p>When the phrases are not uniform (as would be the case when sorting uniform phrases with repetition), the answer to (2) and (3) cannot be simply expressed anymore as a function of <em>N</em>. It depends on exactly how non-uniform the distribution is. Worse, you can't even compute (3) from (2) or the other way around, because entropy is <strong>not a measure for how secure</strong> something is, but for how compressible it is. These two are strongly correlated, but not exactly the same, and the difference between the two again will depend on the exact distribution.</p>
<p>This is all to say that the answer to these three questions is distinct, and it depends on what you're interested in:</p>
<ol>
<li>How many distinct sorted phrases are there?</li>
<li>How much entropy do phrases obtained by sorting uniform unsorted phrases have?</li>
<li>How hard is it for attackers to guess a phrase obtained by sorting a uniform unsorted phrase has?</li>
</ol>
<h4>1. How many distinct sorted phrases are there?</h4>
<p>The number of distinct multisets of <em>k</em> elements, drawn from a set of <em>N</em> elements is <img src="https://latex.codecogs.com/svg.image?%5Cbinom%7BN+k-1%7D%7Bk%7D" alt="" />.</p>
<ul>
<li>For <em>k=12</em> and <em>N=2048</em> that is <em>11737947382912650038702322439680</em>, or <em>~2<sup>103.211</sup></em>.</li>
<li>For <em>k=24</em> and <em>N=2048</em> that is <em>54640990776272965318633918350257589558711775320768326400</em>, or <em>~2<sup>185.156</sup></em></li>
</ul>
<p>Note that these numbers only differ slightly from the corresponding numbers when repetition is not allowed (<em>2<sup>103.118</sup></em> and <em>2<sup>184.767</sup></em> respectively)</p>
<h4>2. How much entropy do phrases obtained by sorting uniform unsorted phrases have?</h4>
<p>The entropy of a distribution is how many bits on average an optimal compression scheme needs per element to encode a (long) list of randomly sampled elements from that distribution. For a discrete distribution taking on possibilities <em>a<sub>1</sub></em>, <em>a<sub>2</sub></em>, ..., <em>a<sub>n</sub></em>, with respective probabilities <em>p<sub>1</sub></em>, <em>p<sub>2</sub></em>, ..., <em>p<sub>n</sub></em>, that is <img src="https://latex.codecogs.com/svg.image?-%5Csum_%7Bi=1%7D%5E%7Bn%7Dlog_2(p_i)p_i" alt="" />. By applying this formula to the probability distribution of sorted phrases exactly, you get:</p>
<ul>
<li>For 12 words: <em>~103.196</em> bits</li>
<li>For 24 words: <em>~185.097</em> bits</li>
</ul>
<h4>3. How hard is it for attackers to guess a phrase obtained by sorting a uniform unsorted phrase has?</h4>
<p>The optimal strategy for an attacker that tries to brute force, and who knows the probability distribution, is to try values from most likely to least likely. The expected number of tries under such a strategy is <img src="https://latex.codecogs.com/svg.image?%5Csum_%7Bi=1%7D%5E%7Bn%7Di%7Ep_i" alt="" />, assuming the <em>p<sub>i</sub></em> are sorted from high to low. Applying this formula to the exact probability distribution in question here we get:</p>
<ul>
<li>For 12 words: <em>~(2<sup>103.166</sup> + 1) / 2</em></li>
<li>For 24 words: <em>~(2<sup>184.985</sup> + 1) / 2</em></li>
</ul>
<p>In other words, the average time an attacker needs for guessing these sorted phrase distributions is as if they were uniform distributions with <em>~103.166</em> resp. <em>~184.985</em> bits of entropy (but, as demonstrated in the previous section, that is not exactly the entropy the sorted phrase distributions have).</p>
<h3>Summary</h3>
<p>The following table summarizes the numbers for all 4 scenarios (repetition allows and not allowed, sorted or not), under all 3 metrics (number of possibilities, entropy, and expected number of tries for an attacker):</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th><strong>12 words</strong></th>
<th># possibilities</th>
<th>entropy</th>
<th>mean tries</th>
</tr>
</thead>
<tbody>
<tr>
<td>Normal, repetition</td>
<td><em>2<sup>132</sup></em></td>
<td><em>132</em> bits</td>
<td><em>(2<sup>132</sup> + 1) / 2</em></td>
</tr>
<tr>
<td>Normal, no repetition</td>
<td><em>~2<sup>131.953</sup></em></td>
<td><em>~131.953</em> bits</td>
<td><em>~(2<sup>131.953</sup> + 1) / 2</em></td>
</tr>
<tr>
<td>After sorting, repetition (*)</td>
<td><em>~2<sup>103.211</sup></em></td>
<td><em>~103.196</em> bits</td>
<td><em>~(2<sup>103.166</sup> + 1) / 2</em></td>
</tr>
<tr>
<td>After sorting, no repetition</td>
<td><em>~2<sup>103.118</sup></em></td>
<td><em>~103.118</em> bits</td>
<td><em>~(2<sup>103.118</sup> + 1) / 2</em></td>
</tr>
</tbody>
</table>
</div><div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th><strong>24 words</strong></th>
<th># possibilities</th>
<th>entropy</th>
<th>mean tries</th>
</tr>
</thead>
<tbody>
<tr>
<td>Normal, repetition</td>
<td><em>2<sup>264</sup></em></td>
<td><em>264</em> bits</td>
<td><em>(2<sup>264</sup> + 1) / 2</em></td>
</tr>
<tr>
<td>Normal, no repetition</td>
<td><em>~2<sup>263.805</sup></em></td>
<td><em>~263.805</em> bits</td>
<td><em>~(2<sup>263.805</sup> + 1) / 2</em></td>
</tr>
<tr>
<td>After sorting, repetition (*)</td>
<td><em>~2<sup>185.156</sup></em></td>
<td><em>~185.097</em> bits</td>
<td><em>~(2<sup>184.985</sup> + 1) / 2</em></td>
</tr>
<tr>
<td>After sorting, no repetition</td>
<td><em>~2<sup>184.767</sup></em></td>
<td><em>~184.767</em> bits</td>
<td><em>~(2<sup>184.767</sup> + 1) / 2</em></td>
</tr>
</tbody>
</table>
</div>
<p>(*) = Note that only the lines for after sorting with repetition have distinct numbers in their expressions for the three columns. For all others, they follow the pattern <em>2<sup>v</sup>, v, (2<sup>v</sup> + 1) / 2</em> for some value <em>v</em> perfectly, because they induce uniform distributions.</p>
