mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-11-27 14:13:30 +08:00
formatting source-code for 153fb7b8a5
This commit is contained in:
@@ -11,8 +11,7 @@
|
||||
* \parama [in] B probability of event B
|
||||
* \returns probability of A and B
|
||||
*/
|
||||
double addition_rule_independent(double A, double B)
|
||||
{
|
||||
double addition_rule_independent(double A, double B) {
|
||||
return (A + B) - (A * B);
|
||||
}
|
||||
|
||||
@@ -23,14 +22,12 @@ double addition_rule_independent(double A, double B)
|
||||
* \parama [in] B_given_A probability of event B condition A
|
||||
* \returns probability of A and B
|
||||
*/
|
||||
double addition_rule_dependent(double A, double B, double B_given_A)
|
||||
{
|
||||
double addition_rule_dependent(double A, double B, double B_given_A) {
|
||||
return (A + B) - (A * B_given_A);
|
||||
}
|
||||
|
||||
/** Main function */
|
||||
int main()
|
||||
{
|
||||
int main() {
|
||||
double A = 0.5;
|
||||
double B = 0.25;
|
||||
double B_given_A = 0.05;
|
||||
|
||||
Reference in New Issue
Block a user