Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GSoC] Bernoulli distribution for single random variable in given_condition #16907

Merged
merged 2 commits into from May 27, 2019

Conversation

Projects
None yet
3 participants
@czgdp1807
Copy link
Member

commented May 27, 2019

References to other Issues or PRs

[1] #15836 (comment)

Brief description of what is fixed or changed

As the issue #12237 was being fixed via, #15836 a lot of discussion happened with @Upabjojr as can be seen in the thread. One of the tasks was to return BernoulliDistribution for queries of type, P(f(X), X) where f(X) denotes events like, X > 0, X > a, etc. Detailed reasoning can be seen in the comment referenced above.

Other comments

I have added this to GSoC because this was the part of discussion prior to the acceptance.
In the coming PRs I will try to point P to Probability via deprecation procedure.

Release Notes

NO ENTRY

@sympy-bot

This comment has been minimized.

Copy link

commented May 27, 2019

Hi, I am the SymPy bot (v147). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

  • No release notes entry will be added for this pull request.

Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.

Click here to see the pull request description that was parsed.

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234". See
https://github.com/blog/1506-closing-issues-via-pull-requests . Please also
write a comment on that issue linking back to this pull request once it is
open. -->
[1] https://github.com/sympy/sympy/pull/15836#issuecomment-476190440

#### Brief description of what is fixed or changed
As the issue https://github.com/sympy/sympy/issues/12237 was being fixed via, https://github.com/sympy/sympy/pull/15836 a lot of discussion happened with @Upabjojr as can be seen in the thread. One of the tasks was to return `BernoulliDistribution` for queries of type, `P(f(X), X)` where `f(X)` denotes events like, `X > 0`, `X > a`, etc. Detailed reasoning can be seen in the comment referenced above.

#### Other comments
I have added this to GSoC because this was the part of discussion prior to the acceptance. 
In the coming PRs I will try to point `P` to `Probability` via deprecation procedure.

#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
NO ENTRY
<!-- END RELEASE NOTES -->

assert U == Probability(X > 0, X)
W = P(X + Y > 0, X)
assert W == Probability(X + Y > 0, X)
assert U == BernoulliDistribution(1/2, 0, 1)

This comment has been minimized.

Copy link
@Upabjojr

Upabjojr May 27, 2019

Contributor

This looks good to me.

@codecov

This comment has been minimized.

Copy link

commented May 27, 2019

Codecov Report

Merging #16907 into master will increase coverage by 0.014%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##            master   #16907       +/-   ##
============================================
+ Coverage   73.906%   73.92%   +0.014%     
============================================
  Files          619      619               
  Lines       160001   160005        +4     
  Branches     37554    37555        +1     
============================================
+ Hits        118251   118277       +26     
+ Misses       36269    36253       -16     
+ Partials      5481     5475        -6
@czgdp1807

This comment has been minimized.

Copy link
Member Author

commented May 27, 2019

ping @Upabjojr

@Upabjojr Upabjojr merged commit 535a85b into sympy:master May 27, 2019

3 checks passed

codecov/project 73.92% (target 0%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
sympy-bot/release-notes The release notes look OK
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.