473,486 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Again in english: Problem with probability formula for gaming logic

Hi,

Sorry for posting in German before, totally forgot about that when I was
pasting this in here from another German newsgroup I was writing to, trying
to get help

I am programming a simple version of a soccer simulation
The logic works like this so far:

[GPG] = constant value goals/game

every minute the chance for a goal is [GPG]/90.
That goals is shot with probability X by Team1, with (1-X) by Team2.

Right now X is set at 50%

I'd like to build in a teamstrength formula now.

I have a few ideas how to do so already, but I'd like to check some
probabilities mathematically first but
I am afraid my maths in that area isn't good enough really.

Maybe someone can help me and write up a formula for me and maybe even
explain it a bit:

On the basis of the system descibed above, GPG/90 probability for a goal per
minute with X% to Team 1 with 1-X% to team 2 - with what probability wins
team1, what probability for a draw and what probability for team2 winning.
I need a formula for that which depends on GPG and X

A first try that I made to approach this problem seems to be faulty
somewhere:

Probability for Team1 winning while shooting exactly 2 goals:

X = probability for Goal by Team1 per minute (here 2,855/90 * 50% = 0,01585)
Y = probability for no goal per minute (here 1-(X+Z) = 0,9682778)
Z = probability for Goal by Team2 per minute (hier 2,855/90 * (100%-50%) =
0,01585)

In 2 of 90 minutes Team1 must shoot a goal

=> X^2

In 87 of 90 minutes no goal must be shot, because either Team1 will have
more than 2 goals or doesn't win

=> Y^87

In the remaining 1 minute can either fall no goal or one for team 2 as long
as the goal count of 2 for team1 doesn't change by them shooting one

=> (Z+Y)^1

Probability total = X^2 * Y^87 * (Z+Y)^1

That seems so be wrong though since the value makes no sense.

Any help is apprechiated and if possible please not just hints but the full
formula. This is not for a test or something if you
might think that, it's not even for the game itself, it's just something
that would really help me trying to balance the logic of the game by
calculating a few possible ways of programming it before implementing them.

Thanks
Aug 4 '05 #1
2 2058
Andreas Schmitt wrote:
Sorry for posting in German before, totally forgot about that when I was
pasting this in here from another German newsgroup I was writing to, trying
to get help

I am programming a simple version of a soccer simulation
The logic works like this so far:

[GPG] = constant value goals/game

every minute the chance for a goal is [GPG]/90.
That goals is shot with probability X by Team1, with (1-X) by Team2.

Right now X is set at 50%

I'd like to build in a teamstrength formula now.

I have a few ideas how to do so already, but I'd like to check some
probabilities mathematically first but
I am afraid my maths in that area isn't good enough really.
[..]


Sorry, Andreas, but what does it all have to do with the Standard C++
language, the subject of this newsgroup? If you need help with figuring
out probability, post to a mathematics newsgroup (sci.math.*), if you need
a general algorithm help, comp.programming should be your choice. Only if
you have a C++ _language_ question should you post here, please.

V
Aug 4 '05 #2
Andreas Schmitt sade:
Probability total = X^2 * Y^87 * (Z+Y)^1

That seems so be wrong though since the value makes no sense.

Any help is apprechiated and if possible please not just hints but the full
formula. This is not for a test or something if you
might think that, it's not even for the game itself, it's just something
that would really help me trying to balance the logic of the game by
calculating a few possible ways of programming it before implementing them.

Thanks


Maybe comp.games.development.programming.algorithms is a more
suitable newsgroup. Or a general math-newsgroup.

Tobias
--
IMPORTANT: The contents of this email and attachments are confidential
and may be subject to legal privilege and/or protected by copyright.
Copying or communicating any part of it to others is prohibited and may
be unlawful.
Aug 4 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
2747
by: michele.simionato | last post by:
Paul Rubin wrote: > How about macros? Some pretty horrible things have been done in C > programs with the C preprocessor. But there's a movememnt afloat to > add hygienic macros to Python. Got any...
2
1783
by: fkissam | last post by:
I would like dictionary databases to translate for English to French AND English to Spanish. I am looking to put in on my PalmOS V5. If they are in PC format, I can convert them for my Palm. ...
8
8595
by: Bri | last post by:
Greetings, I am using Eval() in a query with only limited success. If the text within the function contains a reference to a Field I get #ERROR#. I'll try and explain what I'm trying to do and...
2
3139
by: celsius | last post by:
Hi folks, Al Bowers wrote this program on comp.lang.c Date: 2001-07-09 13:41:58 PST #include <stdio.h> int isleap (unsigned yr); static unsigned months_to_days (unsigned month); static long...
8
4371
by: Jack | last post by:
When I use rand(), is the RAND_MAX value how long I am guaranteed that the same value will not appear twice? And is this a floating window? For example, if RAND_MAX is 32767, and I make...
6
1639
by: Michael Trausch | last post by:
Hello everyone, I'm having a little bit of trouble trying to implement some arithmetic logic into an application that I'm working on, and I'm hoping that somebody can possibly point me in the...
21
2882
by: BWIGLEY | last post by:
Basically I've just started making a game. So far it makes an array 25 by 20 and tries to make five rooms within it. In scr_make_room() there's parse errors: 20 C:\c\Rooms\Untitled1.c parse error...
3
2011
by: Arun Nair | last post by:
''' Can anyone help me with this program it just takes probability of the first team and runs the program doesnt takes the probability of the second team even though specified''' from random...
5
1684
by: Fred | last post by:
Hi, i'm looking to find out exactly what .net can do for me. Can anyone post a link to a plain english version of what it can / can't do etc etc. Cheers
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5427
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.