Hi, welcome to this new video. We have been talking a little bit about using probability, introduction to probability, and we introduced the idea of designing with probability. So we want to maybe double down a little bit further into this notion, explain a bit more how we can actually use probability. So we're going to do another example, not necessarily introducing nothing new new, but perhaps using this concept a bit further. So let's dive into the code and see what we can create. So here we are back again in processing. I've already have my template code. I also have our import random function already loaded up. So if any of those pieces are missing, by all means include them into your code. And what we're going to try to do is use or revisit the idea of nested loops, which we've covered before, to create a grid. So let's just do for i in range, let's say 0 to 100, and for i in range, 0 to 100. There we go. And what we're going to try to do here is, we're going to go back to this notion of designing variations to a matrix, a grid, something that starts being rigid, but then we can playfully break the rigidity of that grid, right? We've done exercises like this, creating something like an abstract painting, but we're going to introduce new layer of control, in this case using if statements and randomness, right? So let's just create the x and y coordinates. So x = i x 20 and y = j x 20, right? And this will be driving the rectangle. It's going to be x, y, 15, 15. A lot of really great kind of generative artists, algorithmic artists, have series. So you'll see a series of pieces that kind of play on a similar theme, right? So you will be seeing this a little bit here where we're actually revisiting the notion of this nested grid, like how variations to a grid and how we can actually exercise different logics to actually achieve different results, right? So let's see what we have at the moment. We have an error. Let's see, what are we doing wrong here? It's here, right? In the rectangle. There we go. So we have the grid that we've been discussing, right? Let's just start before we actually start creating variation with some if statements and so on, let's include this random number that is going to be a value between 0 and 1. Right? You could do a 0 and 100 if you want to be more specific about percentages and you don't want to be using decimals. You could by all means say, hey, I want to do a value between 0 and 100, and then it's above 20. That would also work, right? But you'll see that in computing and in programming, you will see a lot of domains that are normalized. The idea of a domain that is normalized is that behaves between 0 and 1, right? So being able to evaluate something between 0 and 1 is something that you would do a lot. And we eventually will start talking about remapping, right? Domains that maybe exist in a different range and then bringing them down to a 0 to 1 range. There's a lot of kind of mathematical transformations that we could do to data. But for now, let's just make sure that we are operating within a very simple domain between 0 and 1, one that we understand, and it's behaving predictably, right? So if this random value, this random number is bigger than, let's say something like what we did before 0.2, right? We could execute one part of the code, right? So let's just do some code here. I like building a structure first, else we can have some other code here, right? So what if we would include this rectangle geometry within maybe only this area here, right? Let's see what happens. Well, let's just What are we missing here? Let's just make sure that we include some code here, print. And let's just make sure that we are including the fill here. It's going to be white. And this shouldn't be needed, in all honesty, but we're going to remove it and put a different fill. Like a black fill, right? A zero. Let's see what we get here. Okay, so what do we have here? What we should be expecting to see is that only 20% of the values are white. So this is the 80% of the values are kind of empty. We're not drawing a rectangle at all in those areas. For now, we're just leaving a placeholder piece of code saying that fill equals to 0, but otherwise. So if we are within that 20%, we are drawing a rectangle in this location, right? We could include a geometry as well in this area. So x, y. Let's do something like a small ellipse, right? And we're going to draw that white as well, right? So we're changing graphically between rectangles and ellipses. But as you can see, the ellipses, which are very small are drawn from the center, but in order for them to feel like they belong to the rectangle series, we would actually have to change the mode. So, let's do something called ellipse mode. So, we could say corner. And in order to see them a little bit further, let's just do a 15 x 15, the same size of the rectangles, and see what we get here. So, here we go. So, what you could see here, and hopefully you can see the difference here. But we have, in some cases, rectangles, in some cases, circles, right? So the geometry is swapping. We could actually say that whenever we see ellipses, we could say, noStroke, or basically, sorry, noFill and stroke being white. And then the other one, we could say, noStroke. So, we're just playing with graphical variance between those two conditions. The example code that we are providing is slightly different. You can definitely play with a color variation, right? But there's so many interesting things that you can do when you're working with certain probabilities, right? Again, you could actually make that probability being a lot smaller, let's say 5%, right? And there's a certain kind of aesthetic that emerges out of this kind of randomization of some cells being different, again, graphically different, color different. There's so many things that you can do, right? Especially adding some kind of accentuation. As we move along, we're going to be learning more interesting distributions, not just randomness. But what if we would use a pearly noise or even an image as a driver for where do we maybe draw a different shape, change the color of something in a way? How do we kind of use the information from one domain and transferring into a different domain? But we're going one step at a time, and hopefully, these ideas kind of start kind of giving you ideas of how you would go about designing your own artwork. Perhaps graphic design, or any kind of computational design project that might include some code in it? So, yeah, we're going to leave this one here, and I'll see you in the next video.