Possible Ratios for Integers Between 20 and 70

  • Thread starter bugatti79
  • Start date
  • Tags
    Ratios
In summary: 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), (a, c, b, d), (b, a, d, c), (c, d, a, b), and (b, c, d, a). These are all just different ways of arranging the same numbers to get the same ratio. So we need to take these into account when calculating the total number of possible ratios
  • #1
bugatti79
794
1
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
  • #2
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.
 
  • #3
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.
 
  • #4
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
 
  • #5
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.
 
  • #6
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
 

What is the purpose of calculating possible ratios?

The purpose of calculating possible ratios is to determine the relationship between two or more quantities. Ratios are often used in scientific research to compare data and make predictions.

How do you calculate a ratio?

A ratio is calculated by dividing one quantity by another. For example, if you have 20 apples and 10 oranges, the ratio of apples to oranges would be 20:10 or simplified to 2:1.

What are some common types of ratios?

Some common types of ratios include simple ratios, compound ratios, and inverse ratios. Simple ratios compare two quantities, compound ratios compare three or more quantities, and inverse ratios compare two quantities that have an inverse relationship.

How do you express a ratio?

Ratios can be expressed in three ways: using a colon (e.g. 3:1), using a fraction (e.g. 3/1), or using the word "to" (e.g. 3 to 1). It is important to be consistent when expressing ratios in a scientific context.

What are some real-life applications of calculating ratios?

Calculating ratios has many real-life applications in fields such as finance, engineering, and biology. For example, in finance, ratios are used to analyze a company's financial performance. In engineering, ratios are used to determine the strength of materials. In biology, ratios are used to study genetic inheritance patterns.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
Replies
6
Views
4K
Replies
66
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
805
Back
Top