Go Back   Science Forums > Physical Sciences Forums > Computer Science and Technology
Reply
 
LinkBack Thread Tools
Old 12-18-2008   #1 (permalink)
JulianKeller's Avatar
Thinking


 
JulianKeller is an unknown quantity at this point
 



Not Ranked  0 score     
How do I make an algorithm?

How do I make an algorithm to calculate the probability of information that I provide the program?
Reply With Quote
Old 12-18-2008   #2 (permalink)
Buffy's Avatar
Resident Slayer

Administrator

Location:
Sunnydale, CA
 
Buffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond repute
 



Not Ranked  0 score     
Re: How do I make an algorithm?

You're going to need to clarify that quite a bit more:

What do you mean by "the probability of information?"

What does the program do?

Why do you care about that probability?

For a list of all the ways technology has failed to improve the quality of life, please press three,
Buffy


----------------
"If you do not agree with anything I say, I'll not only retract it, but deny under oath that I ever said it!"
__________________________________________________ ______________-- Tom Lehrer

"No Robbie, not Europe!"


Forum Administrator
Hypography Science Forums - Science for Boys and Girls! Its not for nothing that we hang out here.
Reply With Quote
Old 12-18-2008   #3 (permalink)
JulianKeller's Avatar
Thinking


 
JulianKeller is an unknown quantity at this point
 



Not Ranked  0 score     
Re: How do I make an algorithm?

I want to make a program where I input information, it processes the probability of the most likely outcome based on variables, then spit out the most likely answer.


If I input what is the probability of these three characters winning in a duel.

A
HP: 20
MP: 15
Spec: 11
ATK: 09

B
HP: 20
MP: 14
Spec: 11
ATK: 19

C
HP: 19
MP: 20
Spec: 15
ATK: 10

The program that I make would be able to take this data and figure out which one has the most likely chance of beating the other, A, B, or C, and then which one has the best chance of winning altogether. :P

Why? Because I choose too? :P The purpose of this program as a whole is strictly on a need to know basis, I just am asking for help in this piece of the puzzle.
Reply With Quote
Old 12-18-2008   #4 (permalink)
Buffy's Avatar
Resident Slayer

Administrator

Location:
Sunnydale, CA
 
Buffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond reputeBuffy has a reputation beyond repute
 



Not Ranked  0 score     
Re: How do I make an algorithm?

Unfortunately, the answer really is "it's complicated."

I've had just enough experience playing those silly shoot-em-up games to understand what you mean by those codes...but I think that obfuscates things to the point where I won't be clear so let me elaborate using a bit simpler analogy...

Let's say a Quarterback has a completion percentage of 30% and yards per play of 10 yards (for those of you who live outside the US, a Forward has a scoring percentage of 30% (3 goals per 10 shots on goal) and 5 shots on goal per game or some such) [and don't anyone complain that these numbers are crazy in the real world because it's just an *example*! I'm a 49ers and Arsenal fan, but I don't claim to actually know anything about either kind of football!]. In order to have an idea of whether or not this guy has a chance of winning a game (match) depends on an enormous amount of historical data that would provide a mechanism for correlating having these ratings with winning.

Now that's just working in the "real world" when in the "fake world" of video games, in fact these data points are applied to formulas to figure out who between two opponents are going to win a particular face off. In simpler games there's a completely deterministic formula for determining the outcome. In any program that is more sophisticated, a (usually) Poisson distributed random number is applied to various parts of the function to generate "random" but "somewhat predictable" outcomes. In such cases, while you can use historical data in the same way that you would a "real world" situation, if you actually have access to the algorithms, you can manipulate them to determine the effect of the application of the random numbers to develop a probability function based on the two sets of input parameters. That in itself will be an interesting algebraic (or more probably, a calculus) problem.

In any case, there is no "general solution" given what you've presented, its entirely based on either the empirical relationships between the four parameters, or a knowledge about the functions that the program uses to determine outcomes.

