A
A
alekseyHunter2020-07-18 21:56:27
Algorithms
alekseyHunter, 2020-07-18 21:56:27

How to write an algorithm to determine the chances of an applicant to enter a specialty?

Good afternoon.

I decided to add information about the chance of admission to a specialty for applicants to the university application.
The database contains the following data on applicants: specialty priorities (1,2,3), document type (original/copy).

Problem formulation : Let's say that in total N people applied for M specialties. The applicant wants to know the chance of admission to 3 specialties. Let the number of places per specialty be K.

First stage
I planned to do this in the form of a recursion .
The input is information about the first applicant in the list (top 1). If the chosen specialty is its first priority or the type of document is a copy, exit the recursion. If the second / third, we go to these specialties and start the algorithm from the beginning.
The disadvantage of this algorithm is that at the output we get a huge list / tree, in which, at best, we will bypass only 3 of M specialties and the number of people in each specialty will be 2*K. But the minus is not even in this tree, but in the fact that a stack overflow can happen, because in the worst case it will be M specialties and N people.

Second stage
After compiling this list, it is required to determine the chance of admission.
I came up with the following formula:
Chance = 100 -(Number of places in the ranking * 0.6 - Current place in the ranking) * (Number of places in the ranking / 100)
Here you still need to take into account the type of document with a negative weighting coefficient, but have not yet figured out how .

Third stage
After determining the chance, it is required to recalculate the chances of all applicants, replacing all those with a chance of admission below X percent of the specialty (from 1 to 2, from 2 to 3). There is a chance greater than X percent to stop recalculating the chance of the current entrant.
Here, I assume, there will be a maximum of 3 iterations.

Questions :

  1. Is it possible to use a simpler solution than recursion?
  2. Is the formula for calculating the chance of admission correct?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmshar, 2020-07-19
@dmshar

As you wrote, it is impossible to understand anything at all. If you want criticism of the algorithm - give the algorithm, not some fragmentary set of words.
On the first question. Firstly, where does the traversal of the graph have to do with it? How does he side with this task? Second, what about recursion? Thirdly - so information about the "first applicant on the list" or "top 1" (ie, at least the second?). What does "chosen specialty" mean - where did it come from? "we exit the recursion" - and what about this? What is the result of "going into recursion"? "we start the algorithm from the beginning" - how is it? Why is it necessary to exit the recursion when "copying"? In general - a set of some unrelated fragments of phrases, which cannot be called an algorithm. So, there is nothing to criticize.
On the second question. How can a formula be correct if its coefficients (and the structure itself) are taken from the head and are not supported by anything? What is "document type with negative weight"?? Criminal record, huh? But even if you "invented" the formula, what does it have to do with a person's real chances?
If you want to analyze (or have someone help you analyze) your algorithms - do it in the way accepted in the IT community, not grandmothers on the bench at the gate. But for this, of course, you need to learn this in advance.
PS By the way, iteration and recursion are DIFFERENT forms of implementation of algorithms. And then you have one thing in the title, another in the question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question