Sample Paper IMMC
Sample Paper IMMC
Summary
The problem of homeless pets and worsening feral pets living conditions have caught the attentions
of the IMMC-A. Henceforth we have been tasked to determine if a household is suitable for adopting
a cat and other different species.
In task 1 (the warm up), we first researched on the factors that we thought would affect the evalua-
tion. Then, we determined the deciding factors, those that had a big impact on the result; Namely
Purchasing power, area of household etc. For the next step, we quantified all the elements for
efficient and straightforward investigation. However, we believed that simply quantifying the factors
would not give us an accurate representation and score for an accurate index; Thence, we decided to
normalize the factors such that it gives a fair index. Finally, we made use of the Analytic Hierar-
chy Process to generate weight coefficients and have completed the first version of the model.
For task 1a, we selected Hong Kong as the region for the households for model validation, and chose
6 households with varying income level, house area, and environment. Then, using the above model,
we evaluated their readiness to receive a cat.
Considering task 1b, we have chosen UK, USA and Hong Kong as the regions good for cats; Not
only do they have diverse environments, but they also have sufficient data for analysis, we believe
that these characteristics will improve the accuracy of our model. After selecting the countries, we
assigned values for each factor with Probability Density Functions for all 3 countries. Finally,
we constructed normal distributions for better analysis.
Regarding task 2, we were tasked to generalize our model and allow it to consider other species. Sim-
ilar to task one, we have researched and chosen 4 distinct pets: Dog, Tegu, Hamster, and Parrot.
These pets were not only popular, but had varying lifestyles and different handling requirements, we
believed that this would allow us to make our model more diverse.
After that, we have re-quantified a selection of individual factors to match our new species, this
allows our model to give out more accurate results tailored for the new species. For the next step,
similar to re-quantifying the factors, we have also decided to remake our weighting matrices.
After initializing the new generalized model, we have evaluated the same 6 households in task 1a on
their readiness to get the 4 species on the above as pets respectively. Some households are not ready
to receive a dog or a tegu, but all households are suitable for a parrot and a hamster.
Finally for task 2b, we created radar charts for each species of pet, with 7 vertexes each representing
one factor; We calculated the overlapping area of 2 pets and obtained the compatibility score for the
pair. After that
Considering task 3, we were tasked to project future pet ownership and retention. To project the
future pet demographics, we have decided to investigate on the change of each factor over time. After
that, we simply substituted in the values of 5, 10 and 15 years and evaluated the percentage changes.
Finally we multiplied the results into the 10000 set of generalized data in task 1b and calculated the
change in the score; We believe this would give us an accurate prediction.
2024 IM2 C
Page 2 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
After thorough analysis of affecting factors of the household and the cats, our team has discovered
a model that can accurately evaluate the readiness of a household for cats and other species of pets,
based on the few inputs needed.
For the model, we have considered regional factors like the hygiene and the community support
offered for pets within the region. Additionally, we have also considered factors for individual pets
like the desired climate and the noise level they are comfortable with. By combining these 2 aspects
of factors, we are confident the model will be able to generate an accurate appropriacy score for the
household to own a specific pet.
Regarding the solution, our model is already capable to evaluate the readiness for a household to
adopt a pet; Unfortunately, we do not have the expertise to provide a thorough evaluation regarding
if a household is really suitable for a specific household. Henceforth, we sincerely hope the profes-
sionals at IMMC-A with adequate knowledge can aid our model towards perfection by retrieving
actual data and adjusting the weights of our model via the pairwise comparison matrix.
Additionally, the threshold for determining if a household is suitable is also not perfectly accurate, we
hope professionals will put our model in use to increase the accuracy of our model. The threshold can
be changed depending on if there are too many or too little households that meet the requirement.
By the process of trial and error, the model can be further corrected.
Last but not least, combining on our model’s evaluation and detailed background check, more house-
holds can prepare themselves for adopting a pet with the lowest cost, which would definitely improve
the situation regrading homeless pets or pets with horrible living conditions.
To encapsulate, our model is capable of generating scores and evaluation on paper; However, words
are unfounded, and a combination of actual deployment and our mathematical model is required to
generate an accurate result.
Yours faithfully,
Team#2024020
IMMC24384887
2024 IM2 C
Page 3 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
Contents
1 A Feline Warm up 4
1.1 Question Analysis and Restatement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Generating factor scores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Preliminary Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Selecting the factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.3 Quantifying the factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Weighting generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3.1 Matrix evaluation and improvement . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 Model Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.4.1 Highlights of Households that qualify . . . . . . . . . . . . . . . . . . . . . . . 13
1.4.2 Highlights of Household that do not qualify . . . . . . . . . . . . . . . . . . . 13
1.5 A broader Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.5.1 Data Distribution of factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4 Conclusion 23
4.1 Model evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 Strength of model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3 Things to Improve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
References 23
A code 26
2024 IM2 C
Page 4 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
1 A Feline Warm up
1.1 Question Analysis and Restatement
We are asked to first build a quantitative model to compute a household’s readiness for cat owner-
ship. The model, being used by pet stores and animal shelters, will intake no more than 10 factors
to be more user-friendly.
1. Find out all factors that affect house readiness for pets
2. Choose at most 10 factors that are most appropriate for our model
3. Quantify each factor and transform it into a score that can be normalized for summing up. We
call it a factor score.
4. Generate the final readiness score by determining how important each factor is and sum up
all the scores with appropriate weighting.
1. Community support: Outdoor activity space, veterinary care, and pet stores nearby are
important to cats. [1]
2. Purchasing Power: Lack of purchasing power may cause a lack of cat food, medication, and
other products, which may worsen the living conditions of the cat and the financial stress of
the owner. [2] [3]
3. Hygiene: Illness and infections from the environment may lead to discomfort and fatigue in
the cat. [4] [5]
4. Time In House: The time when the owner stays home affects the bonding, stress levels, and
the mental health of the owner and the cat. [6] [7]
5. Allergy: Allergic reactions, discomfort often causes mutual disgust and between the owner
and the cat. [8] [9]
6. Noise Level: Loud noises may trigger fear and anxiety in cats, which can lead to various
health issues. [12] Moreover, irreversible damage to a cat’s hearing abilities is also possible.
[13]
7. Climate: The climate situation of the household can also affect the health of cats, and temper-
ature is considered to be the most important factor in deciding whether the climate is suitable
for cats. [20] In order to keep the model’s user friendliness, we decided to only focus on tem-
perature as the only climate factor. Cats are susceptible to heatstroke and dehydration in hot
weather. [15]
2024 IM2 C
Page 5 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
8. Topology of House1 : There may be safety hazards or dangerous elements in the house which
may cause damage to the cat. [16] Moreover, insufficient size of the house may also lead to
stress and anxiety. [17]
9. Compatibility with animals: Some house plants are toxic to cats. Moreover, cats may see
other pets as prey. [36]
There were some other factors, such as the demographic of the household and the emotional status
of the owner. However, they are out of our consideration since they may have little to no effect on
the result. Besides, emotion cannot be easily modelled and to collect data on.
Note that these factors are indeed exhaustive for all pets and we will keep referring to the list at a
later stage.
Quantifying Community Support The support by the community and neighborhood is easily
the most important factor to consider, as the community is what provides the majority of resources
and services. To measure how much community support each pet can receive, we decided to consider
the “pet to vet” ratio of the region the household is situated in.
Number of cats in region X
R(X) = (1)
Number of vets in region X
Note that the vet to pet ratio is a predetermined constant, only dependent on the region situated.
So, the input for this factor is the name of the city.
By seeing how much veterinary care a pet can receive in a community, we can effectively measure
community support. Nevertheless, this does assume something.
1
we define a house to be the living area of a household
2024 IM2 C
Page 6 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
Assumption 1
The population density of cats and vet clinics/vets are uniform within the input
region. This is so that we can gather sufficent data to approximate the pet to vet ratio of
any place in the world. In an ideal situation, the customer flow of the nearest clinics
should be measured.
To compute the score, we first found out that a vet sees about 30 pets a day[52], and a pet sees a
vet about 3 times a year [53], and a vet usually have about 250 days of work in a year [54]. This
comes out to a pet to vet ratio of R = 2500. So, for this standard vet to pet ratio, we take its score
to be 0. The optimal pet to vet ratio is 0, meaning that a vet doesn’t see any other pets besides the
cat of the household. So, we need a score function to satsify:
So, we decided to use a logistics function to model the score function. After some tweaking with the
parameters, we found the below function to be most appropriate.
2
SCommunity Support = −1 (2)
1 + exp (0.002(R − 2500))
However, we have made an assumption in the data collection process. The number of pet visits (and
other data collected later) are dependent with respect to the age of cats.
Assumption 2
We assume all cats in question are adult cats, as to ensure the consistency of data collected.
Quantifying Purchasing Power Prospective owners need to afford various things such as food,
medical care, toys, etc. Not only can cats worsen the financial burden for low-income households,
but also not being able to afford these pet necessities can be detrimental to the cat’s physical and
mental health.
So, we need to measure the ability to provide for a cat. Although the direct way of using
the income is trivial, it cannot capture the specificity of cats, as the cost of cats can differ from
other pets. After knowing that the cost of raising a cat is 1800 USD per annum in USA [18], and
neglecting the marginal one-off cost of getting a cat in the first place. We see that the score for this
1800
factor can be expressed as Annual salary (USD)
. However, this model would not account for the different
2024 IM2 C
Page 7 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
commodity prices worldwide. It probably costs less than 1800 USD to have the same necessities
in other countries. Therefore, we modify the above model to account for the commodity prices by
considering the “cost of living index” of a city. We can get the cost of raising a cat by multiplying
1800 to the ratio CCUXSA , where CX is the cost of living index in the household country/city X and
CU SA is the index for USA, which is 72.9. Therefore, we have
1800CX
I = Income ratio = . (3)
72.9 × Annual salary (USD)
The input is the city name and the annual salary. To transform the income ratio into the
factor score, we have to consider the fact that 30% of the income should be spent on non-necessities
[55]. So, S = 0 when I = 0.3. Moreover, once the income ratio exceeds 50%, it starts consuming the
cost of necessities[55]. Therefore, S = −1 when I = 0.5. We then measure the score linearly with
I using these 2 points. However, S > 1 when I < 0.1. So, we have to bound S at 1 when I < 0.1,
which is still reasonable. If your pet costs less than 10% of your salary, then of course it would be
worth it. So, we have
1 if I ∈ [0, 0.1]
SPurchasing Power = − 0.2 (I − 0.3) if I ∈ [0.1, 0.5]
1
(4)
−1 if I > 0.5
Quantifying Hygiene The hygiene of the environment is obviously essential for the optimal
living conditions for both the owner and the cat, as it could be detrimental for the cat and the
owner’s health. In theory, the hygiene of the household should be measured. However, this is not
user friendly, and it is impossible for us to gather data on this aspect. Therefore, we will consider
the hygiene levels of the community to determine the score. The input for this factor is again
the city/country name.
Assumption 3
The hygiene level of the household is similar to that of the input region the household is
situated in.
To measure the hygiene level of the input region, we have found 3 indexes commonly known for
measuring health and hygiene of a specific country, region; Namely the Global Health Security Index
(GHS Index), Environmental Performance Index (EPI) and the Percentage of People Using Basic
Sanitary Devices (WSH_SANITATION_BASIC). Then, we took the average of the 3 scores of 173
countries (The number of countries present in all 3 indexes), and normalized them to form the hy-
giene index.
We then need to transform this index into a score. Note that even in the most unhygienic countries,
cats (and in fact pets in general) are not significantly affected by the outdoor hygiene. Therefore,
any outdoor hygiene can be accepted. In other words, we need not create a negative score. For this
2024 IM2 C
Page 8 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
factor, we need to find a way to transform the index into a non negative score.
While max-min normalisation is a trivial approach, it was rejected since it is not very accurate with
outliers. Here, we first use the z-score normalisation method.
Take the mean of the scores as µ and the hygiene index of the nth highest ranked country as s(n) for
the following normalization process.
1 X
173
µ= s(n) = 59.28921002 (5)
173 n=1
v
u
u 1 X 173
σ= t (s(n) − µ)2 (6)
173 n=1
Then, we replaced the score of each country according to the following equation, let’s call z(n) the
standard hygiene score of the nth highest ranked country.
s(n) − µ
z(n) = (7)
σ
Finally, we conclude our normalisation process by transforming the standard score to a score between
0 and 1. We accomplish this by using the normal distribution projected from the definition of the
standard hygiene score. By considering the bell curve graph, we can define an area function that
considers the fraction of area under the bell curve from −∞ to z(n).
Z
z(n)
1 (x − µ)2
SHygiene (n) = √ exp − dx (8)
−∞ σ′ 2π 2σ ′2
Quantifying Time in House It is without a doubt that cats, just like humans, require compan-
ionship and accompany; Henceforth it is plain to see the time of which the owner stays in the house
is a deciding factor. According to source , owners should spend at least 30 minutes a day with their
cats[56], meaning we need S = 0 when time spent at home, call it T (hours), satisfy T = 0.5. To
continue, we have to assume the following:
Assumption 4
• Everyone sleeps 7 hours a day. This is taken from the average sleeping hours worldwide.
[57]
• All tenants within a household are working adults, who leave the house for work and
return at the same time.
This allows us to intake the user-friendly input of Weekly working hours2 , and transform it to
daily time at home to be:
Weekly Work hours
T = 24 − −7 (9)
7
Consequently, we see that any time above 8 hours of home time is optimal by considering the 8:8:8
hour ratio of sleep, work and leisure time. It is also easy to see that 0 hours is the least desirable.
In other words, we need S = −1 when T = 0 and S = 1 when T ≥ 8. For simplicity, we model the
score function linearly.
2T − 1 if T ∈ [0, 0.5]
STime in house = 15 (T − 0.5) if T ∈ [0.5, 8]
2
(10)
1 if T > 8
Note: The time of which the owner stays in the house can also be modified into an input for more
accurate results, as we have not reached the 10 input limit.
Quantifying Noise Level Considering the noise level, being too noisy could be disturbing or even
damaging for both the cat and the owner. For reference, cats hear sound comfortably at 60 - 80
dB, and sound above 80 dB be uncomfortable to cats, or cause harm to their hearing abilities if the
sound is prolonged.[14] At the level of over 120dB, even short and sharp sound can harm a cat’s
hearing abilities.[13] Note that anything below 80 dB is considered to be acceptable, and there is no
such thing as the optimum noise level the household should achieve.
Henceforth, the SNoise Level should stay at 0 when the noise is less than 80dB. It should decrease to -1
when the noise level reaches 120 dB. To ease the modelling progress, we suppose the score function
to decrease linearly. Therefore, we have
(
0 if Noise level < 80dB
SNoise Level = (11)
max{−1, − 40 (Noise level) + 2} if Noise level ≥ 80dB
1
In theory, the noise level indoors should be measured. but to account for user-friendliness, we assume
the following:
2
Usually the weekly hours is collected instead of daily on monthly in online sources
2024 IM2 C
Page 10 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
Assumption 5
The noise level indoors is similar to that outdoors, and the noise level is evenly distributed in
the community.
This allows us to intake city name only and reference existing databases to find the noise level
in later tasks. In an ideal situation, the noise level should be measured indoors with
something like an app.
Quantifying Climate In the realm of feline needs, similar to humans, climate plays a crucial role
in determining the comfort of the cat. Therefore, in this case, this aspect undoubtedly becomes
very important. On account of this, we researched about the suitable temperature, highest sur-
vival temperature, and the lowest survival temperature of cats, which is 27.5◦ C, 38◦ C and -6.67◦ C
3
respectively. Denote the household’s temperature by E ◦ C[21][22]
Given the fact that cats are more cold-resistant than heat-resistant, we need an asymmetrical score
function about the line E = 27.5. We also need the score to be non-negative since all households
maintain a healthy temperature for humans and thus cats. The score function here adds a bonus
score for when the climate outdoors is suitable for cats. We decided to use 2 normal distributions, one
for temperatures below 27.5◦ C, and one for above. Let’s denote it as N1 (27.5, σ12 ) and N2 (27.5, σ22 ).
We believed that the 2σ range should fall between the mean and the lowest/highest survivable tem-
perature respectively. So, σ1 = 27.5−(−6.67)
2
and σ2 = 38−27.5
2
. Finally, We normalised the distribution
such that S = 1 when E = 27.5. This gives us
f (E) = √h exp − 1 E−µ 2 if E ≥ 27.5
SClimate = σ 2π 2 σ 2 (12)
g(E) = √k exp − 1 E−µ if E < 27.5
σ 2π 2 σ
1 1
where the factors h = −
and k = are used for normalisation.
f (27.5 ) f (27.5+ )
Quantifying Household Topology The topology of a house is important for considering cat
adoption because it affects the cat’s safety, comfort, and overall well-being. Moreover, there could
be potential hazards in a household which could endanger the cat. That said, we can only quantify
the area of the house .
3
The 0.01◦ C comes from Fahrenheit conversion
2024 IM2 C
Page 11 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
While using the area of living space directly is intuitive, we also have to consider how cramped the
living area is. An easier way of measuring how cramped a living space is looking at how many people
are living inside the living area. Let’s say a household has n occupants. The average living area
used by a single person is 20m2 . So, the extra room left for the cat would be Area of house − 20n.
We found out that a cat needs at least 4m2 of extra area to itself[73]. Therefore, the minimum
requirement is that the area of house can accommodate 4m2 more than the space used up by the
owners. This corresponds to S = 0. Then we design the score function to increase as the the number
of 4m2 chunks increase. We believe that the unacceptable case is when there is no extra space for
the cat, corresponding to S = −1. Therefore we have,
1
SArea = [Area of house (m2 )] − 20n − 1 (13)
4
bounded by -1 and 1.
There is a multitude of ways we can accomplish this. Here, we decided on the approach of Ana-
lytic Hierarchy Process. It is a well known algorithm for Multiple-criteria decision analysis
than can transform “subjective” common sense and non-numerical information into an “objective”
numerical weighting, which is less prone to human error. It should be noted that this algorithm is
usually used to find out an optimal decision based on layers of criteria. Here, we only have one layer
with 7 criteria. However, we will still use a critical part of this method to find out the weightings,
with the help of a modelling book we found online. [75]
This crucial part of the AHP is called a Pairwise Comparison Matrix. We select 2 distinct factors
at a time from the 7 factors and compare them on which is more significant on cats. Let’s say we
are comparing factor i with factor j. We define a value aij as follows:
aij
1 If i is as important as j
3 If i is slightly more important than j
5 If i is more important than j
7 If i is obviously more important than j
9 If i is absolutely more important than j
2,4,6,8 For the levels in-between
Note that aij = a−1 ji . Using this method, we can generate a pairwise comparison matrix PCats :=
[aij ]7×7 . Using some online sources, common sense, and questionnaires, we ran the pairwise compar-
ison algorithm and we developed the following matrix:
1 1/4 6 1/5 7 7 3
4 3 9 9 5
1 7
1/6 1/7
1 1/6 3 3 1/2
5 1 7 7 6
PCats = 1/3 6 (14)
1/7 1/9 1/3 1/7 1 1 1/6
1/7 1/9 1/3 1/7 1 1 1/6
1/3 1/5 2 1/6 6 6 1
2024 IM2 C
Page 12 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
Note that the factors down the row and to the right of the column corresponds to community sup-
port, purchasing power, hygiene, time in the house, noise level, climate, and area of the house in
sequential order. To give some examples, the 2 boxed entries correspond to 2 pairwise comparisons.
One is that purchasing power is absolutely more important than noise, thus giving a52 = 19 ; the other
is that community support is slightly more important than area, thus giving a17 = 3.
To find out the weighting coefficients, we are asked to compute the eigenvector of PCats with the
largest real eigenvalue, i.e. the solution wCats of
PCats wCats = λCats wCats (15)
with the largest λCats ∈ R. Using an online calculator, we obtain the required solution to be wCats =
(0.1484, 0.3872, 0.0459, 0.2906, 0.0234, 0.0234, 0.0812)T with λCats ≈ 7.749. These are in fact the
weights of the factors respectively. Since the factors scores are rated above 0 if and only if the
conditions are acceptable, The threshold for the final score is 0.
Household 1 2 3 4 5 6
Community Support 410 410 410 410 410 410
Purchasing Power 966 2615 14816 710 3860 7120
Hygiene 0.871 0.871 0.871 0.871 0.871 0.871
House Time a Day 0.876 6.81 9.19 3.95 8.92 13.4
Noise Level 91 63 86 54 77 68
Area of House 16.64 61.8 87.5 42.4 102.6 42.07
Number of People in House 1 3 5 2 3 1
Allergies no yes no no no no
Unfortunately, one member in household 2 is allergic to cats, and therefore his household is not
suitable. Hence, we will no longer consider the readiness score of household 2.
Note that some factors in the above are the same among all households. This is because these factors
are location dependent, and in this case all households are located in Hong Kong.
After measuring the data in the households, we put the data in our model and calculated the following
result:
From the above, households 1 and 4 are not suitable because their readiness scores are negative.
Viewing their respective data, we can see that households 1 and 4 have a much lower income,
available time, and house area compared to households 3, 5 and 6.
In the beginning, we thought of checking the score of the minimum percentile of the population
to determine the size of suitable population. However, this assumes that for each household, their
ranking of all of the factor are the same which is completely wrong.
Therefore, to simulate the number of households that are prepared to own a cat, we decided to take
the following approach:
1. Research and get data on the distribution of the 3 non-regional factors of Hong Kong, USA
and UK respectively.
2. Project the data with the best-fit probability density function (PDF) (normal distribu-
tion or a gamma distribution function), using existing curve-fitting software such as matlab
histfit
3. Randomly select 10000 samples based on the probability density function and substitute the
samples to check the suitable population size. In order to randomly select a data z according to
the distribution, we first generate a random number in the range (0, 1) to represent a random
area under the PDF where P (Z < z). Then we find the inverse of the PDF and the required
random data can be obtained by z = F −1 (rand(0, 1))
4. Using the data generated in PDF and regional factors, evaluate the readiness score of each
sample, and calculate the ratio of suitable households to all households.
Figure 7: Probability density and 10000 samples of USA working hours, each sample marked as a
green dot
2024 IM2 C
Page 15 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
Figure 8: Probability density and 10000 samples of UK income, each sample marked as a green dot
Normal Mean SD
Gamma α β
UK Area 80.91408591 13.90037377
US Income 1.242360581 8.2485553
UK Time 35.70522388 10.99598599
UK Income 2.354943918 4.8598581
HK Time 41.94174 25.7638
HK Area 6.935983427 2.3241705
HK Income 27828.68 15947.92
US Area 34.42321446 143.97866
US Area 2250.263992 844.8247088
After simulating the data of all 10000 households in a large database we used the model we derived
to count the number of prepared households. Fin
1. Dogs: The first choice that came to our minds, being a man’s best friend, there is no question
for this selection.
2. Fishes: Another popular choice, however its simplistic lifestyle makes us rethink if a math
model is really needed.
3. Parrots: An exotic species favoured by many senior pet owners, its difficulty of maintenance
creates huge obstacles.
2024 IM2 C
Page 16 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
4. Hamsters: A popular choice for many newbie pet owners, this may seem like a trivial exclusion.
However, few know about the difficulty to handle them; Combined with how easy they can get
ill, more consideration is needed.
5. Rabbits: They may seem cute and easy to handle; However few know about how easily they
can get injured if badly handled.
6. Tegus: A relatively rare choice, however it is the most popular lizard to own with many
enthusiast being deeply interested in them.
Note: we have decided on specific species for lizards (Tegus) and birds (Parrots) as the spectrum of
species is diverse, with too much data to consider.
We have also found a multitude of other pets, like ferrets and guinea pigs, but their popularity
is relatively low compared to the most popular ones; Henceforth we have decided not to further
investigate on them.
A special case: Lizards Lizards are very sensitive to their environment and equipment, however
due to these restrictions, we have further investigated on the lizards’ living environment and found
out they live in isolated facilities. [37] Henceforth we have decided that only purchasing power is
meaningful to re-quantify when considering lizards.
Quantifying Purchasing Power Similar to that of cats, we will be considering the cost per an-
num (excluding the price of adopting the animal) and the cost of living index of the region. Finally,
Spurchasing power (X, Y ) would be the index we are looking for and PY would be the cost per annum
of handling pet Y . Combined with the variables provided previously, we get the following 2 formulas:
PY C X
I(X, Y ) = Income Ratio = .
72.9 × Annual salary (USD)
(
1 if I(X, Y ) ∈ [0, 0.1]
SPurchasing Power (X, Y ) = (17)
− 0.2 (I(X, Y ) − 0.3) if I(X, Y ) ∈ [0.1, 0.5]
1
2024 IM2 C
Page 17 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
Quantifying Noise Level This is also another simple aspect to quantify, no new variables are
added. (Note: lizards live in an isolated environment so they do not need a new quantification.)
Quantification of noise levels:
(
1 if x < 85
Dog [46] [47] 85 dB 140 dB ndogs =
− 55
1
x + 3911
if x ≥ 85
(
1 if x < 85
Hamsters [50] [51] 85 dB 125 dB nhamsters =
− 40
1
x + 33 if x ≥ 85
8
1 if x < 85
Parrots [48] [49] 95 dB 104 dB nparrots = − 9 x + 9 if
1 113
104 ≥ x ≥ 85
0 if x > 104
Note: The noise index of parrots will never fall to the negatives as they can regenerate their hearing
abilities. [48]
Quantifying Community Support Similar to noise levels, only minor factors need to be changed.
Re-quantification of Community Support:
Number of pet Y in region X
R(X, Y ) = (18)
Number of vets in region X
Then, akin to the warm up, we used the logistics function to model the score function.
2
SCommunity Support (X, Y ) = −1 (19)
1 + exp (0.002(R(X, Y ) − 2500))
2024 IM2 C
Page 18 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
Climate Similar to the warm up, only minor changes need to be made to suit the ideal temperature
for the pets.
Finally, we just need to insert the corresponding values into SClimate and a new quantification would
be created for each new pet.
Dogs and Tegus require a huge amount of capital and space, therefore households 1 and 4 are not
ready to get a dog or a tegu as a pet. However, all households are ready to get a parrot or a hamster
as a pet, due to their relatively low capital, spatial and environmental requirements.
It is also worth mentioning that the readiness score represents a household’s readiness for getting a
specific pet. For example, household 2 is less ready to get a tegu compared to households 3, 5 and 6.
If an entity wants to utilize a more conservative version of our model, a threshold can be introduced.
For example, the household’s readiness score may need to be over 0.5 to be considered ready.
The radar chart can describe what kind of household the pets needs most. If two pets share the
same needs towards their habitat, it means that they are more suitable together under their habitats,
reminiscent of the theory of an ecological niche of an animal. Notice that the overlapping area between
the 2 radar charts of 2 pets can represent how similar their needs are. Therefore, we can define the
compatibility score of two pets is proportional to the overlapping area of the two corresponding
radar chart [76].
y= Y√2
Y2 − 2X2
(x − X2 )
The area of the overlapping region can be found by
Y1 1
Area = √ (p − q) + X2 q
2 2 2
Although the above method of finding area is for octagon, by mapping the 2d heptagon into a con-
ical space, the same method can be applied to find the area of the heptagon in the conical space.
By multiplying a transformation scaling factor to the area in the conical space, we can obtain the
area of the radar overlapping area. The above process will need to be done for all 7 triangles,
and the total overlapping area of the 2 heptagonal radar charts will be the sum of all 7 triangles’
areas. And as we mentioned, this area will be the magnitude of how complementary the two pets are.
9
Community Support [59] y = (t + 24) + 9
8
After substituting the values into the function above, the percentage change of each factor in 5, 10
and 15 years are as follow.
CS PP H N C A
5 years 2.17% 2.86% 1.16% 0.990% 3.17% -0.964%
10 years 3.15% 5.73% 1.98% 1.94% 7.04% -1.63%
15 years 4.24% 8.59% 2.61% 2.84% 11.8% -2.64%
By multiplying these percentage changes into the 10000 set of generated data in task 1b and calculate
the resulting change in the score, we are able to predict the size of the population that is suitable
for keeping the 5 kinds of pets.
4 Conclusion
In conclusion, we have developed a set of metrics that can give a score on whether a household is
suitable for raising a cat or other species.
References
[1] url: https : / / www . bideawee . org / programs / feral - cat - initiative / get - involved /
community-outreach/community-cats-the-law/overview-of-cat-ordinances/.
[2] url: https://esimoney.com/the-financial-implications-of-owning-a-cat/.
[3] url: https://money.com/pet-spending-dogs-cats-survey/.
[4] url: https://www.cdc.gov/healthypets/pets/cats.html.
[5] url: https://www.cbsnews.com/news/how-much-pet-owners-spend-vet-bills/.
[6] url: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9324668/.
[7] url: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0185599.
[8] url: https://acaai.org/allergies/allergic-conditions/pet-allergies/.
[9] url: https://www.webmd.com/allergies/cat-allergies.
[10] url: https://www.webmd.com/pets/cats/moving-new-home-cat.
[11] url: https://www2.hse.ie/babies-children/child-safety/pets/cats/.
[12] url: https://www.cambridge.org/core/journals/animal-welfare/article/effect-of-
animal-shelter-sound-on-cat-behaviour-and-welfare/C9E67BEC1FF51E95DD638E93A956E015.
[13] url: https://petkeen.com/what-noise-levels-are-healthy-for-cats/.
[14] url: https://www.petacoustics.com/blog/2016/9/28/dafagadfg-l9tym.
[15] url: https://www.preventionweb.net/news/how-climate-change-will-affect-your-
pet-and-how-help-them-cope.
2024 IM2 C
Page 24 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
[68] url: https : / / be . chewy . com / ideal - temperature - ranges - for - parrots / # : ~ : text =
%E2 % 80 % 9CIn % 20my % 20experience % 2C % 20most % 20pet , 65 % 20and % 2080 % 20degrees %
20Fahrenheit..
[69] url: https://www.allaboutparrots.com/how-hot-is-too-hot-for-a-parrot/.
[70] url: https://www.allaboutparrots.com/how-cold-is-too-cold-for-parrots/.
[71] url: https://www.aspencommonsvet.com/2016/02/15/aurora-co-vet-hamsters-cold/#:
~:text=Ideal%20Temperatures,put%20your%20pet%20in%20danger!.
[72] url: https://animals.mom.com/temperatures-can-hamsters-live-1443.html.
[73] url: https : / / chewonthis . maddiesfund . org / 2016 / 11 / study - how - much - space - do -
shelter-cats-need-to-be-happier-more-playful-and-less-stressed/.
[74] url: https://thundersaidenergy.com/downloads/average-home-sizes/#:~:text=On%
20a%20global%20average%20basis,of%20living%20space%20per%20capita..
[75] . . Ed. by . , 2004. isbn: 7-300-05527-3.
[76] IMMC24273223. “A Space Odyssey”. In: IMMC 2024 Greater China Problem E (Winter)
(2024), pp. 13–17. url: https://drive.google.com/drive/folders/1OagVQ4nkqUVcs1RiNAFrnhbGWv
AI report 1
LLMs such as ChatGPT were not used, and played no role in the process of creating the
mathematical model and this solution paper.
A code
Note that the code below is not generated by AI.
gamma.py:
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import gamma
import random as r
from scipy.stats import norm
import pandas as pd
graph = "nd"
if graph == "gamma":
a, b = 34.4232144626391, 143.97865997308003
shape = a
scale = b
x = np.linspace(0, 100, 10000)
y = gamma.pdf(x, shape, scale=scale)
else:
mean = 37
std_dev = 10
x = np.linspace(mean - 3 * std_dev, mean + 3 * std_dev, 100)
y = norm.pdf(x, mean, std_dev)
2024 IM2 C
Page 27 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
plt.plot(x, y)
plt.grid(True)
plt.show()
new_coords = []
n = 0
while n < 9999:
coord = (r.random()*100, r.random()*0.08)
x_index = np.abs(x - coord[0]).argmin()
if coord[1] <= y[x_index]:
new_coords.append(coord)
plt.plot(coord[0], coord[1], 'go', label='Under Curve', markersize=1)
n += 1
print("Plotted:", n)
print(new_coords)
plt.plot(x, y)
plt.grid(True)
plt.show()
df.to_excel('data.xlsx', index=False)
radarcal.py:
import openpyxl
from sympy import symbols, Eq, solve, sqrt
import math
if (y2 > y1 and x2 > x1) or (y2 < y1 and x2 < x1) or (y2 == y1 and x2 == x1): # i
tmp_area = 1/2*min(x1, x2) * min(y1, y2)*math.sin(math.pi/4)
else:
x, y = symbols('x y')
eq1 = Eq(y1/(y1-sqrt(2)*x1)*(x-x1), y)
2024 IM2 C
Page 28 of 28 Picking the Perfect Pet Team#2024020
IMMC24384887
eq2 = Eq(y2/(y2-sqrt(2)*x2)*(x-x2), y)
wb = openpyxl.load_workbook('sus.xlsx')
sheet = wb['sus']
data = []