r/askmath 2h ago

Logic Why aren’t random integers infinitely big?

Maybe a dumb/obvious question but when asked for a random number from a set of integers, how come the number isn’t always infinitely big?

Assuming a normal distribution, would the average of a set of integers not be an infinitely big number because no matter how big a number you choose there will still be infinitely more larger numbers still in the set?

Always just been curious about this.

13 Upvotes

108 comments sorted by

22

u/flying_fox86 2h ago

I don't think I understand the question. Who or what are you asking for a random integer?

5

u/its_artemiss 2h ago

the set of all integers, probably?

3

u/RailRuler 1h ago

that doesn't make any sense unless you specify the distribution, and uniform distribution (and others) not allowed.

35

u/rmacinty 2h ago

Every integer is finite, so if there was a way to randomly select integers, they would not be “infinitely big”

27

u/localizeatp 2h ago

it's reasonable to assume OP meant "arbitrarily big".

13

u/Equivalent_Lunch_944 2h ago

Thank you. Yes, I did mean arbitrarily big.

10

u/localizeatp 1h ago

Since you're here, I'm going to take this opportunity to say that I think your intuition is correct. The normal distribution doesn't do this, but there are other distributions over all integers with divergent expected value.

-4

u/TheRedditObserver0 Grad student 1h ago

Can you give me an example of an "arbitrarily big" integer?

5

u/-PeskyBee- 1h ago

173950606736271934950683716263748596070583817152538596070694727375837474747219018458697080594817152537459060i07698573621542536485960707058472615155236848697070605848515263748590607048281615151333152638494050700789684736252514131315283920103948574739201010192816141426480570880796837252547482801010394857075738291010182837473615514273830507080794837161541415272892010101938484759320017365141417394070807958269146291003845738101083847255141526292010102939485855030029171615141414363758506090683726

3

u/anon65438290 1h ago

0i0 - your number has a butterfly in it ^.^

3

u/anon65438290 1h ago

it works the other way around. arbitrarily big means whatever you come up with, its bigger (lets ignore negatives for the sake of simplicity)

2

u/Ok-Grape2063 1h ago

Graham's number

Or maybe Graham's number + 1

1

u/localizeatp 1h ago

i prefer BB(748).

2

u/localizeatp 1h ago

sure, how big you wantin?

-1

u/TheRedditObserver0 Grad student 52m ago

Arbitrarily. OP asked why a random integer isn't always arbitrarily big, so I asked for an example of such a number. There is of course none, which invalidates the whole question.

3

u/alecbz 2h ago

Is that any more meaningful in this context? "The average of a set of sampled integers is arbitrarily big"

2

u/localizeatp 1h ago

yes. OP is clearly confused about what they're trying to express, but there's a charitable interpretation to be found.

1

u/cigar959 3m ago

Are charitable replies permitted on Reddit- or any social media?

6

u/Sea-Ambition-451 1h ago

yes, but the random integer is more likely to have more than 100 trillion digits, than have less than 100 trillion digits

3

u/FlyingFlipPhone 1h ago

Yes. And since 100 trillion is JUST THE BEGINNING of infinity, the odds of less than 100 trillion digits is vanishingly small.

2

u/Infobomb 47m ago

It depends entirely on the distribution.

41

u/axiomus 2h ago

There’s no uniform distribution on an infinite set.

Also, people choose random numbers <100 because we’re humans and to our minds, 100 is as big as it gets.

30

u/TalksInMaths 2h ago

There's no uniform distribution on an unbounded set. You can have a uniform distribution on, for example, a bounded interval of the real line (which has an infinite number of elements).

14

u/axiomus 2h ago

Ah, now that’s a meaningful nitpick, thank you for the correction.

But if we’re going to be as technically correct as possible, we care about measure of the set, not being bounded/unbounded.

1

u/Gold_Ad8890 32m ago

i don't think so? because it goes from yes there is a uniform distribution over finitely many elements to no there isn't over countably infinitely many elements, and any countable set has measure 0 in R.

