pavel.emeliyanenko@toptal.com
BAN USER
- 13of 13 votes
AnswersYou are given a directed cyclic graph represented by an adjacency matrix. The graph has at least one terminal node (i.e. the node with no outgoing edges).
Each edge of the graph is assigned a positive integer representing a probability of taking this edge. E.g. if you have 3 outgoing edges with numbers 3, 2, and 4, this means that the prob. of taking these edges are: 3/9, 2/9 and 4/9, respectively.
You need to find the probability of reaching each terminal node from the starting node 0.
Example:
adjacency matrix 5x5:m = {{0 1 0 0 1}, {0 0 3 2 0}, {4 0 0 1 0}, {0 0 0 0 0}, {0 0 0 0 0}}
so we have two terminal nodes here: 3 and 4
- pavel.emeliyanenko@toptal.com in United States
we can take the following paths:
0 -> 1 -> 3 = probability: 1/2*2/5 = 1/5
0 -> 1 -> 2 -> 3 = probability: 1/2*3/5*1/5 = 3/50
0 -> 1 -> 2 -> 0 -> 1 -> 3 ... and so on
or to the node 4:
0 -> 4: probability: 1/2
0 -> 1 -> 2 -> 0 -> 4: probability 1/2*3/5*4/5*1/2 = 3/25
and so on, summing up probabilities of all possible paths we get:
total probability to reach node 3: 13/38
total probability to reach node 4: 25/38| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm
RepAriaScott, abc at 247quickbookshelp
I am a qualified medical representative who has been in the industry for many years and has proven sales experience ...
RepElkeRoll, Animator at A9
I am Elke from the USA. I am working as a technologist in Hill-Behan company. I perform and analyze the ...
RepLisaBAllen, Accountant at ABC TECH SUPPORT
I am Lisa a certified Personal Trainer with more than 7 years experience in the local and international fitness scene ...
RepI am Neeva with 6 years of experience,seeking a career of packers and movers in gurgaon that allows me ...
Repamieeriddler, Financial Software Developer at ABC TECH SUPPORT
I am Amiee , a Professional Insurance Agent providing valuable services to consumers in need of insurance coverage. As a part ...
Reprommie93544, Field Sales at Citrix Online
Roomie , an experienced group fitness instructor with the drive and knowledge and enthusiasm to apply the correct fitness techniques to ...
RepJamesFain, Area Sales Manager at ABC TECH SUPPORT
Phil has nearly 30 years of experience as a fisheries research scientist and directs the CFS Northwest science team. He ...
Repirenereed98, Discount Furniture Showcase at Physical therapist aid
I'm a Physical advisor helping working at Discount Furniture Showcase . I'm likewise a film buff who partakes in ...
RepNaomiAdams, abc at 8x8
Passionate educator for nearly 5 years with a strong desire to help students recognize the connection between learning and experience ...
RepBruceKeter, HTML Experienced at 247quickbookshelp
Bruce , a pediatrician studies psychoanalysis where I try to understand children's needs and family dynamics. To do more research ...
RepLisaNoto, Android Engineer at ADP
Annie has nearly 10 years of experience working on anadromous and estuarine fishery issues in California. She serves as a ...
Repaliciaable183, Analyst at 247quickbookshelp
I am an agent contract clerk who is responsible for handling the recruitment process. I advertise the vacancies for agents ...
RepKianaEmmert, SDE1 at Home Depot
I am Kiana , an Entertainment Journalist, having 5 years of experience, in my career I have covered a lot of ...
RepGizzyKale, Graphics Programmer at Arista Networks
Je suis Gizzy, un commis aux archives avec d'excellentes compétences interpersonnelles et de communication. Expert en nourriture , boisson et ...
Repdevlinadevid, CAD Designer at FeatureCAM
Experienced CAD drafter seeking an advanced architectural position. Interested in culinary arts and currently in a course for making sushi ...
RepAidenKim, business planner manager at GPU
Expert business strategist with a sound understanding of organizational development and sales. Persuasive negotiator who uses integrity and professionalism in ...
Repsuzikaily, Digital marketing freshers at ADP
Hi , I am Suzi , working as a dancer in the Rudo club . I have been working here since 2013 and ...
Rephugaliuli, Nurse at 8x8
Registered nurse with experience in delivering quality care to patients. Professional with more than 3 years in emergency room care ...
RepNaomiAllen, abc at HUIM
Hard-working, passionate coach who excels at teaching children between the ages of 8 and 16 about the fundamentals of football ...
Replusinisa67, Secretary at Melbourne
Skilled and experienced secretary in Teiscom company. Highly organized with a strong attention to detail and the ability to monitor ...
Repvickgonder9, Integration Software Engineer at Arista Networks
I am Antonio , a well-experienced Sales Representative who has been working in the Suadela Investment for almost 2 years. I ...
Repnnelsonvance, Animator at Cognzant Technology Solutions
I am the learning and development manager and play a key role in coordinating all corporate learning and development activities ...
Repmarilyannrandall, Backend Developer at ABC TECH SUPPORT
As a Data input clerk, I deal with customers on a daily basis. Entering customer and account data from source ...
Repeleanormzavala63, Android Engineer at 247quickbookshelp
Hello I am a publicity agent, I have completed all my studies from Brighton. And now-a-days I am working as ...
Repjanetjgonzales87, Android Engineer at 247quickbookshelp
Hello I am an internet developer. And I am very much sorry to travel and read some interesting books. Right ...
RepAdyaKing, Java Experienced at ADP
I am a friendly and outgoing person who enjoys greeting people with a smile. I have more than 5 years ...
RepLucyKaren, Android Engineer at Abs india pvt. ltd.
I am Lucy , a Web Administrator at Oshman's Throughout my professional life, I have proved my qualities multiple times ...
Repwastonlare, Java Developer at Broadsoft
Waston , an executive in the finance and accounting area of the industry with expertise in teaching, training and managing my ...
RepRoseLeen, abc at 8x8
I am a strongly seasoned and handworking entry level graphic designer with extraordinary creative thinking and project design abilities. I ...
Repbeverlybgill, Accountant at 247quickbookshelp
Hello, Beverly Gill and am health services manager. And I have completed all my studies in California and Nowadays am ...
RepJoshuaChiles, Android test engineer at Accolite software
I am Joshua Information design is an efficient and effective understanding of the information. The term has come to be ...
RepCeliaParker, teacher at Illinoisstate
Experienced teacher with a background in education who is looking to complement graduate studies with the opportunity to teach at ...
Repgeraldbelz, Applications Developer at ABC TECH SUPPORT
My background is in Mechanical Engineering with a specialization in Control Systems. My passion is centered in Machine Learning , Service ...
Repmaryjcowell, Android Engineer at AMD
Hey I am information designer.Information Designers facilitate the delivery of information by translating complex information into information that users ...
RepMixMaster, abc at A9
I am mixmaster , a compassionate and dedicated Addictions Nurse with a deep understanding of the intricate challenges associated with addiction ...