# Formula for contamination scoring system

I am trying to create a scoring system to show how contaminated a sample is.My aim is for the formula to yield one overall score, to indicate how "concerning" a sample is, i.e. the more it is contaminated, the more concerning it is - let's call this overall score the "Concern Index", CI. The CI could be on a min-max scale of 0-100, and anything that's over 100 could just be designated 100+.

Each of the chemicals has a government issued "allowed limit" ("AL), i.e. an amount of chemical that can be present in a sample, without being of concern to human health, and above which is of concern.

So for a single chemical test, it might make sense to make a simple percentage. However, for each sample we will will test for 400 chemicals. Most of the 400 chemicals will come back as 0 detected. But some usually come back as detected and a concentration (amount detected, "AD") is given.

The best result I can imagine is that none of the 400 chemicals is detected. The realistic "worst case" result might be that 10 chemicals are detected, all at 100% of the allowed limits. In reality though, we often get a distribution of results, for example:

Chemical A---0.076---1.125---7%

Chemical B---0.5-----0.75----67%

Chemical C---0.145---1.875---8%

I feel the formula needs to additive in that if two chemicals are detected at 30% of AL, this would get a more higher score, than one chemical at 30%.

I feel however that it should not be a case of just adding the percentages, I mean adding the numbers 30+30=60 (I realise this is not how you add percentages, but I don't know how to describe this). The reason I think this is because if in SampleX we have Chemicals A,B,C,D, E and F detected at 40%,25%,20%,15%,10% and 5%, NONE of the chemicals have exceeded the allowed limit set by the government and therefore should not be of concern by themselves, yet the food is getting a rating of 100+, which indicates it has failed.

Perhaps the addition of each of theses could be weighted in some way, so each additional chemical detected does increase the overall score, but as long as none of the chemicals individually go over 100% of of the AL for that substance, then the overall score, CI, won't go over 100. This is just a suggestion, but I don't know how to write this formula.

Chemical-----%AL------Rank

Chemical A---7%-------3

Chemical B---67%------1

Chemical C---8%-------2

My idea would be to use the rank, so for the 1st rank 100% of the %AL is considered, 2nd rank less (f2), and 3rd rank even less (f3). So, for example:

CI = %AL1 + %AL2(f2) +%AL3(f3) f2= 100-%AL1 f3=f2-((%AL2*f2)/100) fn=fn-1-((ALn-1*fn-1/100)

So for SampleX CI = 67 + (8f2) + (7f3) f2 = (100-67)/100 = 0.33 f3= .33 - ((8*f2)/100) = 0.3036 And CI = 67 +(8*0.33) + (7*0.3036) = 71.77, or 72.

As you will note from the above, I am not much of a mathematician, but I would appreciate comments on this proposed approach and any suggestions to improve it. Thank you.

Your post is quite confused, and I'm not sure to have completely understood your question. Anyway, I try.

I assume that given are a set of chemicals $$C_i$$, for $$i \in \{1,2, \ldots, n\}$$, and, for every chemical, a score $$s(C_i) \in [0,1]$$ with the meaning that \begin{align} a_i &\to 0 \text{ if presence of chemical i is good},\\ a_i &\to 1 \text{ if presence of chemical i is bad}.\\ \end{align} The aim is to define a score $$s(C_1,C_2,\ldots, C_n)$$ that summarises the good/bad presence for all the chemicals $$i \in \{1,2, \ldots, n\}$$.

My suggestion is to try by defining $$s(C_1,C_2,\ldots, C_n) = 1-\prod_{i=1}^n(1-s(C_i)),$$ where I used the capital Pi notation for the product.

### Example (1):

if two chemicals are detected at $$30\%$$ of AL, this would get a more higher score, than one chemical at $$30\%$$

Given $$\begin{cases} s(C_1) = 0.3,\\ s(C_2) = 0.3,\\ \end{cases}$$ we obtain $$s(C_1, C_2) = 1- (1-0.3)\cdot(1-0.3) = 0.51$$

### Example (2):

if in SampleX we have Chemicals A,B,C,D, E and F detected at $$40\%$$,$$25\%$$,$$20\%$$,$$15\%$$,$$10\%$$ and $$5\%$$, NONE of the chemicals have exceeded the allowed limit set by the government and therefore should not be of concern by themselves, yet the food is getting a rating of $$100+$$, which indicates it has failed.

Given $$\begin{cases} s(C_1) = 0.4,\\ s(C_2) = 0.25,\\ s(C_3) = 0.20,\\ s(C_4) = 0.15,\\ s(C_5) = 0.10,\\ s(C_6) = 0.05,\\ \end{cases}$$ we obtain $$s(C_1, C_2, C_3, C_4, C_5, C_6) = 1- (1-0.4)\cdot(1-0.25)\cdot(1-0.20)\cdot(1-0.15)\cdot(1-0.10)\cdot(1-0.05) = 0.73837$$

### Example (3):

Chemical-----%AL------Rank

Chemical A---7%-------3

Chemical B---67%------1

Chemical C---8%-------2

Given $$\begin{cases} s(C_1) = 0.07,\\ s(C_2) = 0.67,\\ s(C_3) = 0.08,\\ \end{cases}$$ we obtain $$s(C_1, C_2, C_3) = 1- (1-0.07)\cdot(1-0.67)\cdot(1-0.08) = 0.717652$$