Academia.eduAcademia.edu

Using Genetic Algorithms to Solve Computer Science Olympiad Optimization Problems

2022, International journal of high school research

https://doi.org/10.36838/V4I4.3

Abstract

Genetic algorithms are random search algorithms based on biological evolution theory. In this study, the utilization of genetic algorithms in solving optimization problems from informatics Olympiads is investigated. It is hypothesized that genetic algorithms will be able to propose solutions to the optimization problem within a predetermined percent margin of the actual solution. A genetic algorithm is implemented in the C# programming language to test this hypothesis. Three tests are conducted, and their data is examined with various parameters taken into consideration. Consequently, the implemented genetic algorithm has been demonstrated to successfully solve the varying number of inputs (500, 1000, 2000) within an acceptable range. It is also concluded that several improvements and optimizations must be made to utilize this algorithm in a competitive landscape as time and memory constraints are exceeded. Furthermore, the tests concede that the number of inputs and the number of generations required to converge on an optimal solution is directly correlated. Therefore, this outcome should be taken into consideration when designing and tuning genetic algorithms with various parameters if the problem is aimed to be solved within the time and memory constraints of the competitive landscape.

Key takeaways
sparkles

AI

  1. Genetic algorithms effectively solve optimization problems within a 5% margin of actual solutions after 2000 generations.
  2. Testing involved 500, 1000, and 2000 inputs, demonstrating scalability issues in time and memory constraints.
  3. Crossover and mutation enhance genetic diversity and solution quality in optimization problems.
  4. Higher input values significantly increase the number of generations required for convergence.
  5. Implementing an efficient genetic algorithm is critical for competitive programming contexts.