Events in the past may be roughly divided into those which probably never happened and those which do not matter,
Buffy


----------------
"If you do not agree with anything I say, I'll not only retract it, but deny under oath that I ever said it!"
__________________________________________________ ______________-- Tom Lehrer

"No Robbie, not Europe!"


Forum Administrator
Hypography Science Forums - Science for Boys and Girls! Its not for nothing that we hang out here.
Reply With Quote
Old 12-19-2008   #5 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: How do I make an algorithm?

yes, i'm with buffy, it can be extremely complicated, infact let me expand that, it can be as easy or as complicated as you want it to be.

It depends on not only what information you are considering, but also how you are computing it. Until you describe the process you want to use to calculate the probability, all the variables, values, methods etc, we cant, beyond being very very vague, describe how you'd go about it.

the data you give is vague, we wanna know how you want to compute the probability (math side of it), is it only based on these values, how do you want to restrict the calculation, how you want to approximate, etc, etc, give us a verbal equation, we can tell you how to go about such algorithm. BTW if you dont understand the math and logic behind probability calculations, you shouldn't be starting on this project until you understand, notice distinction, not just be able to figure out probability in 2 scenarios, understand how probability works and be able to create your own functions based on the data you have.


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 12-19-2008   #6 (permalink)
maddog's Avatar
Creating


Location:
Akron, OH
 
maddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud of
 



Not Ranked  0 score     
Cool Re: How do I make an algorithm?

Quote:
Originally Posted by JulianKeller View Post
I want to make a program where I input information, it processes the probability of the most likely outcome based on variables, then spit out the most likely answer.


If I input what is the probability of these three characters winning in a duel.

A
HP: 20
MP: 15
Spec: 11
ATK: 09

B
HP: 20
MP: 14
Spec: 11
ATK: 19

C
HP: 19
MP: 20
Spec: 15
ATK: 10

The program that I make would be able to take this data and figure out which one has the most likely chance of beating the other, A, B, or C, and then which one has the best chance of winning altogether. :P

Why? Because I choose too? :P The purpose of this program as a whole is strictly on a need to know basis, I just am asking for help in this piece of the puzzle.
I think I vaguely remember such values. Let's see ...

I assume HP means Hit Points, ATK means Attack (%) Percentage and Spec just means some special ability. Not sure what MP means...

As Buffy was saying "assuming" you "knew" what deterministic "process" you do with these values. You could calculate the resultant Probability. That process would be your algorithm.

So do you know that process.

Let's say A attacks B (frontal attack)
Damage (DMG) done on B by A would be some factor of ATK value mitigated by some Defense factor of B. without this process it is all guesswork.

Hope this helps.

maddog
Reply With Quote
Old 12-19-2008   #7 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: How do I make an algorithm?

mp is either magic or mana power i assume and it enhances the special abilities


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 12-19-2008   #8 (permalink)
maddog's Avatar
Creating


Location:
Akron, OH
 
maddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud ofmaddog has much to be proud of
 



Not Ranked  0 score     
Re: How do I make an algorithm?

Quote:
Originally Posted by alexander View Post
mp is either magic or mana power i assume and it enhances the special abilities
Yeah -- I think you're right Mana it is then.

maddog
Reply With Quote
Old 12-19-2008   #9 (permalink)
Pyrotex's Avatar
Slaying Bad Memes

Moderator
Editor

Location:
Houston, Texas
Latest blog entry:
 
Pyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond reputePyrotex has a reputation beyond repute
Send a message via MSN to Pyrotex
 



Not Ranked  0 score     
Re: How do I make an algorithm?

Quote:
Originally Posted by JulianKeller View Post
I want to make a program where I input information, it processes the probability of the most likely outcome based on variables, then spit out the most likely answer.
If I input what is the probability of these three characters winning in a duel.
A
HP: 20
MP: 15
Spec: 11
ATK: 09
...
Julian,
in theory, any of us can show you how to make an algorithm for this purpose. But I feel your level of "secrecy" is a bit high--and unnecessary. None of us are gonna steal your idea and make our own game.

