1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
antiseptic1488 [7]
3 years ago
10

Each of k jars contains m white and n black balls. A ball is randomly chosen from jar 1 and transferred to jar 2, then a ball is

randomly chosen from jar 2 and transferred to jar 3, etc. Finally, a ball is randomly chosen from jar k. Show that the probability that the last ball is white is the same as the probability that the first ball is white, i.e. , it is m/(m + n) .
Write a short Python program for problem 22. Provide indented code and comments explaining your solution.
Computers and Technology
1 answer:
Elodia [21]3 years ago
3 0

Answer:

#initial probability of getting a white ball

init_prob_white=15/25

#initial probability of getting a black ball

init_prob_black=10/25

#probability of getting a white ball given

#that we transferred a white ball in previous

#step is 16/26 which we represent by pww

pww=16/26

#probability of getting a white ball given

#that we transferred a black ball in previous

#step is 15/26 which we represent by pwb

pwb=15/26

#similarly

pbb=11/26;

pbw=10/26;

#The below two functions are recursive which calculate

#total probability right from the start

#The formula they use are

# Prob(W_k)=Prob(W_k-1)*Prob(W_k | W_k-1)+

# Prob(B_k-1)*Prob(W_k | B_k-1)

def pw(n):

if n==1:

return init_prob_white;

else:

return (((pww)*pw(n-1))+((pwb)*pb(n-1)))

def pb(n):

if n==1:

return 10/25;

else:

return (((pbb)*pb(n-1))+ ((pbw)*pw(n-1)))

#for k=5

k=5

x=pw(k)

print("After "+str(k)+" transfers probability="+str(x))

Explanation:

You might be interested in
// GetData() method accepts order number and quantity // that are used in the Main() method // Price is $3.99 each using System;
Amiraneli [1.4K]

Answer:

The method definition to this question as follows:

Method definition:

//method GetData

       public static void GetData(out int order, out int amount)//defining method GetData  

       {  

           String val1, val2;  //defining String variable

           Write("Enter order number ");  //message

           val1 = ReadLine();  //input value by user

           Write("Enter quantity ");  //message

           val2 = ReadLine();  //input value by user

           order = Convert.ToInt32(val1);  //convert value in integer and hold in order variable  

           amount = Convert.ToInt32(val2);  //convert value in integer and hold in amount variable

       }

Explanation:

In the above C# method definition code a method  GetData() is defined in which the GetData() method is a static method, in this method parameter two integer argument "order and amount" is passed, inside a method, two string variable "val1 and val2" is declared that is used to take input by the user and convert the value into integer and store this value in the function parameter variable.

8 0
3 years ago
What did Moore's Law explain?A.The power of microprocessors will double every two years.B.The power of microprocessors will incr
Maru [420]

A.The power of microprocessors will double every two years.

3 0
3 years ago
Which of the following best explains how the Internet is a fault-tolerant system?
IrinaK [193]

Answer:

A

Explanation:

The Internet is fault-tolerant because cybercriminals can conceal their actions, allowing them the ability to carry out faulty actions without leaving a trace.

This statement is actually the same question I had to answer when in my 2nd year 1st semester in itt.
<3 enjoy

8 0
2 years ago
Read 2 more answers
Spanning Tree Protocol (STP) is a loop-prevention mechanism used in modern networks. STP is, however, vulnerable to misconfigura
maks197457 [2]

Answer:

Any of the following:

1. Root Guard

2. BPDU Guard

3. BPDU Filtering

Explanation:

Given that STP an acronym of Spanning Tree Protocol, and its major purpose is to stop the bridge loops and the broadcast radiation that emanates from its topology.

Cisco carried out three instruments or tools to protect the STP topology. These protection tools accompany the STP, and they are the following:

1. Root Guard

2. BPDU Guard

3. BPDU Filtering

3 0
3 years ago
Mobile legends new hero in october aamon is coming in october 26th
defon

Answer:

yellow

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Gerry used html for her website. which best describes html
    15·1 answer
  • Scratch and grinding marks on sedimentary rocks indicate which type of environment?
    6·1 answer
  • It is essential for a relay energized by alternating current to have
    13·1 answer
  • What are the three parts of a Function
    12·1 answer
  • Using for loop . Input an integer and identify whether it's EVEN OR ODD ( without using modulo operator )
    9·1 answer
  • What is the difference between C and C++. If I know C, will it be hard to lean C++?
    15·1 answer
  • To maintain her audience's confidence in her, what should kiara not do while delivering her presentation?
    10·1 answer
  • If the system has a mechanical advantage of 5 and the load of 350N.What effort is needed to lift the weight? Provide your answer
    10·1 answer
  • Write this multiplacation statement as repeated addition 5/6 x 3​
    6·1 answer
  • What information will she need to know in order to obtain assistance from the chief medical officer to reduce the number of deli
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!