subject

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 jt ingredient of material_list that will turn into the įthe 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, (35+ 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: 1. 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 bones. 2. 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: The setup code will provide the following variables: A Name Type Description 2d numpy array transition matrix material_list Python list names of the ingredients comp 1d numpy array composition of the ingredients in the pot Your code snippet should define the following variables: Name initial_frac final_comp Type float 1d numpy array Description initial fraction of bones in terms of mass final ingredient composition user_code. py 1 import numpy as np 7 imon+ numny linalo as la

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:40, 1fuzzybirdow6e0s
If you arrive at the same time as another user straight across from you yield if a. they flash your headlights at you b. you can’t see their turn signals c. you’re going street and they’re running d. you’re turning they’re going straight plz
Answers: 1
image
Computers and Technology, 22.06.2019 13:30, ashleypere99
Jane’s team is using the v-shaped model for their project. during the high-level design phase of the project, testers perform integration testing. what is the purpose of an integration test plan in the v-model of development? a. checks if the team has gathered all the requirements b. checks how the product interacts with external systems c. checks the flow of data in internal modules d. checks how the product works from the client side
Answers: 1
image
Computers and Technology, 23.06.2019 04:31, genyjoannerubiera
This graph compares the cost of room and board at educational institutions in texas.
Answers: 1
image
Computers and Technology, 23.06.2019 20:50, terryhgivens5349
3.11.3 quiz: comparing and analyzing function typesquestion 4 of 102 pointswhat can you say about the y-values of the two functions f(x) = 3x2-3 andg(x)=2* - 3?
Answers: 2
You know the right answer?
Kelly has a magic pot which can slowly cook one ingredient into others. She already mastered the coo...

Questions in other subjects:

Konu
Mathematics, 15.12.2020 23:50
Konu
Mathematics, 15.12.2020 23:50
Konu
Mathematics, 15.12.2020 23:50
Konu
Health, 15.12.2020 23:50