So, let me tell you how to make an algorithm -- in the broadest general terms.

First, decide EXACTLY what "HP", "MP", "Spec", "ATK" (and others) mean in your game. Is "HP" the number of health points for the duelist? [When they go to zero, the duelist dies.] Or is "HP" the number of hit points subtracted from the other guy's health points. Write your definitions out until you're sure they are clear and unambiguous.

Second, decide what kind of number each parameter is. Is it a QUANTITY of something? Like health, or luck, or wisdom, or godliness or cleanliness? Or is it a PROBABILITY that something will (or will not) happen? For example, "MP" could be the probability that each duelist in turn will successfully land an attack on the other. How are each of these parameters to AID the duelist? How do you want health to work? How will wisdom work? Perhaps wisdom will aid the duelist to block attacks? Or increase the possibility of landing an attack with double hit points?

Third, decide what the output of the algorithm will be. Is it to output the winner of the duel? Is it to output just the probability that each duelist will win if pitted against each other? Or is the algorithm supposed to actually play out the duel (using probabilities where appropriate), and also adjust their parameters to reflect the battle. For example, reducing the winner's health points.

Fourth -- and this is the important part -- pick a pair of duelists and talk yourself through a battle. What happens first? Does the duelist who "starts" the battle always have the opportunity to attack first? Which parameters are most important and are used first? How is "death" or "losing" calculated? If the target survives the first attack, what other calculations do you want before having the target counter-attack? Like, where does "luck" or "godliness" come into this battle?

Fifth, once you have talked yourself through a battle and you know just the way it should turn out, then write down the algorithm. You know what the inputs are: the parameter tables of your two duelists. Your internal logic will likely be a big loop where the first duelist attacks, then the target counter-attacks. If both are still alive, then go back to the top of the loop and repeat--until one dies (or runs). The outputs of the algorithm might be just the updated parameter tables of the two duelists, and an outcome number which states whether the loser died or ran away.

The fifth step will only be as good as the "story" you create in step four.

Does that help?


----------------
Hypography Forums Moderator
-- - - - - -
What concerns me is not the way things are, but rather the way people think things are.
Epictetus, Greek Philosopher
The map is NOT the territory.
Korzybski, Polish-American Philosopher
Reply With Quote
Old 12-19-2008   #10 (permalink)
JulianKeller's Avatar
Thinking


 
JulianKeller is an unknown quantity at this point
 



Not Ranked  0 score     
Re: How do I make an algorithm?

