Basma M.

asked • 10/14/13

Probabilities of different values of an equation under constraints and values' ranges

Good Greetings,

If one entity has a number n (from 1 to N) has an equation
computing the value of a variable like that:

T(S) = (n + random(0,constant1 mod S)) mod (constant2-constant3)
+ SUM(T(s=0:S-1)) mod constant3    

The maximum and minimum value of the T(S) is known to the
entity let them equal 0 and 20

How such an entity has a number n from 1 to N can calculate
the probability that the value of T(S) equals 0 or 1 or 2 or .............20

P(T(S) = 0) , P(T(S) = 1), P(T(S) = 2),... ,P(T(S) = 20) when
S= 0

P(T(S) = 0) , P(T(S) = 1), P(T(S) = 2),... ,P(T(S) = 20) when
S= 1

P(T(S) = 0) , P(T(S) = 1), P(T(S) = 2),... ,P(T(S) = 20) when
S= 2

...

...

...

with the knowledge that as shown in the equation, T(S) depends
on its previous values, T(S=3) depends on T(S=2) and T(S=1) and T(S=0)

Thank you in advance.

1 Expert Answer

By:

Timothy S. answered • 10/15/13

Tutor
5 (9)

Will help you LOVE math, science, and computing!

Basma M.

First thank you very much for the reply and for consuming
time to reply to my question, then,

 
I would like to use this equation to determine one expression
represents the transition probability in a markov chain to different states which
are the range of values generated by this equation. This expression of course
will be used to derive other expressions through the chain.

 
The given and the function you asked for if they correct or
not are correct. The variables and the chain are discrete and the probability
of having an element of the equation output range should be a general
expression gives the correct output with different S values, this for each n∈{k:1≤k≤N ∧ k∈Z+}.  

 

Respectfully.
Report

10/15/13

Timothy S.

Okay, let's formalize this a bit--hopefully this framework will help us determine a method for solving the problem. 
 
A markov model is basically just a weighted digraph. Thus, we can adopt a language similar to that used to describe finite state machines. 
 
In your case, since a markov model is a representation of a stochastic phenomenon, this is a non-deterministic finite state automata--as apposed to a deterministic one.
 
This is represented by a quintuple of sets / variables / mappings as so:
 
NFA = {Σ,Q,q0,Δ,F}
 
Where Σ is a set of possible inputs (an "alphabet" if you will)
Q is a set of states in your model
q0 is the initial state
F is a set of final states (improper subset of Q or possibly null)
and Δ is a transition function that maps Σ × Q → P(Q) (the cartesian product of the alphabet Σ and the states Q onto the power set of Q)
 
In this situation, however, we must adapt the transition function to contain the weights as well. 
 
so now Δ: Σ × Q → P(Q) × C | C ∈ ℜ∧ 0 ≤ C ≤ 1
 
What we would like to do is to determine the transition function Δ.
 
The real number C for a given state is a probability. That probability is the weight on the graph, and, by definition, is given by the number of occurrences of the functions range in question divided by the number of occurrences of all elements in the range in one period of the function. 
 
You have a generating function T(S,N,c0,c1,c2) whose domain is the cartesian product of these 5 independent variables, and whose range is some subset of the real numbers. 
 
In order to convert your generating function into a probability, we will need the inverse operation T-1.
 
The number of solutions for T-1 in S, for some T(S) == k,  divided by the total number of solutions for T-1 in S, ∀S, provides the probability of T(S,.,...) = i.
 
Since your function contains both a summation and modular arithmetic, finding an inverse will be a bit tricky. But with some clever thought to how each of these operations and moduli affect the cardinality of the solution spaces, it should be analytically solvable. 
 
Frankly, for most things like this with a small space, it is going to be faster to write yourself a script in an easy language such as PERL or Python to simply count up all the sets and write out the calculated probabilities. But hopefully that should all get you started with whichever way you choose to solve the problem. 
 
Report

10/16/13

Basma M.

Thank you sir for your help
Report

10/17/13

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.