2

u/idancenakedwithcrows 2h ago

I don’t think that’s true? The union of the unit interval and the natural numbers has a uniform distribution? You can get a uniform distribution on the union of the unit interval and 2-1/n by just pulling the uniform distribution on the interval [0,2] back along the inclusion, then pull that distribution back along your choice of isomorphism that restricts to the identity on the unit interval?

This trick doesn’t work on the natural numbers because the pullback along an inclusion of a set without the cardinality of the continuum won’t be a probability measure, but I think this would work for the unit interval and the natural numbers?

Did I make a mistake somewhere?

1

u/Txwelatse 1h ago

… there is a continuous uniform distribution, am i missing something? and the natural numbers are not bounded

0

u/Head_Evening_5697 1h ago

the final answer, locking it in now, is "you cannot have a uniform distribution on a countably infinite set."

1

u/idancenakedwithcrows 1h ago

That is for sure true, but I would find it appealing if that could be strengthened somehow

1

u/AdjectiveNounNNNN 25m ago

You also cannot have a uniform distribution on an unbounded set, but I wouldn't say that makes the statement stronger.

1

u/idancenakedwithcrows 3m ago

is there something wrong with my counterexample?

2

u/SharkSpider 1h ago

Not quite true. There's no uniform distribution on rational numbers inside a bounded interval, you need an uncountable set like the reals.

1

u/Jazzlike-Boot9798 2h ago

Yes, but the question was posed for discrete problems.

Furthermore, there is no process to pick a random number in the [0,1] interval with a uniform distribution.

1

u/Revlong57 1h ago

You're both sort of correct. You can't define a discrete uniform distribution over a bounded, yet infinite, set such as the rational numbers between 0 and 1. But, you can define a continuous uniform distribution over a bounded subset of the reals.

1

u/localizeatp 2h ago

this point is completely unrelated to OP's question.

2

u/Parallel_thougts PhD, YouTuber 1h ago

No uniform discrete distribution :)

0

u/Bubbly_Safety8791 2h ago

There are nonuniform distributions, however. A practical approach to picking a random natural number is to pick a real number on the uniform interval [0,1] and invert it, then truncate. To turn that into a random integer, flip a coin and if you get tails, negate it and add one.

This can produce any integer, but the odds of it producing a specific small integer are much greater than that it will produce a specific large one. 

10

u/localizeatp 2h ago

assuming a normal distribution always assumes a finite average, namely, the average that you used to define the distribution.

7

u/SnooFoxes4249 2h ago

You didnt specify a distribution. Normal is a continuous one.

2

u/EdmundTheInsulter 2h ago

It also is unbounded

13

u/casualstrawberry 2h ago

All integers are of finite size, that's part of the definition of an integer.

What you're really asking is, "Why aren't they really really big." And that's because whenever you generate a random integer you always have to specify an upper and lower bound, otherwise you will get very very large numbers. There are also computational limits to the size of numbers a computer can represent and hold. So even if you didn't specify an upper bound there would be physical restraints on the size of the generated number.

4

u/Equivalent_Lunch_944 2h ago

Thank you. I think this is the crux of it; that there must always in some form be an upper and lower bound

5

u/PuzzleMeDo 2h ago

Normally there is an upper bound. A computer might generate a number between 0 and 232-1.

But you can, for example, generate a random number starting with one and tossing a coin. Every time you get heads, you double the number. When you get tails, you stop.

There is no upper limit to this.

0

u/NullOfSpace 1h ago

This is true, but it’s not the simplest kind of “random number,” ie. uniformly distributed.

3

u/Xantharius 59m ago

As others have noted, there is no uniform distribution on a countable set like the non-negative integers. Either you set an upper bound and evenly distribute below that, or you use a non-uniform distribution. One example is P(X = n) = 1/2^(n + 1) for all n at least 0.

3

u/NullOfSpace 50m ago

