A Python Programming in Physics and Materials Science. In physics, chemistry and materials science, percolation refers to the movement and filtering of fluids through porous materials.(Wikipedia.org)....


A Python Programming in Physics and Materials Science. In physics, chemistry and materials science, percolation refers to the movement and filtering of fluids through porous materials.(Wikipedia.org). Consider a simplified model below. Imagine, this is a filter or maybe some layers of stones such that when a certain amount of fluid is put on top, it will reach the bottom only if there is a direct passage. In this case, the blue squares serve as the porous materials or the holes where fluid may pass. Your task is to simulate this simple percolation by representing them in a 2-dimensional array. The input would be in a string, while the output would either be yes or no to indicate whether the fluid can pass through the filter or not.



Example:


Input: “1,0,0,0,0;0,1,0,0,0;0,1,0,0,0;0,0,1,0,0;0,0,0,1,0”


Output: Yes




Note: It should also work with these two inputs:




  • “1” -> Yes


  • “0” -> No



WATER HERE<br>1<br>0.<br>10|0||0<br>0 1 |0<br>0 ||0<br>1 ||0<br>0 0<br>1<br>WATER REACHES THE BOTTOM<br>

Extracted text: WATER HERE 1 0. 10|0||0 0 1 |0 0 ||0 1 ||0 0 0 1 WATER REACHES THE BOTTOM

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here