ijhighschoolresearch.org RESEARCH ARTICLE Using Genetic Algorithms to Solve Computer Science Olympiad Optimization Problems Can Almelek, Ozgur Guzeldereli Uskudar American Academy - Selamiali, Vakıf Sk. No:1 D:No:1, 34664 Üsküdar/İstanbul, Turkey; [email protected], ABSTRACT: Genetic algorithms are random search algorithms based on biological evolution theory. In this study, the utilization of genetic algorithms in solving optimization problems from informatics Olympiads is investigated. It is hypothesized that genetic algorithms will be able to propose solutions to the optimization problem within a predetermined percent margin of the actual solution. A genetic algorithm is implemented in the C# programming language to test this hypothesis. Three tests are conducted, and their data is examined with various parameters taken into consideration. Consequently, the implemented genetic algorithm has been demonstrated to successfully solve the varying number of inputs (500, 1000, 2000) within an acceptable range. It is also concluded that several improvements and optimizations must be made to utilize this algorithm in a competitive landscape as time and memory constraints are exceeded. Furthermore, the tests concede that the number of inputs and the number of generations required to converge on an optimal solution is directly correlated. Therefore, this outcome should be taken into consideration when designing and tuning genetic algorithms with various parameters if the problem is aimed to be solved within the time and memory constraints of the competitive landscape. KEYWORDS: Systems Software; Algorithms; Competitive Programming; Genetic Algorithms; Optimization. � Introduction optimization problems with the motive of determining the Computer science has become the epitome of global de- most optimal solution. Genetic algorithms (GAs) are one of velopment into a more modern and enhanced society. With the most fundamental algorithms that incorporate biology countless advancements in the fields of Artificial Intelligence and genetic classification into computer science as a viable (AI), Virtual Reality (VR), Augmented Reality (AR), robotics solution method.³ technologies, etc.; computer science has validated its crucial This study demonstrates the utilization of genetic role in the new age. Therefore, there is a constant endeavor to algorithms in solving optimization problems from the improve the effects of computer science by coming up with Olympiad in informatics. It is hypothesized that genetic new methods as well as educating more people. To be pre- algorithms would be able to propose a solution within a cise, the percentage of high schools offering computer science certain percent margin of accuracy to Olympiad problems courses in the US has increased from 35% to 51% in the last which are conventionally solved by other means, given the 3 years.¹ This is a testament to the fact that more education correct parameters. Within this paper, the structure of genetic institutions, students, teachers, and individuals emphasize algorithms will be explained, optimization problems will be computer science and its potential in the future. defined, our implementation of a genetic algorithm will be As computer science’s popularity prospers, there have been shown, and with the given implementation an optimization numerous means to assess one’s knowledge and skills on a problem will be attempted to be solved. computer. There are coding websites, mainly Codeforces and � Methods Hackerrank designed to impose problem-based coding with Genetic Algorithms: occasional contests in a competitive manner. This system of Genetic Algorithms are optimization algorithms that are problem-based coding in a competitive manner is essentially inspired by natural selection. Genetic algorithms were first called competitive programming. The broader rendition designed by John Holland at the University of Michigan in would be an Olympiad in Informatics on regional and the early 1970s.⁴ They involve processes such as crossover and international scales. The world’s most prestigious computer mutation to optimize for a constraint. Genetic algorithms can science competition is the International Olympiad in be used to generate feasible and high-quality solutions for Informatics (IOI), which attracted 327 contestants from 97 search and optimization problems. Although the structure of countries in IOI 2019 Baku, Azerbaijan; all of whom passed genetic algorithms can vary slightly with their implementation, several stages in national contests.² In these contests, there are most, if not all, genetic algorithms have several commonalities: common problem types such as Graph Theory, Game Theory, initialization, selection, offspring generation, mutation, and and recursion which are regularly displayed in problem tasks. termination.⁵ One of the key objectives is problems that require finding the Initialization: best solution from all feasible solutions such as optimization All genetic algorithms start with an initialization step. Ge- problems. There are numerous algorithms designed to solve netic algorithms consist of a population of individuals. © 2022Terra Science and Education 13 DOI: 10.36838/v4i4.3 ijhighschoolresearch.org Individuals carry a gene sequence or DNA. The DNA of an action. Firstly, a higher fitness solution could be reached which individual represents a solution to the problem that is aimed is the optimal case. Another case would be a lower fitness to be solved and the DNA should be structured accordingly. solution that could be reached in which case the mutated Therefore, each individual is required to be initialized to ensure child will not be able to pass its genes to the next generation. they have at least some DNA. Although many techniques Either way, genetic diversity is created within the population could be applied to initialize the individuals, two techniques to ensure that the system doesn’t converge to a local optimum. are most prevalent. Of these two methods, assigning random By randomly changing the genes of the children of the new genes to individuals is the most common. The other method generation, enough new genes are inputted into the system is seeding the individual which signifies giving random genes to widen the search space of the algorithm. In elitist genetic that could be precise to the optimal value of the system or algorithms where the fittest individuals of each generation the problem. Initializing the individuals is quintessential to are passed directly to the next generation, the mutation is a genetic algorithm. Randomly assigning gene values makes also excluded from elite individuals to protect the progress genetic-diversity possible within the population which is key of the genetic algorithm as mutations can lead to a decrease to spanning the entirety of the solution set of a particular in fitness. problem. Termination: Selection: Termination is the last step of a genetic algorithm. The After individuals are initialized, the selection process termination of the genetic algorithm may depend on several takes place. Besides a DNA sequence, the other metric every factors and several termination conditions. For example, the individual has is the fitness value of their DNA. The fitness number of generations could be constrained as well as the value of an individual determines how optimal it is, or how time spent on the problem. Other constraints include but are close the individual is to an optimal solution relative to not limited to reaching a certain fitness level, the solution other individuals. The fitness value is calculated via a fitness satisfies the bare minimum requirements of the problem, or function which is a problem-specific function determining a point is reached where the successive generations no longer the optimality of a solution that is proposed by the genes of produce new results. Usually, after termination, a solution is an individual. Therefore, it is important to form a feasible outputted as a solution to the problem or optimization. Data fitness function and it is the hardest process that is involved from each generation can be used to plot data graphs and the in constructing a genetic algorithm. If the fitness function evolution of the population can be analyzed to draw further fails to produce high-quality fitness values, the genetic conclusions. algorithm will not be able to create high-quality solutions to Pseudocode of a Basic Genetic Algorithm: the problem. After a valid fitness function is created, every 1. Initialization - All individuals of the population are ini- individual’s fitness is calculated. Then the individuals are tialized with n-length genes which represent a solution to the sorted in the population according to their fitnesses and a problem. percentage of lowest fitness individuals is discarded. Some 2. Fitness - The fitness of each individual is calculated us- low-fitness individuals are left in the population to ensure the ing a fitness function. genetic diversity within the population. 3. New generation - Follow the proceeding steps to create Offspring generation: a new generation. After the selection process, a new empty generation is 4. Selection - A percent of the population is selected. The created and filled via the crossover of the previous generation’s higher the fitness the higher the chance of selection. individuals. Crossover is the process in which the genes of an 5. Crossover - From the selected individuals, randomly se- individual are mixed with another individual’s genes to create lect 2 parents. Crossover their genes to make 2 new offspring. offspring. The process involves selecting random points in 6. Accepting - Place new offspring in a new population the genes of the individuals. Then two empty children are 7. Elitism - If the genetic algorithm is elitist, select the created. The genes of the children are set to be the gene of highest fitness individuals of the population and also place one of the parents (one for each child). In the points that them into the new population. are randomly selected, the parent that the child is getting the 8. Replace - Use the newly generated population for anoth- gene from switches to the other parent thus crossing over. er run of the algorithm. This process can be repeated multiple times to ensure more 9. Test - Test for a termination condition. If the condition diverse results. Crossover’s main purpose is to generate new is met, terminate the algorithm and return the necessary data offspring from high fitness individuals to further increase as a solution to the problem or optimization. the fitness of the population. By selecting from high fitness 10. Repeat - Go to step 2. individuals and crossing over their genes, a gene sequence Optimization Problems: with a higher fitness level is created. As mentioned previously, optimization problems are the Mutation: problems that require finding the best solution out of all fea- As with crossover, the mutation is a genetic operator that is sible solutions. The whole entity of feasible solutions is often used in creating higher fitness solutions in a genetic algorithm. referred to as sub-optimal (local) solutions.⁶ A specific goal The mutation is the process of randomly changing the genes is asked to be met at an optimal value out of all sub-optimal of the individual. There could be several consequences of this solutions. These problems must provide the variable con DOI: 14 10.36838/v4i4.3 ijhighschoolresearch.org straints as specifications necessary for constructing a solution. offspring which allows multiple dimensional explorations. De- Accordingly, programmers are generally obligated to find the pending on the accuracy of the offspring, some are eliminated, minimum and maximum values of a function that satisfies whereas some are pursued as promising solutions. Due to the the task's objective. parallelism, they can operate resembling a graph structure, Moreover, optimization problems can be classified in two evaluating multiple traceries at once. Thanks to their structure, manners according to their variables: continuous or discrete. particularly problems containing vast amounts of potential In the cases of discrete variables in an optimization problem, solutions are easier to solve which would take an immense an integer, graph, or permutation must be identified out of amount of time with a simple search algorithm. a countable set. In discrete optimization, some or all of the variables in a model are required to belong to a discrete set; this is in contrast to continuous optimization in which the variables are allowed to take on any value within a range of values. The discrete set is mainly initialized as subsets, combinations, graphs, or sequences. On the other hand, the cases of continuous variables require a continuous function to be found. Continuous optimization means finding the minimum or maximum value of a function of one or many real variables, subject to constraints. The constraints usually take the form of equations or inequalities. In general, a rather popular method for solving optimization problems is Dynamic Programming (DP).⁷ DP is essentially a recursive solution with repeated method calls, storing the results of subproblems for the eventual solution. Compared to the aforementioned genetic algorithms, DP solutions usually use a lot of memory and have a longer running time. Even though genetic algorithms are typically harder to implement, efficiency in time and memory capacity are highly valuable assets for competitive programming which makes genetic Figure 1: ZCO 2014 Problem 4 IPL.9 algorithms more effective in Olympiad in Informatics.⁸ Identifying the sections of a problem: � Results and Discussion First and foremost, it is essential to identify crucial sections Genetic Algorithms can be considered systematic random of a problem task before analyzing any algorithms or writing search algorithms where the random search algorithm also code. In this problem titled IPL, a certain number of games considers the optimality of previous trials and evolves ac- (N) are given according to the user’s input. Afterward, N cordingly. Randomly initializing the individuals causes the number of games is expected from the user with each con- proposed solutions to span the search space. With each gen- taining a particular fee awarded if played in the game. The eration, the solutions then attempt to converge at a global problem calls for the maximum amount of money that could optimum. Mutations add genetic diversity to the gene pool be earned for an individual (Nikhil) through the N games. and aim to ensure that the point the population converges is However, there is a condition in which an individual is obli- the global optimum. Knowing these it can still be inferred that gated to play at most 2 consecutive games. Herewith, a certain a genetic algorithm may not be able to converge on the most algorithm must be constructed which maximizes salary while optimal solution even with the best possible parameters as it is taking at most 2 consecutive game conditions into account still a randomized and probabilistic algorithm. Although that (Figure 1). may be the case, it could be expected that the final result of a Furthermore, a prediction about the complexity of a prob- genetic algorithm is close to the global optimum. For the set of lem could be made per the given test data constraints. A runs that will be conducted in this paper, it is assumed that the maximum of 2*10⁵ number of games along with 10⁴ for each problem is solved if the value of the solution proposed by the game can be inputted by the user. An average computer is able algorithm is within 5% of the actual solution after 2000 gen- to make approximately 2*10⁶ calculations per second regard- erations. The percentage values of how close the solution is to less of the operating system. Thus, a brute force algorithm with the actual solution are calculated using the following formula: time complexity of O(n2) would be sufficient for a solution to pass this problem. The time complexity of O(n2) signifies the worst solution possible for a problem which usually persists in iterating through every single value until the correct answer is Another factor to consider is that genetic algorithms are reached. Nonetheless, a brute force solution wouldn't pass for intrinsically parallel compared to most algorithms which are this problem if the user could input 2*10⁸ number of games. serial. Serial algorithms only permit linear exploration that In a hypothetical case, a genetic algorithm would be one of does not store every value reached by the algorithm's “infer” the most ideal solution methods for this problem with the steps. On the contrary, genetic algorithms contain multiple time complexity of O(gnm). Among the time complexity of 15 DOI: 10.36838/v4i4.3 ijhighschoolresearch.org O(gnm), "g" stands for the number of generations, "n" stands gene represents that a match is going to be played while each 0 for the population size, whereas "m" signifies the size of in- represents that the match will be passed. dividuals.¹⁰ In brief, although in this particular case it's not After the initialization of the population is complete, the imperative, a genetic algorithm solution would be a fast and process of selection begins. Before the selection can order and viable solution to the problem among random search and remove individuals from the population, the fitness of each brute force algorithms. individual has to be calculated. The CalculateAllFitness() func- Genetic Algorithms Implementation: tion located inside the Population class iterates through all of The genetic algorithm is implemented via the programming the population’s individuals once more and calls the Calculate- language C# which is a general-purpose, object-oriented pro- Fitness() method on their gene sequence and sets their fitness gramming language developed by Microsoft. The following value to be the return value of the method. The CalculateAll- section breaks down the code into several sections - namely Fitness() method is implemented as such: initialization, selection, crossover, mutation, and termination. Before the function of the code is analyzed, its inner struc- ture must be understood.¹¹ First of all, the code starts with a class named Individual, which represents one individual in the entirety of the population. Each contains a set of genes that The CalculateFitness() function is provided by the client of are of template type, a double fitness value, and a chromosome the Population class. For this particular problem, the fitness length which is common throughout the entire population. is calculated to be the highest fee that can be reached within the gene sequence. A fee is calculated from a series of matches until 3 consecutive matches are played which is derived from the condition of the problem. If 3 consecutive matches are played, the fitness value is reset to 0 and the value it contains Its implementation is as follows: before resetting is compared to the biggestFitness value. If the All of these instance variables are initialized with a construc- fitness calculated from this particular series of matches within tor as each instance of the Individual class is created. Another the gene sequence is bigger than the biggestFitness value, the structure within the algorithm is the Population class. The class biggestFitness value is set to be the fitness of this series. This contains an array of individuals, a generation number, a popu- process aims to maximize the fee earned from the gene se- lation size, a chromosome size, and various probability values quence as it attempts to maximize for the largest value of fee for the genetic algorithm to work on. The implementation of possible while also keeping the amount of three consecutive matches played to the lowest possible value. After all of the fitnesses are calculated the selection takes place. The selection function orders each Individual according to their fitness and a percent of the population whose fitness is lower is removed from the population. The percentage which the population is selected is given as a parameter to the meth- od (selectPercent). The selection method is also a part of the Population class, and it is implemented in the following code snippet: its instance variables is as follows: As evident from the code snippet, the population class also contains two functions: GetRandomGene() and Calculate- Fitness() functions. These functions are provided by the client of these classes and are called within the population's various functions. GetRandomGene() is the function that returns a After selection is completed, a new generation is creat- random gene to initialize the members. CalculateFitness() is ed. Another array of individuals is initialized with all of the a function that returns a double value according to the genes individuals being empty. Then a percentage of the previous of the individual; the number returned signifies the fitness of generation is passed onto the next generation starting from that particular gene set or individual. As cognizant of solely the highest fitness. This is called elitism. The remaining empty the meaning and implementation of these values, it is possi- places in the population are filled using the offspring of the in- ble to analyze the code entirely. The first step in the code is dividuals of the previous generation. To produce offspring two the initialization of the individuals. The initialization method parents are selected using weighted random selection which iterates through the array of individuals and sets the gene of uses the individuals’ fitness as weight. After the selection is each individual using the GetRandomGene() method. For the made, crossover and mutation are applied. The two offspring particular problem, the genes of the members are an array of are placed into the new generation and this process is repeated integers. All values in the array are either 1 or 0. The gene se- until the new generation becomes just as populated as the pre quence represents the sequence of games and each 1 in the DOI: 16 10.36838/v4i3.3 ijhighschoolresearch.org vious generation was. The code for making a new generation is the genetic algorithm, most notably the generation count and implemented as follows: population size. Given a higher generation count, it is expect- ed that the genetic algorithm converges closer to the value, resulting in a lower percentage difference. Another test with the same parameters except for generation count as test 3 is done to show this phenomenon. Note that the actual solution is different from test 3 as all the input values are randomized. All of these functions are put together in a PropagateGenera- As can be observed from this test (Table 2), the percentage Table 2: ZCO 2014 Problem 4 test II. tion method to simplify the entire process. PropagateGeneration is defined in the following way: difference drops significantly when a larger generation count is used. Considering all of these tests, it could be concluded The last step is the termination. For this particular problem, that genetic algorithms are adequate in solving such problems the termination condition is the number of generations that but require a lot of time and memory to run efficiently. Along the algorithm ran for. In the tests made, every algorithm was with this, as the amount of input values gets bigger, the amount run for 2000 generations before being terminated. The fitness of generation required to converge on an optimal solution in- levels were not adjusted or altered and were taken as is from creases. This fact must then be taken into consideration when when the algorithm stopped. designing problem-specific genetic algorithms. Since time and Evaluation of the Solution: memory are usually restrained on Olympiad questions, an effi- A total of three runs were made. Each algorithm is left to cient algorithm must be implemented with the best parameters run for 2000 generations and with a population of 10000 possible. individuals. Runs were made using N values of 500, 1000, and 2000. In these tests, fitness also represents the proposed solution of a gene sequence which in this case is the highest fee an individual can earn. This works as both the fitness and the solution to the problem are trying to be maximized. In each generation, 50 percent of the low fitness population is removed, and others are allowed to produce offspring. The mutation chance is 80%. This value can alter with the rate of convergence and prevent it dramatically, but it is required to be extremely high to cover the vast search space. Elitism percent is 5% meaning in each generation's highest fitness 5% of the population is passed onto the next generation without being subjected to any alteration. The processed data from the runs are entered into Table 1. The best fitness for each gener- ation is plotted as a function of generation count and Figures Figure 2: Best Fitness vs Generation Count Graph for Test I. 2, 3, and 4 are created. The data suggests that for the tests done, the algorithm is successful in finding an optimal solution to the problem. It should be noted that for the third test the percentage differ- ence is very close to the threshold value. This increase in the percentage difference is caused by inadequate parameters in 17 DOI: 10.36838/v4i4.3 ijhighschoolresearch.org for solving the problems yet must also approach the algorithm with caution as the implementation has to be optimized heavi- ly in order to comply with time and memory constraints of the Olympiads. � Acknowledgements Our IB High-Level (HL) Computer Science (CS)teacher Özgür Çiçek encouraged us to research genetic algorithms since it has been the IB CS HL Paper 3 topic for the past 2 years. � References 1. Klein, A. More than half of high schools now offer comput Figure 3: Best Fitness vs Generation Count Graph for Test II. er science, but inequities persist.https://www.edweek.org/ teaching-learning/more-than-half-of-high-schools-now-offer- computer-science-but-inequities-persist/2021/11 (accessed Jan 7, 2022). 2. IOI Statistics. https://stats.ioinformatics.org/olympiads/2019 (ac cessed Jan 10, 2022). 3. Techopedia. What is a genetic algorithm? - definition from Te chopedia https://www.techopedia.com/definition/17137/genet ic-algorithm (accessed Jan 10, 2022). 4. Sablier. Coding games and programming challenges to code better https://www.codingame.com/playgrounds/334/genetic-algo rithms/history (accessed Jan 30, 2022). 5. Worden, K.; Liu, S.; Das, D.; Avi Ceder, A. Genetic Algorithm https://www.sciencedirect.com/topics/engineering/genetic-algo rithm (accessed Jan 11, 2022). Figure 4: Best Fitness vs Generation Count Graph for Test III. 6. Lecture12-dukecomputerscience. https://www.cs.duke.edu/cours es/fall05/cps130/lectures/skiena.lectures/lecture8.pdf (accessed Jan � Conclusion 12, 2022). Thanks to the nature of genetic algorithms, competitive 7. Dynamic Programming https://www.geeksforgeeks.org/dynam programmers and programming enthusiasts have the upper ic-programming/ (accessed Jan 30, 2022). hand in solving optimization problems. Although genetic al- 8. Continuous optimization. https://uwater gorithms are able to provide optimal solutions for a majority of loo.ca/combinatorics-and-optimization/research-combinator optimization problems, a couple of drawbacks are noted from ics-and-optimization/research-areas/continuous-optimization (ac the solution of IPL. Firstly, since genetic algorithms require a cessed Jan 12, 2022). set of generations to be processed in order to reach the final 9. Indian Computing Olympiad Archives 2012 - IARCS. https:// accurate answer, time and memory constraints are generally www.iarcs.org.in/inoi/2014/zco2014/zco2014-2b.php (accessed exceeded. For instance, in the IPL example, the time limit is Jan 17, 2022). 10.Time complexity of genetic algorithms exponentially ... https:// stated as 1 second, whereas the memory limit is stated as 32 fernandolobo.info/p/gecco00.pdf (accessed Jan 13, 2022). Megabytes (MB). The solution that is at hand utilizing genet- Agnishom. ZCOSolutions/ipl.cpp at master · Agnishom/Zcosolu ic algorithms requires at least 370 seconds and encompasses tions. 200 MB of memory. Thus, certain alterations to the program 11.Bajpai, P.; Kumar, M. Genetic Algorithm - an Approach to Solve should be made if genetic algorithms are to be used in a com- Global Optimization Problems https://www.researchgate.net/ (ac petitive environment. A suggestion for an alteration would be cessed Jan 20, 2022). to stop new generation formation when an accurate solution is � Authors reached. A genetic algorithm provides a comprehensive search Özgür Güzeldereli is a 17-year-old sophomore student at Usku methodology for optimization. The problem of finding an ac- dar American Academy in Turkey. He is interested in computer prog- curate solution in a space with many sub-optimal solutions is a ramming, theoretical computer science, and algorithms. He special- classic problem for all systems that can adapt and learn. izes in operating system development. In conclusion, there have been benefits and drawbacks that Can Almelek is a 16-year-old sophomore student at Uskudar have emerged as genetic algorithms were utilized in this study American Academy in Istanbul, Turkey. His fields of interests in computer science entail competitive programming, algorithm analysis, in order to solve optimization problems from informatics artificial intelligence and object-oriented programming. He’s also Olympiads. It is observed that genetic algorithms are gener- fond of visual arts, table tennis, basketball, and public speaking. ally able to solve such problems but are unable to comply with the memory and time restrictions. It should also be noted that converging on higher input values, requires more generations to be run on the algorithm, or increased population size. Con- sequently, a competitor in such informatics Olympiads must consider the possibility of using genetic algorithms as a tool DOI: 18 10.36838/v4i4.3 ijhighschoolresearch.org REVIEW ARTICLE An Analysis on the Possibility of Establishing a Threshold Energy Level for the Solar Flares on the Interactions of Hard X-Ray Beams and the Ionosphere Can Erol, Evren Sanlı, Defne Lara Balsarı, Muhsin Erhan American Collegiate Institute, Göztepe İnönü St. No:476, Konak, İzmir, 35290, Turkey; [email protected] ABSTRACT: This paper presents an analysis of the interactions of the hard x-rays emitted through the high-energy solar flares, often seen in the X and Y class, within the ionosphere which is located in the thermosphere. Hence, the paper concentrates on whether it’s possible to specify a critical threshold energy level for the hard x-ray emissions from a solar flare that cause the x-ray beam to reach the Earth's crust and its inhabitants, assuming that the intensity of the hard x-ray beam is kept as a constant. This should serve as a critical point in determining the harmful effects of the solar flares in the atmosphere and furthermore on Earth as a whole. The methodology that has been followed is the application of a well-known scientific effect to the problem, the photoelectric effect, and the evaluation of the implications of its conclusions. It is then seen that as the intensity of the X-ray beam is kept as a constant, the energy of the incoming x-ray beam does not affect the process of atmospheric absorption, since energy is quantized by the photons and the decreasing wavelength does not contribute to the number of electrons liberated in the ionospheric D region. KEYWORDS: Physics and Astronomy; Quantum Physics; Solar Flares; Ionosphere; X-Ray Emission. � Introduction This research paper is focused on the examination of the mutual correlation between the hard x-rays emitted through the X and Y class high-energy solar flares with the ionosphere which is an integral part of the thermosphere.¹ The question we as a team specified our research into is “Can there be a critical energy threshold for the hard X-rays emitted through the solar flares in which the Earth’s atmosphere cannot process it and if so, what would it be?” Our hypothesis was that the threshold could be found through the calculation and understanding of the Photoelectric effect that is naturally Figure 1: Diagram showing the layers of the Earth’s atmosphere and occurring by the interactions between the hard X-rays and the ionosphere.4 competence of the Earth’s atmosphere and surface.² gasses in their compositions.⁵ Essentially, the thermosphere For reference data, we researched the November 4, 2003, is the layer of the atmosphere which lies just above the Giant Solar flare, it was the largest one currently recorded mesosphere. Within this layer of the atmosphere, UV by scientists.³ In essence, solar flares are incidents that have light induces photoionization of molecules, resulting in immense effects on both the natural species of our planet the formation of ions.⁵ The formation of the ions further and the infrastructure of telecommunication technology. translates into the subsequent formation of the ionosphere. After thoroughly examining the example of the November The ionosphere is a dense layer of electrons and ionized 4, 2003, Giant Solar flare, we started to research a joint atoms and molecules that extends from 48 kilometers above threshold that can define the amount of radiation the Earth’s the surface to 965 kilometers, intersecting with the previously atmosphere could absorb. Solar flares emit many kinds of mentioned layers of the mesosphere and thermosphere.⁶ waves ranging from Gamma to X-Rays; however, for the This mobile zone expands and contracts in response to solar ease of comprehension and drawing the limits of our paper, circumstances, and it is subdivided into three regions: D, E, we narrowed our research down to the examination of the and F, depending on the wavelength of solar light absorbed.⁶ amount of X-Rays that solar flares emit only.³ Throughout the paper, the reader will come across the D To better understand how X-rays interact with the structure region the most, mainly because this is the region where hard of the Earth’s atmosphere, we firstly gathered information on X-Ray beams interact with the atmospheric composition and the Earth’s atmospheric layers, namely the thermosphere and are absorbed.⁷ Since the ionosphere is composed of charged its integral part the ionosphere, as shown in Figure 1. These particles, it is extremely sensitive to changes in magnetic and two layers’ main function is to absorb any rays that enter the electric conditions in space. These circumstances, along with atmosphere with the abundance of Oxygen and Nitrogen other phenomena like bursts of charged particles, are referred © 2022Terra Science and Education 19 DOI: 10.36838/v4i4.4 ijhighschoolresearch.org to as space weather and are frequently associated with solar number of electrons emitted from a set of materials. The activity. The ionosphere is an essential connection in the excess energy after subtracting the work function from the Sun-Earth interaction chain, since through the ionosphere incoming photon, energy only affects the kinetic energy of radio communications can be possible.⁷ This paper portrays the emitted electrons, and hence does not have any significant an analysis of a sophisticated and detailed research question effect on the number of liberated electrons, as shown in regarding the X- Ray absorption abilities of our atmosphere Figure 2. that hasn’t been thoroughly discussed by previous literature before. � Results and Discussion The paper consists of two sections: Limitations of the Photoelectric Absorption and The Effect of Quantized Energy on the Amount of Emitted Electrons. Limitations of the Photoelectric Absorption: The photoelectric effect is the starting point of quantum mechanics in its modern form, and the idea of quantized energy. Hence, understanding the limitations of the photoelectric effect and the absorption of a photon by a Figure 2: Energy as a function of frequency.2 material is crucial in evaluating the interactions between the x-rays and the molecules in the D region of the ionosphere. This is indeed crucial in our understanding of the X-rays, and their carriers, photons, are by no means affected hypothesis and the x-ray interactions with the ionosphere. by the magnetosphere of the Earth, since they are not In the hypothesis we established, we consider the energy of electrically charged. Thus, the only significant interaction an incoming beam, and we are trying to determine whether between the incoming X-rays and the atmosphere occurs it is possible for the incoming x-rays to reach the Earth's in the D region of the ionosphere which is located at the crust and its inhabitants after a critical threshold energy thermosphere of the atmosphere.⁷ The incoming X-rays level. However, our hypothesis does not specifically account often collide with the atoms, and their electrons, located in for the intensity of the incoming beam, since it is also a the D region which is highly famous with the high density of major observational problem that is yet to be resolved by the electrons it includes. Hence, as the X-rays collide with N₂ and scientific community. The minor interactions of the X-ray O₂ atoms, the energy coming from the X-rays are absorbed by beams with the outermost parts of the atmosphere cause the atom, and as a result, an electron is set free with a specific the diffraction and scattering of beams before entering the amount of kinetic energy. This is known as the photoelectric ionosphere and therefore prevent us from setting a specific effect, and hence is important in evaluating the hypothesis conclusion regarding a critical threshold energy value for a since the increasing energy of the incoming photons does not solar flare that could be then seen as a danger threshold for specifically cause an increase in the emission of the electrons the life on Earth. Briefly, the intensity of the incoming X-ray of a molecule after a certain frequency threshold.⁸ However, beams cannot be specified and vary significantly from their it should be noted that the intensity of the incoming X-rays predicted source values. At this point, it is needless to say are to be taken into account as a constant, since the increase that the hard x-rays that this research concentrates on have in the intensity of the X-rays is linearly correlated with the wavelengths high above the threshold frequency needed to amount of electrons emitted.⁸ enable the photoelectric effect on the N and O molecules of The Effect of Quantized Energy on the Amount of Emitted the atmosphere.¹⁰ Electrons: � Conclusion The calculation of the energy of an emitted electron via the The research we have conducted over the course of the last photoelectric effect is made by the equation:⁹ two months allowed us to examine the interaction between K = hf - Φ the X-rays emitted through the solar flare activities and re- In which K is the maximum kinetic energy that the electron spected layers of the atmosphere of the Earth, namely the can possess after being set free from the atom of the material, thermosphere and the ionosphere, especially the ionospheric h is the Planck constant, f is the frequency of the incoming D region. In the end, we have reached the conclusion that it is radiation, and Φ is the work function, which denotes the highly unlikely to determine a critical threshold energy level required energy needed to tear off an electron from the for the solar flares that enable the hard X-ray beams emitted specified atom. Work function is a function of the material, from them to reach the Earth's crust, due to the complex dif- and is higher in nonmetals compared to metals.⁹ Recalling fraction and scattering patterns of the X-ray beams and the the approved postulations of the photoelectric effect, one can fact that as the intensity of the beam is kept as constant, the see that the quantized energy carried by singular photons can amount of energy a beam possesses does not affect the number be only used in the tearing off of one electron and that after a of electrons ionized. Hence, it should be noted that further threshold frequency, which is also a function of the specified specifications and enhancements could be made by rigorous material, the value of the frequency, and thus, the wavelength mathematical analyses. of the specified radiation is not accounted regarding the 20 DOI: 10.36838/v4i4.4 ijhighschoolresearch.org � Acknowledgements We would like to thank our physics teacher Muhsin Erhan for his endless support to find our inspiration and motivation for the paper we successfully completed. � References 1. Tandberg-Hanssen, E.; Emslie, A. G. The Physics of Solar Flares; Cambridge University Press: Cambridge, 2009. 2. Kontar, E. P.; MacKinnon, A. L.; Schwartz, R. A.; Brown, J. C. Compton backscattered and primary X-rays from solar flares: An gle Dependent Green's function correction for photospheric albe do. https://www.aanda.org/articles/aa/abs/2006/06/aa3672-05/ aa3672-05.html (accessed Apr 17, 2022). 3. Kane, S. R.; McTiernan, J. M.; Hurley, K. Multispacecraft observations of the hard X-ray emission from the giant solar flare on 2003 November 4. https://ui.adsabs.harvard.edu/ abs/2005A%26A...433.1133K/abstract (accessed Apr 17, 2022). 4. GMS: Ionosphere Graphics. https://svs.gsfc.nasa.gov/12960 (accessed Apr 17, 2022). 5. Center for Science Education. https://scied.ucar.edu/learning- zone/atmosphere/thermosphere (accessed Apr 17, 2022). 6. HOLLINGWORTH, J. Structure of the Ionosphere. Nature 1934, 134 (3386), 462–462. 7. Sutherland, L. C.; Bass, H. E. Atmospheric Absorption in the Atmosphere up to 160 Km. The Journal of the Acoustical Society of America 2004, 115 (3), 1012–1032. 8. The Editors of Encyclopaedia. Photoelectric effect. https:// www.britannica.com/science/photoelectric-effect (accessed Apr 17, 2022). 9. PRATT, R. H.; RON, A. K. I. V. A.; TSENG, H. K. Atomic Photoelectric Effect above 10 Kev. Reviews of Modern Physics 1973, 45 (2), 273–325. 10.Watanabe, K. Ultraviolet Absorption Processes in the Upper Atmosphere. Advances in Geophysics 1958, 153– 221. 11.Lesson 34: Photoelectric effect graphs - studyphysics. http://www.studyphysics.ca/2007/30/07_emr/34_photo_ graphs.pdf (accessed Apr 16, 2022). 12.A parameterized model of x‐ray ... - wiley online library. https://agupubs.onlinelibrary.wiley.com/doi/ full/10.1029/2018RS006666 (accessed Apr 16, 2022). 13.Švestka, Z. Solar Flares. 1976. � Authors Can Erol is a student at American Collegiate Institute, Izmir, that is truly interested in physics and mathematics, and an avid learner of science looking forward to expanding his research interests. He currently wants to double major in physics and mathematics. Evren Sanlı is a student at the American Collegiate Institute in Izmir, Turkey. He is deeply interested in physics, especially particle and astrophysics, and is hoping to widen his under- standing in these fields through future research. Currently, he is planning to double major in mechanical engineering and econometrics. 21 DOI: 10.36838/v4i4.4