The program is designed to take in a tournament program designed to interpret data from the last 10 matches of each of the contestents, imputted by the user [when the time comes another program.

A maximum of 12, and a minimum of 8. [It's supposed to be an expansion of a program someone else had made buuuuuuuuut I'm doing it my way. Cause if I figure out how to do it at 12 to 8, I can do it myself and work it all the way down to 1 and just replace the older program with my new one. It'll win me guild points and it'll give the senior programmer 'artist points' allowing him to retire one of his programs and being respected for having it run so long. He is ecstatic about my attempts to do this, because he is my mentor :P but enough of the history lesson :P... where was I?... *thinks...* I hurt my head, got to invent a way that makes thinking nonhazardous to my health.... okay. so the progam currently runs 1 to 8 tournament contestants. The data is imputted by the judges. The judges use the last 10 or so matches, they have a system that I have requested to get a copy of for this algorithm that they use to sometimes void matches altogether. Such as ties and stuff like that do not count as a valid history, but some of the information leading up to the tie does. Sooo the new program here inputs a minimum of 8, to a max of 12 contestant's past 10 game scores.

The scores are then compared and the probability of each is weighed against all of the others. Then the program predicts based on the calculations it does, in a precise order, who would win and in what order they will win based on the last 10 game scores/histories of the players.

The factors at this time that are used in the calculation are being requested along with the way the judges score the histories of the past game scores so I will not know till I get them, although they are due in the mail any day now.

It's for a Fight Club. We are seeing if we can predict the possibilities of who will win based on personal data provided by each member, and measuring it up to their last 10 fights. Some things such as if they get blind sided by a light, go into a category for lack of concentration [how many times this has happened in the last 10 fights, I do know if it has happened a certain number of times the Judges discount it altogether. My attempt is to actually improve on this by just having this as a handicap in the program's deterministic processing.

Human behaviour is often unpredictable, but it is a tradition in our fight club to predict the outcome of the fights based on numbers and facts. It's how most of us keep sharp in our jobs. Calculating how many times in the last few fights the other guy decides to throw a right hook, as opposed to his left. Using psychology to analyze if it is his style to use the right hook or if it is what he is doing to win the fight. Style outweighs, 'being in the moment' by 4 to 1. However if the player becomes aware of the style in the fight circle, then that can be a surprise leading to new mark ups and new game scores, and a new history. But a history is usually the last 10 to 20 fights.

I personally want the program to once the information is put on a fighter, as long as they are an active member and haven't "jacked out" [meaning quit the fight club] then I want all their information stored in there for eventual upgrades to the program where it can go back and deduce their entire history and probable outcome against another fighter who has less of a history. I just have to figure out how that kind of equation would work, and then translate it to the algorithm for the upgrade. <_< Admittedly I'm new to the fight club, but all of the guys in there are the nerds and the geeks, we have a chef, restaurant owner, we have 2 millionaires, and we have valets, all of them as a right of passage have contributed to the fight club in some way. My mentor is like me, he didn't know much about something and he tackled it and it became a tradition of the fight club to use his program in what we call tournaments.

The idea of fight club goes against tournaments, but honestly a tournament is for the more humble members. The ones who don't have as much as the rest, the guy who begs on the corner for a buck - these are the guys who qualify for the Tournament. Everyone pitches in something for the winners. It's usually a group of 8, but we are expanding it to 8 to possibly 12. Then everyone who is chosen to fight in the tournament will get something based on how they rank. This program actually would help us before hand have all of the arrangements ready for the most likely candidates and in what order their 'prizes' will be given.

Enough of the history type thing I talk too much I just am attempting to convey that this is an important thing I am doing here by asking for help in making this, and telling you what it is and what it is used for.

Everyone knows that I've already broken the infamous, "Don't talk about fight club" rule... now you know how badly I want to get this done. I hope that my story touches you all enough that you could help make this dream of mine, to contribute to something I feel is very important to not only me but my brothers who participate in our club.


So plz tell me step by step what I need to do if you can. Give me a general idea. A couple of people already have sort of done that. I'll post more when I know how they score the game scores and histories.

Sorry for making everyone think it was a game. I just figured it'd be best to keep it under wraps, but I figure if you all knew you'd be more willing to help. If nothing for the simple fact you could say you helped a fight club.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
General algorithm of science ughaibu Watercooler 5 01-16-2008 08:35 AM
Gdb and make? sanctus Computer Science and Technology 2 08-01-2007 02:15 AM
Message Read Algorithm/Data Structure: A Programming Challenge Buffy Computer Science and Technology 22 11-11-2006 05:49 AM
An algorithm to generate all the perfect right triangles CraigD Physics and Mathematics 26 02-27-2006 11:45 AM
PRMP - an algorithm for generating the primes using only “+1” and “=” CraigD Physics and Mathematics 9 08-20-2005 02:13 PM

» Advertisement
» Current Poll
Who's the sexiest man alive? Johnny Depp or Robert Pattinson?
Johnny Depp - 30.00%
3 Votes
Robert Pattinson - 0%
0 Votes
Someone else (please specify) - 40.00%
4 Votes
I'm too macho to think a guy is sexy - 30.00%
3 Votes
Total Votes: 10
You may not vote on this poll.


All times are GMT -8. The time now is 12:30 PM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
Copyright © 2000-2009 Hypography
Part of the Hypography - Science for Everyone Network