2 ms·
That doesn't seem right. Assuming: 1. A tweet can be anywhere from 0 to 140 bytes. 2. Each byte can have any one of 256 possible values. Then the number of
by ubernostrum 17y ago
That doesn't seem right.
Assuming:
1. A tweet can be anywhere from 0 to 140 bytes.
2. Each byte can have any one of 256 possible values.
Then the number of possible tweets is 256^0 + 256^1 + 256^2 + ... + 256^140 (the sum of number of permutations at each length in bytes).
If I remember my number theory correctly, the sum of the first n powers of a number, k, is (k^(n+1) - 1)/(k - 1). Or, in this case, (256^141 - 1)/255. Which is a much larger number than the one you just gave.
- derefr 17y agoA tweet is a zero-terminated string. It's 256^140, as the rest of the series can simply be unified with their representations padded with zeros.
- ubernostrum 17y agoDepends on how you want to define a tweet, I guess, but 256^140 is still a larger number than quoted in the post I replied to.
- patio11 17y agoI tried calculating 8^140. Eight bits in a byte, you know. This is what happens at the end of a week of crunch. (On the plus side, you guys aren't paying me for what I'm writing today.)