Jump to content

what is the way to wirte probability expression


Recommended Posts

Hi all , I need some idea about how to write a probability expression, what expression function is related ?

for example:

$TX is between 1 - 20;

rand($TX) ;

90% of rand($TX) is greater than 15 ;

10% of rand($TX) is smaller than 15 ;

anyone have any idea ?

cheers !

Link to comment
Share on other sites

Hi all , I need some idea about how to write a probability expression, what expression function is related ?

for example:

$TX is between 1 - 20;

rand($TX) ;

90% of rand($TX) is greater than 15 ;

10% of rand($TX) is smaller than 15 ;

anyone have any idea ?

cheers !

if(fit($TX,1,20,0,1)<0.9,gt15,lt15)

Where gt15 represents the "greater than 15" result (with 90% probability) and lt15 represents the "less than 15" result (with 10% probability)... assuming $TX is uniformly distributed in [1,20].

Except then you said rand($T) which makes the 1<=$TX<=20 domain not applicable since rand($TX) is in [0,1] (with presumably uniform distribution). So in that case, you'd simply have:

if(rand($TX)&lt;0.9,gt15,lt15)

I don't know the context, but I imagine you're looking for the second expression above, and the 1<=$TX<=20 constraint is just a red herring, but maybe not; hard to tell.

HTH.

Link to comment
Share on other sites

if(fit($TX,1,20,0,1)&lt;0.9,gt15,lt15)

Where gt15 represents the "greater than 15" result (with 90% probability) and lt15 represents the "less than 15" result (with 10% probability)... assuming $TX is uniformly distributed in [1,20].

Except then you said rand($T) which makes the 1<=$TX<=20 domain not applicable since rand($TX) is in [0,1] (with presumably uniform distribution). So in that case, you'd simply have:

if(rand($TX)&lt;0.9,gt15,lt15)

I don't know the context, but I imagine you're looking for the second expression above, and the 1<=$TX<=20 constraint is just a red herring, but maybe not; hard to tell.

HTH.

ooooo!!!! thanks very very very much , i will try it out and see !!!! you're genius!

cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...