News for hackers. Stuff that matters.
Re:What Is an “Almost Prime” Number? by alangpierce on Saturday November 03, 2018 @11:07PM (#18373913)
Similar amusing math terms are "almost everywhere" and "almost surely"/"almost never". For example, if you pick a random real number between 0 and 1, it will almost never be exactly 0.5. It's possible that you'll get 0.5, but the probability of getting it is exactly 0.

https://en.wikipedia.org/wiki/Almost_everywhere

https://en.wikipedia.org/wiki/Almost_surely

Re:What Is an “Almost Prime” Number? by yantrams on Saturday November 03, 2018 @11:52PM (#18374100)
Remember coming across this concept while reading about Measure theory. There are also concepts like "almost well-ordered" and "almost complete" in graph theory if my memory serves right.
Re:What Is an “Almost Prime” Number? by anyfoo on Sunday November 04, 2018 @12:11AM (#18374168)
Something applying to “almost all” elements in a (preferably infinite) set: Applies to all elements, with the exception of a finite number of elements.

For example, almost all prime numbers are odd.

Re:What Is an “Almost Prime” Number? by jhanschoo on Monday November 05, 2018 @02:21AM (#18380489)
A warning: in general mathematical usage, this is not the definition of "almost all"; the notion of "almost all" is with respect to some notion of measure on a set. In the set of real numbers, for example, with the usual Lebesgue measure on it, if all but a /countable/ number of elements has a property X, then almost all the reals has that property X. (Note that uncountable sets in R exists that have zero measure; i.e. uncountable sets that "almost no" points in R lie in that uncountable subset of R)
Re:What Is an “Almost Prime” Number? by anyfoo on Monday November 05, 2018 @07:00PM (#18387106)
Ah. "With the exception of finitely many" [1] was the definition given to me in University. The generalization makes sense, however.

[1] I don't think I'm doing a good job translating the original German definition I was given, which sounds much better: "Mit Ausnahme endlich vieler".

Re:What Is an “Almost Prime” Number? by jhanschoo on Thursday November 08, 2018 @05:01AM (#18405348)
Ah, in English "all but finitely many" is indeed very commonly used, and rarely is "almost all" defined to have that sense.
Re:What Is an “Almost Prime” Number? by yantrams on Sunday November 04, 2018 @12:35AM (#18374244)
Exactly! I can't remember where but I distinctly remember some theory quantifying this as almost-1, almost-2,... as a function of the number of finite (or countably infinite maybe) exceptions.
Re:What Is an “Almost Prime” Number? by perl4ever on Saturday November 03, 2018 @11:50PM (#18374095)
I think the proper interpretation of that is that you can't "pick a random real number between 0 and 1". After all, you would have to choose an infinite number of digits.
Re:What Is an “Almost Prime” Number? by AaronFriel on Sunday November 04, 2018 @12:16AM (#18374187)
You absolutely can "pick a random real number between 0 and 1", at least for the sake of mathematical argument. But for an interval [a, b] a random real number will be x s.t. a <= x <= b is zero. That's because the set {x} has measure 0.

An even more fun fact is that the probability that the randomly chosen number is rational is also zero, by the same argument.

However, once one starts to try to describe a distribution over the reals, e.g.: "let X be a real number chosen from a uniform probability distribution over [0, 1]", then you run into serious problems. That example begs the question because there is no uniform probability distribution over that set.

Re:What Is an “Almost Prime” Number? by thaumasiotes on Sunday November 04, 2018 @01:05AM (#18374348)
There definitely is a uniform probability distribution over the interval [0,1]. It is given by the probability density function f(x) = 1. There's no uniform probability distribution over the reals, or over the integers, but defining one over a closed real interval is trivially easy. That's what "pick a random real number between 0 and 1" means.
Re:What Is an “Almost Prime” Number? by AaronFriel on Sunday November 04, 2018 @01:20AM (#18374393)
I don't believe there is a uniform probability distribution over any interval of the reals.

Suppose such a distribution existed over [0, 1]. Then as we have shown before, the probability of choosing 0 <= x <= 1 is zero.

The second axiom of probability states the probability of one of the numbers being chosen must be is one. The third axiom requires countable additivity.

We can easily see that for our distribution, we cannot satisfy both at the same time. If we strive for the sum of probabilities to equal 1, then we end up with the sum(P(x)) = 1, but P(x) is everywhere zero.

The countable additivity never enters into this, but for any uncountable set of events a uniform distribution is impossible.

Re:What Is an “Almost Prime” Number? by thaumasiotes on Sunday November 04, 2018 @01:45AM (#18374465)
> I don't believe there is a uniform probability distribution over any interval of the reals.

Then I'll observe that you probably shouldn't be trying to comment on this topic. I didn't just assert that there is one, I pointed out to you what it was.

The probability density function f(x) = 1, defined over the interval [0,1], is uniform (all values are equal, being 1) and covers an area of 1. That's all a uniform distribution is.

It satisfies the axiom which I assume you're referring to as the "second axiom of probability" in that the definite integral of the pdf over the entire interval is 1. It satisfies the requirement you're confused about in that the probability of choosing a number that falls into either of two disjoint subintervals is equal to the sum of the probabilities of (1) choosing a number falling into the first subinterval; + (2) choosing a number falling into the second subinterval.

> Suppose such a distribution existed over [0, 1]. Then as we have shown before, the probability of choosing 0 <= x <= 1 is zero.

For fixed x, the probability of choosing x from a uniform distribution over the reals is 0. That is a special case of the probability that a value chosen from a uniform distribution over the reals will lie within an interval. The probability of drawing a value from within the interval [a,b], for any distribution, is the definite integral of the distribution's pdf from a to b. As you can see, when a = b, this value is 0, but when a ≠ b, it isn't. The probability of choosing an x such that 0 <= x <= 1 from a uniform distribution over [0,1] is 1, not 0.

Re:What Is an “Almost Prime” Number? by AaronFriel on Sunday November 04, 2018 @03:16AM (#18374847)
Oh gosh, you're correct. It's been a while since I've done this (well).
Re:What Is an “Almost Prime” Number? by gustavpaul on Sunday November 04, 2018 @05:15AM (#18375155)
Much respect for confirming to the rest of us reading this thread that your interlocutor's argument is the better one / yours is wrong. Having determined the correct answer, we all walk away correct, regardless of who was corrected.
Re:What Is an “Almost Prime” Number? by maththrowawtays on Sunday November 04, 2018 @01:22AM (#18374560)
You won't be able to find a countable union of sets of just one point which covers [0,1], so the third axiom you state is not violated.

In fact, like the law says, if you take such a countable union, the measure of the set will be 0 (e.g. the rationals).

If you're going to hold that the sum of measure for all points is 1, you're not going to be able to make any continuous distributions at all. The thing is, the assignment of measure does not work like this, as in you don't just add up the measure of all the points to get the measure of the whole set. Instead, measure is also assigned to subsets of [0,1] (in particular too all the sets in the sigma algebra of your choosing). There are some laws which prevent you from whatever probabilities to everything (such as the one you mentioned about countable unions), but there is nothing that says it has to be the sum of the probability of the points.

Re:What Is an “Almost Prime” Number? by mcphage on Sunday November 04, 2018 @12:12AM (#18374174)
Well, you can do that if you have the Axiom of choice.
Re:What Is an “Almost Prime” Number? by perl4ever on Sunday November 04, 2018 @12:23AM (#18374210)
My brain is fuzzy tonight, and I'm not good at math, but something about the distinction between countable and noncountable infinities makes me question the axiom of choice. I can't precisely state the issue, but something seems off and inconsistent.
Re:What Is an “Almost Prime” Number? by yantrams on Sunday November 04, 2018 @12:33AM (#18374235)
A recent twitter thread that could be helpful - https://twitter.com/johncarlosbaez/status/105620018913060044...

And this from the same thread :)

https://pbs.twimg.com/media/DqhjmPdU4AAb979.jpg