-1
$\begingroup$

While this question can be solved using some (hand) analysis and standard calculus, I would have thought that the following code would have worked:

Clear[x, y, c];
Expectation[x \[Conditioned] x + y > c, 
  x \[Distributed] NormalDistribution[] && 
  y \[Distributed] NormalDistribution[]]

It doesn't. Is there a way to use Expectation and Conditioned for this problem?

@AlexTournev caught my silly syntactic error: One should use brackets, not &&. Thanks!

$\endgroup$
1
$\begingroup$
Clear[x, y, c];
Expectation[
 x \[Conditioned] x + y > c, 
 {x \[Distributed] NormalDistribution[], 
  y \[Distributed] NormalDistribution[]}]

(*

E^(-(c^2/4))/(Sqrt[\[Pi]] Erfc[c/2])

*)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Well... a simple syntactic error. I hope you won't mind if I post this answer (citing you) on the source page. Thanks! $\endgroup$ – David G. Stork Jan 22 '19 at 0:22
  • $\begingroup$ OK! You can rewrite your code. $\endgroup$ – Alex Trounev Jan 22 '19 at 0:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.