Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Score: 0 / 1 0 ( 0 % ) Output Initial fraction of plutonium: 0 . 2 5 Final ingredient composition: [ 0 .

python
Score: 0/10(0%)
Output
Initial fraction of plutonium: 0.25
Final ingredient composition: [0.16834650.16834850.16834770.1683470.16834730.1683469]
Test Results
[0/5] Checking initial_frac
Max points: 5
Earned points: 0
Message
'initial_frac' is inaccurate
[0/5] Checking final_comp
Max points: 5
Earned points: 0
Message
'final_comp' is inaccurate
Kelly has a magic pot which can slowly cook one ingredient into others. She already
mastered the cooking techniques and concludes that the process can be modeled using
markov chain represented by a transition matrix A.
You are given the ingredient list material_list =["snake oil", "silver",
"caviar", "bones", "uranium", "plutonium"] which corresponds to the rows and
columns order of A. Each entry Aij of A represents the fraction of the jth ingredient of
material_list that will turn into the ith ingredient per minute without losing any mass.
One day Kelly started making some of her magical soup and after a few minutes she
realized she forgot to start the timer. She could not remember the time she started
cooking, or even the ingredient composition of her initial soup. She can only recall that
at the beginning of the cooking, (25+-0.1)% of the mass of all materials is snake oil.
In fear of ruining her precious ingredients, she immediately casts a spell to determine
the current composition of the soup and stores it in the vector comp, where each entry
is the fraction in terms of mass of each ingredient, following the order in
material_list.
Write a code snippet to help Kelly with the following:
Use the current ingredient composition given in comp to determine the initial
ingredient composition. Store in the variable initial_frac the initial fraction of
the ingredient plutonium.
Suppose Kelly decides to leave the soup cooking for a very long time, until the
ingredient composition in the pot is no longer changing. Help her determine this
final ingredient composition and store it in the vector final_comp, where each
entry is the fraction in terms of mass of each ingredient, following the order in
material_list.
The setup code will provide the following variables:
Your code snippet should define the following variables:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions