Ba G.

asked • 09/14/20

java programming

a) Write a method that takes as input a 2-dimensional matrix representing the joint probability distribution over two variables, and returns the marginal probability distribution for either the row or column variable as a 1-dimensional array. Include a Boolean parameter that allows the caller to specify whether to compute the marginals for the row or column variable. 

b) Write a method that takes as input a 2-dimensional matrix representing the joint probability distribution over two variables, and returns a Boolean value that is true if and only if the two variables are independent. 

1 Expert Answer

By:

Patrick B. answered • 09/14/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.