1. Introduction
Optimization problems not only lay the foundation in the field of mathematics but also have an important place in the computer neighborhood. Optimization problems in mathematics help people find the optimal solution to make rational use of human, material, and financial resources[7]. In the field of computing, the optimization problem improves the efficiency and effectiveness of the system and finally achieves the optimal goal of the system[3]. Especially in real life, it has a wide range of applications, such as signal and image processing, deep learning, artificial intelligence, and so on. But all of this sounds too far away from the masses. But in the experiment of this paper, the main thing is to find practical applications that are closely related to people in optimization problems. And how optimization problems in computing improve people's lives and how it works. For this purpose, gradient descent was used in experiments to calculate the optimal solution. Gradient descent is used to calculate the minimum value of a function[4]. For better observation, this experiment proposes some constraints. To improve people's living standards, the living environment is indispensable, so buying a house has become the basic setting of this experiment. To find the most suitable house for an individual, the most cost-effective house to find is the best solution to find a house. The main significance of this experiment is to help people find the optimal solution that exists in ordinary life and to let people understand that the optimal problem is not only in some advanced scientific journals, it is closely related to people's lives.
2. Methodology
2.1. Objective
This experiment is based on the background condition of buying a house, and the price and floor space are the constraints. Experimentation can help people find the best value for money. That is, using python to find the optimal solution through gradient descent. Due to the large difference in the level of housing prices and facilities in different regions, this paper uses the benchmark range of house prices in Bao'an District, Shenzhen, Guangdong Province.
2.2. Materials/Procedure
• 7 different house information.
• Floor space of different houses.
• Different house prices.
• Pycharm platform.
• Matplotlib.
• Random.
2.3. Procedures
(1) Open pycharm or use cmd to open Jupiter-lab.
(2) Import NumPy, import the random module and make it generate a random array containing 7 integers.
(3) Every integer is less than 300 and greater than 50.
(4) The resulting 7 numbers are the footprint of the house.
(5) Go to some Guangdong home buying websites[11] to find out the prices on different floor areas.
(6) Make it generate the price of a house.
(7) Because to observe the solution process of the optimization problem more intuitively, the experiment only includes the price and floor area of the house, and the geographical location and the degree of decoration of the house are not counted.)
(8) Start writing code and import matplotlib to prepare for later drawing.
(9) First, shrink the array by a factor of 100 to make it a floating point number, to make the system better for calculation.
(10) But don't forget to expand 100 times in the final output.
(11) Initialize the weights with an array and calculate the error.
(12) Calculate the gradient.
(13) Use gradients to adjust weights to minimize optimal values.
(14) The gradient of the cost function at each iteration and update the weights[8]
(15) There is no significant reduction in error until the further adjustment of the weights.[10]
(16) The iteration stops when the experimental error is less than or equal to 0.001.
(17) The final output is multiplied by 100 to make up for the reduced multiple at that time.
(18) And the output result is the optimal solution of how big a house to buy in Guangdong.
(19) Finally, matplotlib can be used to output a comparison chart about the data.
2.4. Data
Figure 1. The data table. |
This is experimental data.
Figure 2. The data array in the pycharm. |
The upper two figures represents the floor area of the house and its unit is square meters, while the lower array represents the price of the house and its unit is thousand yuan.
Figure 3. The data comparidon chart. |
This is the data comparison chart output using matplotlib. The middle line is the trend line, which roughly predicts the relationship between area and house prices.
By observing the chart listed above, it is obvious that the floor area of the house is directly proportional to the price of the house. That is to say, the larger the occupied area of the house, the higher its price. However, to reduce the inaccuracies caused by the geographical location, environment, decoration, etc. that are not included in the price, the experimental data on the price deliberately selected the median house price in a certain area of Guangdong. to ensure that the results of the experiment are accurate[6].
3. Results and analysis
Figure 4. The result in the pycharm. |
The results are obvious. In the preceding line of the figure, x represents the optimal solution for the floor space of the house. The y in the figure represents the estimated price of the house. The equation in the second line is an estimate of the price of the house. And after calculation, the conclusion was reached. When the house covers an area of about 184.56m^2, it is probably the most cost-effective house in a certain area of Guangdong. The price of the house is about 1966k yuan[7].
Buying a house is a very important thing in life for the average consumer group, and many people have not found a suitable house for a long time. Because they lack enough time and enough information. And this experiment can help people provide higher quality options. For example, people know about houses with different floor areas and attach prices. And because of direct viewing or too many numbers, people can't easily come up with the optimal solution. This experiment could help these people find a suitable area for them to buy. Although this sounds too far away from people's real lives. But there is also the simplest example, buying water, people need water every day, and to meet people's convenience, bottled mineral water was born. As people all know, mineral water has different brands. Some mineral waters are expensive and contain a small volume. To exclude brands that do not have a price-performance ratio, it is possible to fill in the data into the array of the experiment. This makes it easy not only to know which brand is the most cost-effective but also to know the price changes brought about by the volume of different brands. Therefore, this experiment can not only be used to buy a house, but also to buy a variety of ordinary things. As people often say, one should always shop around, but this time it not only depends on how far people could walk that can be more but also faster and more efficient.
4. Conclusion
In general, optimization problems can not only be applied to complex artificial intelligence but also to people's daily lives. It helps people use mathematical thinking to solve practical problems in life and find the best answers to practical problems[4]. It is concluded in this paper that optimization problems can help people find the optimal solution to buying a house. It allows people to save some non-essential money, and it can save people time. Further, improve people's living standards. Not only does the optimization problem make it more efficient for people to find what they're looking for, but it's also the best option for them. However, the experiment in this paper has certain limitations, mainly because the results of the incomplete data are not accurate enough, such as the lack of consideration of geographical location, floor, actual use area, etc. But to make the data more accurate, next time people can join the crawler, find the data in the network and add it to the array to achieve data comprehensiveness. And add some weight ratios about other features of the house. This can not only help people find the house they are most worth buying, but also find the preferences of the buyers who choose according to the characteristics. The next experiment can also add more algorithms, like Newton's method, which is faster and more accurate than the gradient descent method. In short, experiments have proved that the real-world application of optimization problems has significantly improved people's lives, and it is closely related to people's lives. And optimization is not only beneficial to the people's lives but also beneficial to the country. For example, optimization time in quantum computing. Therefore, the application of optimization problems is a great achievement in reality, which greatly improves people's living standards.
Acknowledgement
First of all, many thanks to Prof. Ta'asan. He gave the algorithm formula of this experiment report and how to write the code for gradient descent. Secondly, I would like to thank Ta Yang for his help when the experimental algorithm went wrong. At last, my math teacher provided me with some ideas and helped me find out my main title and content.
References
[1]. Kwiatkowski, Robert. “Gradient Descent Algorithm - a Deep Dive.” Medium, Towards Data Science, 13 July 2022, https://towardsdatascience.com/gradient-descent-algorithm-a-deep-dive-cf04e8115f21.
[2]. Donges, Niklas, et al. “Gradient Descent: An Introduction to 1 of Machine Learning's Most Popular Algorithms.” Built In, https://builtin.com/data-science/gradient-descent.
[3]. “Optimization Definition & Meaning.” Merriam-Webster, Merriam-Webster, https://www.merriam-webster.com/dictionary/optimization.
[4]. “Calculus Early Transcendentals: Differential & Multi-Variable Calculus for Social Sciences.” Optimization Problems, https://www.sfu.ca/math-coursenotes/Math%20157%20Course%20Notes/sec_Optimization.html.
[5]. Libretexts. “4.7: Optimization Problems.” Mathematics LibreTexts, Libretexts, 10 Nov. 2020, https://math.libretexts.org/Bookshelves/Calculus/Map%3A_Calculus__Early_Transcendentals_(Stewart)/04%3A_Applications_of_Differentiation/4.07%3A_Optimization_Problems.
[6]. “Examples of Optimization Problems.” Solver, 25 Feb. 2020, https://www.solver.com/examples-optimization-problems.
[7]. Birkett, Bruce. “How to Solve Optimization Problems in Calculus.” Matheno.com, 28 Feb. 2019, https://www.matheno.com/blog/how-to-solve-optimization-problems-in-calculus/.
[8]. Guo, Shuai. “An Introduction to Surrogate Optimization: Intuition, Illustration, Case Study, and the Code.” Medium, Towards Data Science, 26 Jan. 2021, https://towardsdatascience.com/an-introduction-to-surrogate-optimization-intuition-illustration-case-study-and-the-code-5d9364aed51b.
[9]. Mainkar, Sagar. “Gradient Descent in Python.” Medium, Towards Data Science, 28 Aug. 2018, https://towardsdatascience.com/gradient-descent-in-python-a0d07285742f.
[10]. “How to Implement a Gradient Descent in Python to Find a Local Minimum ?” GeeksforGeeks, 18 Jan. 2022, https://www.geeksforgeeks.org/how-to-implement-a-gradient-descent-in-python-to-find-a-local-minimum/.
[11]. Bao'an house price, real house price - China house price market, https://m.creprice.cn/district/BA.html?city=sz.
Cite this article
Zhang,S. (2023). Real-life Application of Optimization Problem. Theoretical and Natural Science,5,53-57.
Data availability
The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.
Disclaimer/Publisher's Note
The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
About volume
Volume title: Proceedings of the 2nd International Conference on Computing Innovation and Applied Physics (CONF-CIAP 2023)
© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and
conditions of the Creative Commons Attribution (CC BY) license. Authors who
publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons
Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this
series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published
version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial
publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and
during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See
Open access policy for details).
References
[1]. Kwiatkowski, Robert. “Gradient Descent Algorithm - a Deep Dive.” Medium, Towards Data Science, 13 July 2022, https://towardsdatascience.com/gradient-descent-algorithm-a-deep-dive-cf04e8115f21.
[2]. Donges, Niklas, et al. “Gradient Descent: An Introduction to 1 of Machine Learning's Most Popular Algorithms.” Built In, https://builtin.com/data-science/gradient-descent.
[3]. “Optimization Definition & Meaning.” Merriam-Webster, Merriam-Webster, https://www.merriam-webster.com/dictionary/optimization.
[4]. “Calculus Early Transcendentals: Differential & Multi-Variable Calculus for Social Sciences.” Optimization Problems, https://www.sfu.ca/math-coursenotes/Math%20157%20Course%20Notes/sec_Optimization.html.
[5]. Libretexts. “4.7: Optimization Problems.” Mathematics LibreTexts, Libretexts, 10 Nov. 2020, https://math.libretexts.org/Bookshelves/Calculus/Map%3A_Calculus__Early_Transcendentals_(Stewart)/04%3A_Applications_of_Differentiation/4.07%3A_Optimization_Problems.
[6]. “Examples of Optimization Problems.” Solver, 25 Feb. 2020, https://www.solver.com/examples-optimization-problems.
[7]. Birkett, Bruce. “How to Solve Optimization Problems in Calculus.” Matheno.com, 28 Feb. 2019, https://www.matheno.com/blog/how-to-solve-optimization-problems-in-calculus/.
[8]. Guo, Shuai. “An Introduction to Surrogate Optimization: Intuition, Illustration, Case Study, and the Code.” Medium, Towards Data Science, 26 Jan. 2021, https://towardsdatascience.com/an-introduction-to-surrogate-optimization-intuition-illustration-case-study-and-the-code-5d9364aed51b.
[9]. Mainkar, Sagar. “Gradient Descent in Python.” Medium, Towards Data Science, 28 Aug. 2018, https://towardsdatascience.com/gradient-descent-in-python-a0d07285742f.
[10]. “How to Implement a Gradient Descent in Python to Find a Local Minimum ?” GeeksforGeeks, 18 Jan. 2022, https://www.geeksforgeeks.org/how-to-implement-a-gradient-descent-in-python-to-find-a-local-minimum/.
[11]. Bao'an house price, real house price - China house price market, https://m.creprice.cn/district/BA.html?city=sz.