Counting Positive Integers in a Set of Numbers

In summary, the conversation discusses a problem involving a set of numbers, some of which are positive integers and some are positive rational non-integers. The individual is trying to find a way to determine the number of positive integers in the set without knowing which numbers are which. They propose using a function that makes the value of any positive integer 1 and the value of any other real number 0, and wonder if this has been done before. The conversation also delves into terminology, with the clarification that it is only considered a set if duplicates do not count. The individual then shares an equation that relates to factoring and finding the number of factors of a given integer. Finally, a proposed solution using prime factorization is discussed.
  • #1
Trepidation
29
0
I have a set of numbers, [tex]n_{1}[/tex] through [tex]n_{z}[/tex]. Some of these n values are positive integers and some are positive rational non-integers.

How can I determine how many are positive integers?

In other words, I have a set of numbers. There are z numbers in this set. I don't need to know which are zeros, which are positive integers, and which are neither... But I need to know HOW MANY positive integers there are.

Perhaps some function that would make the value of any positive integer 1, and the value of any other real number 0? Has that been done?

Thank you ^^.


Note: I don't know anything about formal set theory, so don't take my use of the word "set" to imply that my problem involves that at all. Thanks.
 
Last edited:
Mathematics news on Phys.org
  • #2
This seems essentially impossible. What are you allowed to do with these numbers? I can't imagine being allowed to do anything with these numbers that would allow you to determine what kind of number it is that is any different from knowing what the number is in the first place. For example, you could take the sum of all the number, then take the sum of all the numbers except n1. Is the difference of those two sums zero, and integer, or a non-integer? Answering this question will tell you what n1 is, but this is no different than cheating and knowing what n1 is in the first place. But if you are totally in the dark as to what these numbers are, then you shouldn't be able to determine what the sum of all the number is. In fact, you shouldn't be able to do anything with these numbers that will give you information about what kind of number they are.
 
  • #3
Trepidation said:
Perhaps some function that would make the value of any positive integer 1, and the value of any other real number 0? Has that been done?

You can define any function you want; this would be a fine way to solve your problem.

As far as terminology goes, it's only a set if duplicates don't count. As sets, {0, 0} = {0}; if not, then you're working with sequences, ordered tuples, or something else.
 
  • #4
AKG said:
This seems essentially impossible. What are you allowed to do with these numbers? I can't imagine being allowed to do anything with these numbers that would allow you to determine what kind of number it is that is any different from knowing what the number is in the first place. For example, you could take the sum of all the number, then take the sum of all the numbers except n1. Is the difference of those two sums zero, and integer, or a non-integer? Answering this question will tell you what n1 is, but this is no different than cheating and knowing what n1 is in the first place. But if you are totally in the dark as to what these numbers are, then you shouldn't be able to determine what the sum of all the number is. In fact, you shouldn't be able to do anything with these numbers that will give you information about what kind of number they are.

I do know what n1 is in the first place; I know the identities of all of these numbers in any given instance.

What I mean is that the numbers are given by an equation: [tex]\frac{x}{a} = n_{a}[/tex], where a is equal to every positive integer such that [tex] 2 \leq a \leq x[/tex]. So:

[tex]\frac{x}{1} = n_{1} = \frac{x}{1}[/tex]

[tex]\frac{x}{2} = n_{2} = \frac{x}{2}[/tex]

[tex]\frac{x}{3} = n_{3} = \frac{x}{3}[/tex]

[tex]\frac{x}{4} = n_{4} = \frac{x}{4}[/tex]

...

[tex]\frac{x}{x} = n_{x} = \frac{x}{x}[/tex]

As you can see, this is related to factoring... For any a for which f is evenly divisible by a, na is equal to an integer. For any a for which f is not evenly divisible by a, na is equal to a non-integer. (I apologize, but I was wrong when I said some of the numbers were equal to zero. I had mixed up this problem and the larger problem of which it was a part when explaining... I'm very sorry for making such an idiotic mistake.)

So, to find how many factors (not PRIME factors, just factors in general) any given integer x has, I just need to run it through this algorithm and I'll get a set of integers and non-integers... If I can somehow take that set of numbers and count how many integers there are, I will then have the number of factors of x.

CRGreathouse said:
You can define any function you want; this would be a fine way to solve your problem.

As far as terminology goes, it's only a set if duplicates don't count. As sets, {0, 0} = {0}; if not, then you're working with sequences, ordered tuples, or something else.

I'd like to find an explicit function for this, not simply define it to do what I want it to. Thank you though ^^.

And thanks for the clarification on the terminology!
 
  • #5
Trepidation said:
I do know what n1 is in the first place; I know the identities of all of these numbers in any given instance.
So why didn't you say so?! How did you expect anyone to help you with this problem without telling us what the numbers are?
So, to find how many factors (not PRIME factors, just factors in general) any given integer x has, I just need to run it through this algorithm and I'll get a set of integers and non-integers... If I can somehow take that set of numbers and count how many integers there are, I will then have the number of factors of x.
Let pi be the ith prime number, so p1 = 2, p2 = 3, p3 = 5, etc. Any natural number has a unique prime factorization, and we can write any natural number x in the following form:

[tex]x = \prod _{i=1} ^{\infty} p_i^{a_i}[/tex]

Then x has the following number of factors:

[tex]\prod _{i = 1} ^{\infty} (a_i + 1)[/tex]
 
  • #6
Thanks for your help ^^.

I solved my problem, btw...
 

FAQ: Counting Positive Integers in a Set of Numbers

What is the mean of the set of numbers?

The mean, also known as the average, of a set of numbers is found by adding all the numbers in the set and then dividing by the total number of numbers in the set.

What is the median of the set of numbers?

The median of a set of numbers is the middle number when the numbers are arranged in order from smallest to largest. If there is an even number of numbers in the set, the median is the average of the two middle numbers.

What is the mode of the set of numbers?

The mode of a set of numbers is the number that occurs most frequently in the set. If there is no number that occurs more than once, the set has no mode.

How do I find the range of the set of numbers?

The range of a set of numbers is the difference between the largest and smallest numbers in the set. To find the range, subtract the smallest number from the largest number.

What is the standard deviation of the set of numbers?

The standard deviation is a measure of how spread out the numbers in the set are from the mean. It is found by taking the square root of the variance, which is the average of the squared differences from the mean.

Similar threads

Back
Top