References (22)

  1. Klein, A. More than half of high schools now offer comput er science, but inequities persist.https://www.edweek.org/ teaching-learning/more-than-half-of-high-schools-now-offer- computer-science-but-inequities-persist/2021/11 (accessed Jan 7, 2022).
  2. IOI Statistics. https://stats.ioinformatics.org/olympiads/2019 (ac cessed Jan 10, 2022).
  3. Techopedia. What is a genetic algorithm? -definition from Te chopedia https://www.techopedia.com/definition/17137/genet ic-algorithm (accessed Jan 10, 2022).
  4. Sablier. Coding games and programming challenges to code better https://www.codingame.com/playgrounds/334/genetic-algo rithms/history (accessed Jan 30, 2022).
  5. Worden, K.; Liu, S.; Das, D.; Avi Ceder, A. Genetic Algorithm https://www.sciencedirect.com/topics/engineering/genetic-algo rithm (accessed Jan 11, 2022).
  6. Dynamic Programming https://www.geeksforgeeks.org/dynam ic-programming/ (accessed Jan 30, 2022).
  7. Continuous optimization. https://uwater loo.ca/combinatorics-and-optimization/research-combinator ics-and-optimization/research-areas/continuous-optimization (ac cessed Jan 12, 2022).
  8. Indian Computing Olympiad Archives 2012 -IARCS. https:// www.iarcs.org.in/inoi/2014/zco2014/zco2014-2b.php (accessed Jan 17, 2022).
  9. Time complexity of genetic algorithms exponentially ... https:// fernandolobo.info/p/gecco00.pdf (accessed Jan 13, 2022). Agnishom. ZCOSolutions/ipl.cpp at master • Agnishom/Zcosolu tions.
  10. Bajpai, P.; Kumar, M. Genetic Algorithm -an Approach to Solve Global Optimization Problems https://www.researchgate.net/ (ac cessed Jan 20, 2022).
  11. Tandberg-Hanssen, E.; Emslie, A. G. The Physics of Solar Flares; Cambridge University Press: Cambridge, 2009.
  12. Kontar, E. P.; MacKinnon, A. L.; Schwartz, R. A.; Brown, J. C. Compton backscattered and primary X-rays from solar flares: An gle Dependent Green's function correction for photospheric albe do. https://www.aanda.org/articles/aa/abs/2006/06/aa3672-05/ aa3672-05.html (accessed Apr 17, 2022).
  13. Kane, S. R.; McTiernan, J. M.; Hurley, K. Multispacecraft observations of the hard X-ray emission from the giant solar flare on 2003 November 4. https://ui.adsabs.harvard.edu/ abs/2005A%26A...433.1133K/abstract (accessed Apr 17, 2022).
  14. GMS: Ionosphere Graphics. https://svs.gsfc.nasa.gov/12960 (accessed Apr 17, 2022).
  15. HOLLINGWORTH, J. Structure of the Ionosphere. Nature 1934, 134 (3386), 462-462.
  16. Sutherland, L. C.; Bass, H. E. Atmospheric Absorption in the Atmosphere up to 160 Km. The Journal of the Acoustical Society of America 2004, 115 (3), 1012-1032.
  17. The Editors of Encyclopaedia. Photoelectric effect. https:// www.britannica.com/science/photoelectric-effect (accessed Apr 17, 2022).
  18. PRATT, R. H.; RON, A. K. I. V. A.; TSENG, H. K. Atomic Photoelectric Effect above 10 Kev. Reviews of Modern Physics 1973, 45 (2), 273-325.
  19. Watanabe, K. Ultraviolet Absorption Processes in the Upper Atmosphere. Advances in Geophysics 1958, 153- 221.
  20. Lesson 34: Photoelectric effect graphs -studyphysics. http://www.studyphysics.ca/2007/30/07_emr/34_photo_ graphs.pdf (accessed Apr 16, 2022).
  21. A parameterized model of x-ray ... -wiley online library. https://agupubs.onlinelibrary.wiley.com/doi/ full/10.1029/2018RS006666 (accessed Apr 16, 2022).
  22. Švestka, Z. Solar Flares. 1976.

FAQs

sparkles

AI

What is the accuracy margin achieved by genetic algorithms in solving Olympiad problems?add

The study found that genetic algorithms can propose solutions within a 5% margin of accuracy after 2000 generations.

How does the initialization method impact population diversity in genetic algorithms?add

Random gene assignments during initialization enhance genetic diversity, thus broadening the solution search space significantly.

What role does the fitness function play in genetic algorithms for optimization problems?add

The fitness function is crucial as it quantitatively determines each individual's optimality, influencing subsequent selection processes.

In what ways do genetic algorithms compare to traditional programming techniques in problem-solving?add

Genetic algorithms can efficiently solve complex optimization problems, outperforming traditional methods, especially where time complexity escalates.

How do mutations contribute to the effectiveness of genetic algorithms?add

Mutations introduce genetic diversity which prevents the algorithm from converging to local optima, maintaining exploration of the solution space.

About the author

Computer Science

Papers
1
Followers
1
View all papers from Özgür Güzeldereliarrow_forward