|
The information on google is all about how to make them, But I want the mathematics needed for it and there's no clear answer i got on google for that reason.
|
|
|
|
|
If you go and do some reading on the subject you will discover where the gaps in your knowledge are.
|
|
|
|
|
The general definition of "algorithm", in simple terms, is: A sequence of instructions to solve a problem. I can write an algorithm for how to clean my house. Or for picking apples from a tree. Or for flying a plane. There are as many potential algorithms as there are ideas what to do in this world and the variety of required skills to handle all of them is vast. The same holds true when entering the domain of computer science: There are algorithms for all sorts of stuff. Obviously, logical thinking and some sense for numbers won't hurt. In fact, most algorithms I've come across should be understandable by non-computer scientists if only written down in normal language instead of a programming language. Of course there are algorithms for which you will need very specific mathematical knowledge but the intersection of required skills for understanding arbitrary algorithms remains as simple as: Logical thinking and some sense for numbers.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
The guy behind C++ wrote two books,
The C++ Programming Language is something I believe any serious C++ connoisseur should have chewed on for longer periods of time.
Algorithms in a Nutshell by George T. Heineman, and others is something I just started to read, and so far its good.
|
|
|
|
|
Algebra is the most important, since everything is based on it. Graph theory helps develop the kind of reasoning you need for algorithms. I've found linear algebra useful for real-world algorithms I've had to implement, but it depends on the domain you're working in.
|
|
|
|
|
I'm looking for an algorithm to find all the possible combinations of meetings (details in attached photo). I would like to introduce the teams algorithm calculates all threrefore combinations of matches, or better yet, I could enter the value to the team as the level of play by all the teams and I got all the options from the most probably
Tournament tree: http://prntscr.com/aoukzm[^]
Sorry for my english
|
|
|
|
|
Eric Lippert did a series of blog posts on generating permutations and combinations in C#:
permutations | Fabulous adventures in coding[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Check out my "Alternative Tip": Subset - Sum Problem with Numeric Collections [^]
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
It's not clear what you want. You mention "all the possible combinations", but your link is to an elimination tournament, which is different.
|
|
|
|
|
I've just received an email from codeproject telling me my post (above) has been marked as potentially being spam. WTF??
|
|
|
|
|
Hi,
The problem at first seems to be simple but it is not, al least form me...
Have array/set/group of numbers,
for example:
(3,2,7,1,9,5,5,2,8,6,3,1)
I need to make groups of these numbers, so that each group has element(s) that sum is euqal or max close to certain value, for example 10. Of course I understand that there are lots of solutions, but I need only one.
So, for this set I should get:
A - 2,7,1 -> 10
B - 9,1 -> 10
C - 2,8 -> 10
D - 5,5 -> 10
E - 6,3 -> 9
F - 3 -> 3
of course this is one of possible solution, but I don't need super optimalization for this algorithm.
If anyone has some idea how to approach to this problem I would be very grateful for help.
|
|
|
|
|
Sounds like a backtracking[^] candidate problem to me.
You would have to extend that classical approach to allow sub-optimal group-solutions (where sum < 10 or maybe also where sum > 10 up to a certain maximum)* , temporarily store all potential overall-solutions and when the backtracking is done, pick the best based on some criteria that you have to define. E.g. where the sum of differences from 10 is smallest (would be 8 in your example). Or, as you don't need the best possible solution, you could cancel the process once a satisfactory overall-solution has been found.
* : Which means that the evaluation should continue even after finding a potential group-solution until exceeding the tolerable limit.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
I'd go for a rather simple implementation; sort the values, highest value first. In a loop, fetch a number from the array. Move right and keep adding numbers until you hit maximum. At maximum, fetch new number.
That's a rather blunt way of doing it though - backtracking would give a better result.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
This looks a lot like the Subset-Sum problem, but not exactly...
Check out my "Alternative Tip": Subset - Sum Problem with Numeric Collections [^]
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
Hi all,
I'm a long time reader and lurker of codeproject articles in the Daily Build. I really enjoy that some articles are quite simple and as I've progressed through my career, I've been able to learn from more in-depth thoughtful articles. I'm wondering if anyone has a similar place for mathematics. It would be nice if the articles would come to my email, but I'd like for it to have a wide array of expertise. Also, I'm not looking for a question/answer site, but rather somewhere people can share their ideas and findings that are not quite at the level of novel academic research (i.e. I'd like to understand what I'm reading). Does anyone know of a place?
Matthew Schmidt
Computational Physicist
Rhode Island Hospital
|
|
|
|
|
|
Hi!
So..i have some objects in set with integers properties.
player1 = {endurance:5,ovr:7},
player2 = {endurance:9,ovr:3},
....
I have to divide this set into 2 very well balanced subsets about their properties if 0 is min endurance and ovr and 10 is max endurance and ovr are the limits.
At first I had only one property and that was easy.First take the biggest and put it in the set A.The next biggest put it in the set B and etc..
So..Is there an algorithm that can solve my problem for 2 properties in this case? Thank you,guys!
|
|
|
|
|
What about using the same method you used before but basing it on the sum, or product (or other kind of operation) of endurance and ovr?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
|
<pre lang="C#">
Adam works in the in networking security cell. He wants to generate secret keys
following a pattern. The pattern consists of the characters X and Y.
where X means increasing and Y means decreasing. Help him devise an
algorithm to generate the secret key which is the minimum number encoded
following that pattern. Digits from 1-9 and digits can’t repeat.
Sample Input: Sample Output:
X 12
YXYX 21435
YYXYYXXY 321654798
</pre>
|
|
|
|
|
Your homework should serve the purpose that you learn something. And that something isn't supposed to be how to get other people to doing your homework for you.
Your assignments will get more difficult over time - so if you don't start doing them yourself now you'll never be able to.
So sit down, think about it and try something. If you then encounter a specific problem, feel free to ask - that's the idea of these forums.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Please, how decode a file ASN.1 (binary file) to a file readable in (c++, java)?
Thank you for response.
|
|
|
|
|
It depends what you mean by decode, and what the file contains. Please edit your question and add some proper detail.
|
|
|
|
|
Check out: NCBI ToolBox[^]
It includes a tool to convert ASN.1 to XML.
You could either modify the tool to produce what you want, or
use XSLT[^] to convert the XML to whatever format you want!
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
Here is a thread about parsing the file in Java, Parsing ASN.1 binary data with Java - Stack Overflow[^]
But, it would also be possible in C++. Just read the standard specifications for the file type.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|