Possible Ratios for Integers Between 20 and 70

  • Thread starter Thread starter bugatti79
  • Start date Start date
  • Tags Tags
    Ratios
bugatti79
Messages
786
Reaction score
4
Hi Folks,

I need to calculate the number of possible ratios for the following

R=1- (P1*S2/P2*S1) where P1,P2,S1,S2 are integers between 20 and 70?

Some one came up with a figure of 51*51*51*51 possible ratios but I don't know how this was determined. What branch of Math does this generally fall under...arithmetic sequences?

thanks
 
Mathematics news on Phys.org
I wouldn't know the proper name either but I would venture to say something along the line of Combinatorial Theory?...that sounds fancy...anyway just Combination/Permutation stuff.

Think decimal system, for example, you have two variables P and S and they can take values from 0 to 9...how many different combinations PS can you make? Answer: 00, 01, 02...99; that's going to be a total of 100 or 10x10 (10 for the amount of values each variable can take).

get it?

The same for your case, you just need to count the number of all possible values to each variable to find out the total number of permutations.

...but this is not going to be the total number of ratios of interest to you, since the variables can take on similar values and because 3x5 = 5x3, etc, there will be many instances where your permutations will have the exact same value...so, your total will be less than 51*51*51*51

Hope this helps.
 
Yes it is combinatorics - the site already linked to is the best introduction to this subject on the web IMHO.

514 has been generated simply by noting that there are 51 integers in the range [20, 70], so for each 51 choices of P1 there are 51 choices of S1 making 512 possibilities, and for each of these there are 51 choices of P2 etc.

However this ignores the fact that choices for (P1, S1, P2, S2) such as (a, b, c, d) and (b, a, d, c) will give equal ratios, as will for example (20, 20, 20, 20) and (40, 40, 40, 40). The first one of these can be fairly easily catered for*, but I can't see any way around the second other than enumerating each of the possibilities and calculating them (well I suppose you could look at which integers had common factors and treat them carefully, but this would be a lot harder to program correctly and the computation time even for 1.8 million combinations is insignificant).* there are 512 possibilities for (P1, S1) and for (P2, S2) but we can reduce each of these to (512 +51) / 2 to allow for the swapping P1 and S1 or P2 and S2. The total number of possibilities are therefore reduced to (512 + 51)2 / 4 ≈ 1.8x106.
 
MrAnchovy said:
Yes it is combinatorics - the site already linked to is the best introduction to this subject on the web IMHO.

514 has been generated simply by noting that there are 51 integers in the range [20, 70], so for each 51 choices of P1 there are 51 choices of S1 making 512 possibilities, and for each of these there are 51 choices of P2 etc.

However this ignores the fact that choices for (P1, S1, P2, S2) such as (a, b, c, d) and (b, a, d, c) will give equal ratios, as will for example (20, 20, 20, 20) and (40, 40, 40, 40). The first one of these can be fairly easily catered for*, but I can't see any way around the second other than enumerating each of the possibilities and calculating them (well I suppose you could look at which integers had common factors and treat them carefully, but this would be a lot harder to program correctly and the computation time even for 1.8 million combinations is insignificant).* there are 512 possibilities for (P1, S1) and for (P2, S2) but we can reduce each of these to (512 +51) / 2 to allow for the swapping P1 and S1 or P2 and S2. The total number of possibilities are therefore reduced to (512 + 51)2 / 4 ≈ 1.8x106.

Thanks guys,

Not sure I follow the * description. Could you elaborate a little further..? When you say the first one, are you referring to (20,20,20,20)?
I guess this going to be tricky to implement in excel...!
cheers
 
Sorry, (20, 20, 20, 20) was a terrible example, let me try again to make it a bit clearer:

... However out of the 514 possible permutations, many of them will give equal ratios.

Consider P1=a, S1=b, P2=c, S2=d (from now on I will write this as (a, b, c, d). This gives the ratio ad/bc, but exactly the same ratio is given by (d, c, b, a), (d, b, c, a) and (a, c, b, d). It is tempting to think that we can simply divide 514 by 4 but this will not treat the situation when a=d or b=d correctly. What we actually want is the number of combinations (a, d): this is given by (512+51)/2. So the total number of ratios with distinct numerators and denominators wil be taking all (512+51)/2 possible numerators with all (512+51)/2 possible denominators. This will give approximately 1.8x106 possibilities.

There is a further category of duplicated ratios, for example (20, 21, 22, 23) and (40, 42, 44, 46) but I can't see any easy way to eliminate these other than enumerating each of the possibilities and calculating them (well I suppose you could look at which integers had common factors and treat them carefully, but this would be a lot harder to program correctly and the computation time even for 1.8 million combinations is insignificant).

Note that the current version of Excel has just over 106 rows per sheet so it might be possible to enumerate these over 2 sheets, but I have no idea whether that is feasible from a memory/recalc time point of view.
 
MrAnchovy said:
Sorry, (20, 20, 20, 20) was a terrible example, let me try again to make it a bit clearer:

... However out of the 514 possible permutations, many of them will give equal ratios.

Consider P1=a, S1=b, P2=c, S2=d (from now on I will write this as (a, b, c, d). This gives the ratio ad/bc, but exactly the same ratio is given by (d, c, b, a), (d, b, c, a) and (a, c, b, d). It is tempting to think that we can simply divide 514 by 4 but this will not treat the situation when a=d or b=d correctly. What we actually want is the number of combinations (a, d): this is given by (512+51)/2. So the total number of ratios with distinct numerators and denominators wil be taking all (512+51)/2 possible numerators with all (512+51)/2 possible denominators. This will give approximately 1.8x106 possibilities.

There is a further category of duplicated ratios, for example (20, 21, 22, 23) and (40, 42, 44, 46) but I can't see any easy way to eliminate these other than enumerating each of the possibilities and calculating them (well I suppose you could look at which integers had common factors and treat them carefully, but this would be a lot harder to program correctly and the computation time even for 1.8 million combinations is insignificant).

Note that the current version of Excel has just over 106 rows per sheet so it might be possible to enumerate these over 2 sheets, but I have no idea whether that is feasible from a memory/recalc time point of view.

1) That makes things a little clearer although I am still not sure how you arrived at (51^2+51)/2?

2) So there is no easy way of deriving a neat expression that determines all ratios without duplicates in Combination/Permutation Theory?

3)Also on a slight tangent. For the simpler case of 1-S1/P1 for each variable between 20 and 70. This would mean 51^2. But what in the case where P1 varies from 20 to 70 and S1 from 20 to 30. We would get 51*(11)=561...right? I would like to write this using the nth power. So to find the required power to base 51 we take logs...ie

51^n=561 implies n=1.6099. But its difficult to get exactly 561 with this method right?

thanks
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
I'm interested to know whether the equation $$1 = 2 - \frac{1}{2 - \frac{1}{2 - \cdots}}$$ is true or not. It can be shown easily that if the continued fraction converges, it cannot converge to anything else than 1. It seems that if the continued fraction converges, the convergence is very slow. The apparent slowness of the convergence makes it difficult to estimate the presence of true convergence numerically. At the moment I don't know whether this converges or not.
Back
Top