ghang Posted May 1, 2009 Share Posted May 1, 2009 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 ! Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted May 1, 2009 Share Posted May 1, 2009 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)<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. Quote Link to comment Share on other sites More sharing options...
ghang Posted May 1, 2009 Author Share Posted May 1, 2009 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)<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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.