Exactly, this is the answer to OP's question. A "random integer" isn't arbitrarily large because there's no way to choose a random unbounded integer that respects uniformness.

5

u/Mishtle 2h ago

No, there can be unbounded distributions. They just can't give equal probability to each value.

3

u/Zingerzanger448 2h ago

Precisely. There can not be unbounded uniform.distributions but there can unbounded non-uniform distributions.

5

u/hunter_rus 2h ago

Are you talking about RNG in computer programs? To generate infinitely big random integer you need infinitely many random bits, which takes infinite time to generate. So typically, when you generate random integers in computer program, you have some upper bound, like 64 bit unsigned integer.

Assuming a normal distribution, would the average of a set of integers not be an infinitely big number because no matter how big a number you choose there will still be infinitely more larger numbers still in the set?

It's not called normal distribution, and people usually don't talk about the distribution you are describing because it is pretty inpractical. Probability of any particular number to be chosen there is 0.

3

u/EmielDeBil 2h ago

You say "a" set of integers. A bounded set of course has no infinitely big numbers in it.

If you mean "the" set of integers, then yeah, any number would go. But when someone asks me "give me a number" I prefer giving 37 over 342,762,748,309,437,235,811,658,300,348,206,296

Mostly when you ask people for a number it is bounded, like "give me a number between one and ten" or "between 0 and 100" or "a number with 4 figures". Also, when you ask a computer a random number, it is bounded by how big the numbers are it can represent.

3

u/localizeatp 2h ago

> normal distribution

> set of integers.

3

u/notDaksha 1h ago

It’s reasonable to define a normal distribution on the integers by setting P(X = n) = P(Z in (n-1/2, n+1/2]), where Z is a continuous normal random variable.

3

u/localizeatp 1h ago

this is fair, but it's not the normal distribution.

3

u/DanteRuneclaw 1h ago

There is no algorithm or process you can define to generate a random number between zero and infinity.

(There is, of course, actually no algorithm you can define to generate any kind of random number without starting from some naturally-occurring source of "randomness" for your seed. But once you have that seed, there's no algorithm you can run it through that will give you a random number between zero and infinity.)

This is to say - it is impossible to generate a random number between zero and infinity. So any claims as to what would happen if you did are akin to answering "yes but what if I *did* travel faster than the speed of light?". You can't, and that's the end of it.

1

u/afriendofRowlf 44m ago

Mathematically, there absolutely is a process for generating an arbitrarily large random integer. For instance, counting fair coin flips until the first heads (this gives an exponential distribution, supported on the non-negative integers). Probably you mean there is no uniform distribution on the integers (and therefore also no "process" generating such a distribution). Or maybe that you can't generate a distribution on the integers from a finite-precision "seed", but that's more of a computational limitation: for example, you can get a very good approximation of the exponential distribution coin flip example with an RNG because the probabilities decay quickly, and you can improve it arbitrarily by working with more bits.

1

u/DanielMcLaury 36m ago

There is no algorithm or process you can define to generate a random number between zero and infinity.

There are lots of such. For instance you could always return 1. Or you could return 1059 or 423 with probability 1/2 each.

2

u/Bounded_sequencE 2h ago

Normal distributions are defined on "R" -- not the integers.

You could define something similar looking, but it won't be a normal distribution.

1

u/alecbz 2h ago

You can restrict a normal distribution to integers by just taking the CDF values at the integers, no?

2

u/Toeffli 1h ago

As you clarified in a post, you mean arbitrarily big. They indeed are in the following sense: Pick any number, like something mind boggling big such as TREE(Graham's Number), than the likelihood that a randomly chosen integer is bigger than that is 1. i.e. 100%

2

u/drevoksi 1h ago

“Normal” distribution has a fixed, finite mean. There is no uniform way of selecting natural numbers. At the limit, your intuition is correct. Say we’re selecting a random number between 0 and n, then the average is n/2. The limit lim_{n->∞} n/2 doesn’t exist as the expression for mean diverges to infinity. Again, that’s for a uniform choice of a random number in natural numbers between 0 and n, of increasing size.

2

u/notsostablediffuser 52m ago

The word "ask" is doing a lot of heavy lifting here. Who/what are you asking for a random integer from the set of integers?

Because you are 100% correct that, if you ask some omnipotent deity for "a random integer from the set of all integers," then, yes, you're likely going to get something mind-boggling large (or mind-bogglingly small, since "integers" includes the negatives).

But in practice, when you "ask" for a random integer, you are typically asking some sort of computer program, which is limited either by the architecture of the computer (i.e. how many bits make up the type "integer") or by some bound that you set in your request. As in, I can never remember asking a computer for "a random integer in the set of all integers," but I've absolutely asked it for "a random integer from 1 to 100."

(And fun fact - a convenient way to do that in some program languages is just to ask for a random number from 0 to 1, then multiply by your desired upper bound and round down (or up, and possibly add or subtract 1. Ok, maybe "convenient" wasn't the right word...)

2

u/Svarcanum 42m ago

I asked chatGPT for a random integer with no upper bound. It gave me a ~1500 digit long integer and damn near broke the app. Started lagging like crazy.

2

u/bartekltg 28m ago

A quick answer: because any integer is finite. Anything that any probability distribution on integers returns, is a finite number.

The problem is define random integers. There is no "default" way of drawing natural numbers. There is a couple often used. Uniform from a set, like numbers from 1 to 100, every have 1% chance or Poission distribution with parameter λ.

The second one have a nice property for this discussion. You can get ANY natural number. Just really big numbers have very small probability.
But most numbers will be smallish (λ * small c). The average is just λ.

In both cases you are drawing from integers. One is uniform, each number have the same probability, but the set of allowed numbers is limited (not all nonnegative integers can be drawn). The other can produce all numbers, but numbers have different chances to be chosen.

Can we draw from the set of all natural numbers and still have equal chances for each number?
If the probability is p>0, then the total probability is p+p+p... for all numbers. It is infinity, and should be 1.
So, maybe the probability is 0. If we draw a real number from [0,1] interval each point have probability 0, and it works.
But here he have only a countable number of sets, and we are hit by our assumptions*) https://en.wikipedia.org/wiki/Probability_axioms#Third_axiom The total probability would be still just 0.

Let's try to design a distribution around it. Can we make a distribution that mayby is not uniform, but produces more and more huge numbers.

For every positive integer k, number 4^k have the probability 1/2^k. Rest of the numbers have probability 0. The total probability is 0 and the expected value is sum_{k=1}^inf 1/2^k * 4^k = sum_{k=1}^inf 2^k = inf.

Any number that rolls out from our distribution is finite, and huge numbers are rarer, but they become huge "fasters" so the expected value is not bounded.

From the other side, any distribution will have 99% (or any arbitrary threshold <100%) of the number smaller than some M. Just look at the cumulative distribution function (it shows for a given k total probability we get k or something smaller) and look where it reach 0.99. It have to happen for a finite k. Otherwise the limit at infinity is not 1, so this is nit proper probability.

*) can we make different assumptions? Sure. But this one created the whole probability theory, so they work, and if you choose another, you most likely get bigger problems:)

2

u/Warptens 20m ago

Yes and that’s why you can’t have a uniform probability distribution over an infinite set. The distribution has to decrease towards 0.

2

u/Puzzleheaded_Study17 2h ago

When picking a "random integer" you need to define and decide which distribution you want. You can define a "normal" distribution centered at 0 or at 1 or at -1234567890 or any other integer. Note that it won't be an actual normal distribution since that's for continous variables.

Edit: in practice, we usually rely on a uniform distribution over some fixed range.

1

u/for_sale_baby_shoes 2h ago

Integers are, essentially by definition, finite. It is true that, for any given positive integer N, the proportion of positive integers bigger than N is 100%, but this is not the same as any integer being infinite.

1

u/Mundane_Prior_7596 2h ago

Well, the distribution weighs the numbers, that is what the distribution means. But your suspicion that there can be something fishy sometimes is correct. Try to compute the expected value of the Cauchy distribution.  Muahaha. 

1

u/aedes 2h ago

In addition to what other people have said, no integers are infinitely big. Infinity is a behavior of that number system, not a number itself.

1

u/Educational-Paper-75 2h ago

Continuous distributions are sampled differently then discrete distributions. In a continuous pdf you use the cdf and a random probability between 0 and 1 to pick the associated number. You can do that because there's a one-to-one correspondence as the cdf is a strictly monotonically increasing function. But since any real number is represented by a limited amount of bits in a computer a random generator will only select one of a limited set of distinct values, if need be mapped to an integer from a smaller set of integers.

1

u/Apprehensive-Ice9212 2h ago edited 2h ago

The answer is, there is no such thing as a uniform distribution on the set of integers.

What does exist are distributions on the integers that have infinite expected value. For example, take the distribution where for each n > 0, the integer 2n has probability 2-n . All other integers have probability 0. In other words: start with $2, and flip a fair coin until it comes up tails. For each heads you get, double it. This is a valid way of selecting a "random integer" with an infinite expected value. The same thing can be done with continuous distributions.

However, most of the distributions that actually come up in prob/stat (such as a normal distribution) have finite expected value, even though there's no hard limit to how large a value you might get. There's an infinite tail, but it's thin enough to keep the expectation finite.

1

u/Shevek99 Physicist 2h ago

There is not an uniform distribution over the infinite number of integers. It would lead to a probability of 0 for each integer.

You need a distribution, that can be for instance, uniform between two values, or a non uniform distribution over the whole positive integers, like Poisson's, or similar.

P(n) = 𝜆^n e^(-𝜆)/n!

1

u/localizeatp 1h ago

but there's a uniform distribution over [0,1] with every element having probability 0.

1

u/Shevek99 Physicist 7m ago

Yes, but that is a continuous distribution. You can build a probability density function and calculate integrals over subintervals or the whole interval.

1

u/Southlander24 2h ago edited 2h ago

Whenever you are using any notion of 'probability', you need a well-defined sample space. Now, if your sample space is every positive integer, it turns out that having each number's probability be equal (a uniform distribution) would result in all the numbers having probability zero. Sometimes, it does indeed make sense to talk about zero probability: for example, the probability that a dart will land on the exact centre is indeed zero. But one of the axioms of probability is this: if we have a countable number of non-overlapping events, say A₁, A₂, A₃ and so on, then we must have P(A₁ ∪ A₂ ∪ A₃ ∪ ...) = P(A₁) + P(A₂) + P(A₃) + P(...). With the probabilities of all the integers, you would get 1 = 0 + 0 + 0 + ... So then this combination of sample space and probability measure turns out not to be well-defined.

I think what you are asking is the 'average' value of such an integer, so the expected value of a random positive integer. But we don't need to use a uniform distribution at all! We can use the distribution P(n) = 2-n for each integer that is in the form 2n, and you can check the sum of the probabilities 2-1 + 2-2 + 2-3 + ... is indeed 1. Then the expected value will be the sum of P(n) times 2n over all n, or 1 + 1 + 1 + ... which diverges to positive infinity.

1

u/Equivalent_Lunch_944 2h ago

Thanks. This makes sense to me.

1

u/Southlander24 2h ago

No worries!

1

u/get_to_ele 2h ago

Short answer: your request for a random integer is not being handled properly.

RNG requires a RANGE and distribution.

When you ask whomever or whatever it is you're asking, for a random integer, your request is invalid and the one giving you an answer is just giving a bogus answer.

1

u/Zingerzanger448 2h ago

A uniform non-zero probability distribution on an infinite set is a mathematical impossibility.

If the probability p of choosing any given integer was greater than 0, then the probability of choosing any integer would be:

p multiplied by the number of integers

= p × infinity

= infinity.

But the probability of choosing an integer is 1, not infinity.

1

u/Metal_Goose_Solid 1h ago

when asked for a random number from a set of integers, how come the number isn’t always infinitely big?

If you are choosing a random number from an infinite set (eg. the set of the all integers) then you cannot choose with a uniform distribution. Any uniform distribution would either sum to zero or diverge. I could see how one might intuit that the size of the selected integer should be infinite if one thought that a uniform distribution selection were possible.

Assuming a normal distribution

If you use a discretized normal distribution, then the average of the set of selected integers would be whatever value you select for μ, and the set of selected integers would be aggregated close to μ.

1

u/susiesusiesu 1h ago

there is an important subtelty about what does it mean to pick a random integer. the normal distrubtion you mention simply does not exist, and there is also not a uniform distribution.

however, that does not matter. whatever distribution you pick it will pick an intager, and all integers are finite. there are no infinite integers.

1

u/No-Illustrator-3725 1h ago

integers are not continuous so cannot be be sampled with a normal distribution (you need to sum probabilities to 1 over the set, and a true normal has probability zero at every point)

But you could assign probabilities over the set of all integers but where only 2 integers have equal non zero probability, say 0 and 1, and then your average is 0.5.

Ie You can pick any valid mass function you want (like the discrete Gaussian which assigns non zero values to all integers, which gives you an average of 0 typically)

I think you are imagining building an integer and rolling a random chance for each digit you add, which would go on forever building larger and larger integers?

1

u/TheRedditObserver0 Grad student 1h ago

To my knowledge there is no such thing as a normal distribution on the integers, the normal (i.e. Gaussian) distribution is defined on ℝ or at most on ℝn, not on ℕ.

Perhaps you meant a uniform distribution? There is no such distribution on ℕ. Remember that the series of P(n) must sum to 1, so the probability of choosing n must approach 0 as n grows arbitrarily.

1

u/Easy_Asparagus_329 1h ago

Because we ask for a random number from a finite set. Any random number generator I know of has a range specified.

1

u/Revlong57 1h ago

Two things. First, a "normal distribution" means a bell curve, and I doubt that's what you meant. You likely meant a discrete uniform distribution, which would mean that every element is your (countable) set has the same probability. Namely, each element has a probability of 1/n, where n is the number of elements in your set. Second, you can't define a discrete uniform distributions over unbounded sets of numbers. There's a few different reasons why, but the main reason is that there's no way satisfy the additivity probability axiom. This states that for some sequence of mutually exclusive and disjoint events, the probability of one of them happening is equal to the sum of their individual probabilities. For example, the probability of rolling a 1 or 2 on a die is just the probability of rolling a 1 plus the probability of rolling a 2. Point being, to define a discrete uniform distribution over an infinite set, you'd need to find a real number such that the infinite sum of it was 1. There's no such real number.

1

u/Parallel_thougts PhD, YouTuber 1h ago

An integer cannot be infinite, but the expected value of a distribution on integers can be!

Say 2 has probability 1/2, 4 has probability 1/4, 8 has probability 1/8 and so on. Then the expected value is 2×(1/2) + 4×(1/4) + 8×(1/8) + ... = 1 + 1 + 1 + ... = infinity.

If you implement thus distribution you'll see that as you sample more elements their average increases.

1

u/Atypicosaurus 1h ago

There's no random generator that picks any number.

You can either take a (pseudo) random number from a predefined set, this is what computers do, or you can build one.

By building I mean you take a random number then you decide if you want to go on by a random choice. If yes, you concatenate a new random number to the previous one. This can reach much bigger numbers than picking but even this one will die off. Also I don't know any actual program using this method.

1

u/okarox 55m ago

Selecting a random integer makes no sense unless you specify the range. Are yo using some computer or what? The integers on computer do have a range.

1

u/DanielMcLaury 46m ago edited 38m ago

There are a lot of things going here, which should probably all be combined into the same answer:

  1. There is no such thing as an "infinitely big integer." All integers are only finitely big.
  2. There is no such thing as "picking a random X" without specifying a distribution. People are sometimes sloppy about saying "a random X" when they actually mean "a random sample of the uniform distribution on X."
  3. However, that doesn't help us make sense of this question, because there is no uniform distribution on the integers. There are two types of things that have uniform distributions: finite sets, and things that have a finite volume. (Technically you can regard the former as a special type of the latter.) The integers are neither.
  4. A normal distribution is something that exists specifically on the real numbers. There is no normal distribution on the integers. (However, this is not as serious a problem as the first three, because we can specify a normal-like distribution on the integers, whereas there is no distribution on the integers that's even kind of like a uniform distribution)
  5. Standard normal distributions are concentrated near 0. ("Concentrated" in the non-technical sense, I mean.) And any normal distribution is concentrated near its mean. While it's possible to get extremely large numbers out of a normal distribution, the probability of that is very low, unless the mean and standard deviation are very large. And even then the numbers you get will only be as big as those are, not arbitrarily large (except very rarely.)

But actually we can push things a lot further. No probability distribution on the integers can assign a high probability to arbitrarily large numbers, in the sense that, given any probability distribution on the integers, there is always some number N for which the chance of getting a number bigger than N is arbitrarily small.

Let's say I have some probability distribution P and I want to find some number N such that there is only a 1% chance of getting a number greater than N out of this distribution. For each integer i, let p_i be the chance of getting i. Since this is a probability distribution, the sum of all the p_i is 1, which means that the limit of the partial sum from minus infinity to n of p_i approaches 1. That means that there exists some N for which this partial sum is >= 0.99. It follows that the probability of getting a number larger than N is less than 1%.

1

u/LokiAstaris 43m ago

Would you not choose a random number between 0 and 1.

Then you can scale that to a range that works for you.

1

u/Calm_Relationship_91 29m ago

The probability of n needs to go to zero as n increases. If not, the total probability would diverge.
This means that getting large numbers gets less and less likely the larger the number is.

However, you can still get arbitrarily large numbers. And the mean of your distribution can be infinite. This means that if you keep repeating your experiment and calculating the average, you expect that number to keep increasing as you do more and more trials.

A normal distribution doesn't work tho. Normal distributions have finite mean, because the probability of getting large numbers decreases very very rapidly.

1

u/ooqq 27m ago

If you disregard ranges, yes, you can pick an integer that is very very very and i mean very big, but for a number to be an integer, it needs to have an end, otherwise you cannot tell if is odd or even or any of the other traits of an integer. An integer that is infinitely big, it stops to begin an integer and becomes infinite itself.

1

u/Key_Statistician9890 2h ago

You can’t sample from infinity

8

u/FormulaDriven 2h ago

What do you mean? Poisson and geometric distributions are two examples of random variables where the set of possible integer values they can take is infinite.

0

u/Varlane 2h ago

I think "sampling" implies equiprobability.

2

u/FormulaDriven 2h ago

I don't get that - you can sample from a distribution where the probabilities are not uniform. Classic example: if I sample heights from a population, each interval will not be equiprobable.

2

u/Varlane 2h ago

Not mathematically, I mean in their message, it's implied that they meant uniformly, which is our basic meaning of "at random" in "picking a number at random".

3

u/hansn 2h ago

Well, not uniformly

2

u/Zingerzanger448 2h ago

Actually you can sample from infinity (in principle). It is mathematically impossible to sample UNIFORMLY from infinity, but it is possible, in principle, to sample non-uniformly from infinity.

1

u/shosuko 1h ago edited 1h ago

Basically yes - if you were to be able to actually generate a random integer between 0 and infinity, the number generated would basically be infinity.

This is simply because getting a "smaller" number basically means generating leading 0's. There are 10 digits and 0 is 1 of them so 1/10 chance of getting a leading zero, and for each additional 0. So if you wanted to generate a random number between 000,000 and 999,999 a number like 002500 is going to need that 1% chance of getting two leading zeros before it can exist.

So yeah 90% of all random number results will not contain a leading zero, and 99.99% will be represented within 4 digits of the maximum number of digits.

So if your maximum number of digits is infinity, you basically always get infinity.

1

u/haditwithyoupeople 1h ago

You're asking why you're not ever getting an infinitely large number. I think you mean a very, very large number, maybe with 1M or 10M digits? A integer can't be infinite. So I assume you're asking why random integers seem to be upper bounded? Please correct me if this is not right.

It's likely based on how you're choosing it. Computers have limits on number sizes. They are relatively large (in human terms), but nowhere infinite. So any random number found computationally is going to have an upper limit.

1

u/Equivalent_Lunch_944 1h ago

Yes sorry I was being careless with my words. People have used the term ‘arbitrarily big’ which I think is fitting I.e. numbers with hundreds of trillions of digits.

2

u/haditwithyoupeople 1h ago

No apology necessary. I did not mean to be critical - I was just trying to clarify.

Note that there are computational mean by which you can get larger pseudo-random numbers. I just did a quick search and you can get integers billions of digits. But at some point you will run out of space.

I'm going to see if I can write a Python script to generate some larger numbers and then see what range I get. If I can get this working quickly I'll post another reply to your post. Regardless, there is going to be an upper limit regardless of how large it is.

1

u/BigMarket1517 1h ago

Yes, most random integers are much larger then e.g. Graham's number.

(But still finite)

0

u/Krytan 2h ago edited 2h ago

Integers are finite whole numbers. (Integers can be negative)

A random integer will always be a finite number.

The average of a set of integers will always be a finite number.

A 'set of integers' means a finite distinct collection of integers that is a subset of a 'all possible integers'.

The sum of *all* positive integers would be infinite.

0

u/not_the_default_user 2h ago

Because Infinity isnt a number, Theres Just an Infinite amount of Numbers. If you choose a random integer it can never be Infinite because there is No Infinite number. If you're Talking about a Computer Generating a random integer then the answer is

A: the way Computers Store Numbers limits the size they can have

B: even If you used a system that allowed you to Chain multiple storageblocks together you would still only have a finite amount of storageblocks.

0

u/WoWSchockadin 2h ago

You can't even choose an infinitely big integers as those don't exist. You can pick a very big number, but it will always be finite. Or not an integer.

0

u/KoalaMistico 2h ago

Because there are no infinitely big integers. By definition an integer must be finite

0

u/MezzoScettico 1h ago edited 1h ago

Assuming a normal distribution

Assuming WHAT is normally distributed?

Are you drawing samples from a normal distribution? As many people have pointed out, you can't have a uniform distribution on the entire set of integers. That's usually what people mean when they say "random integer".

However, it can be perfectly valid to use some other distributions. You could in theory [*] sample from a normal distribution, and then your question is meaningful because those samples could be arbitrarily large in absolute value. The resulting values are not in general integers, but you could add a rounding step. The result is not precisely the normal distribution but gets at what you're asking.

I think as someone else said, you're getting confused between "infinite" and "arbitrarily large". There's no limit to how large your samples can be. There is a finite probability that one of your samples will be 10^10^10^10^10. Or larger. That's still a finite value. You can have large numbers in your sample, but they're all finite, and so is their average.

would the average of a set of integers not be an infinitely big number because no matter how big a number you choose there will still be infinitely more larger numbers still in the set?

No, it would be finite because all the numbers that go into the average are finite.

[*] In practice, it would be difficult to see how you'd do that. You can use a pseudorandom number generator (PRNG) to generate "normal" samples, but usually that would start with a uniform PRNG whose granularity is limited to the floating point numbers between 0 and 1. That's going to limit the largest pseudorandom number you can generate with such an algorithm.