Thank you, everyone, for attending here for the time. Good morning. Yeah, Mongea. So the idea here is that we talk and I share some ideas about installing, like auto-installing the BSD systems that I used from time to time. And it's not a tutorial session. It's not a session that will be giving you like a copy paste ready-to-go material. The main concern that I have here is that you can get the information and get ideas or ways of doing it yourself. Basically, that's it. We are not using any kind of extra API or one-click button to give us or deploy a magically system that you want to have, but that you will understand how things work behind the scenes and you can implement it in yourself using either a Dragonfly BSD, FreeBSD, NetBSD, or OpenBSD for any kind of setup that you want to have. So I'm Vinicius. I'm a FreeBSD ports committer. And I'm also part of the Torr project. I'm a core team member of the Torr project. And I'm doing mostly the P&T, Privacy and Hasn't Technology work for Torr and merging as much as we can into the BSD system, like mostly the FreeBSD, but we also have stuff on the Open and NetBSD. And that's me. Like, what can I say? I also was part of other BSD conferences. In the past, I presented FreeBSD robot with a friend of mine, Ed Kahler. And BSD can. We also have an episode on BSD now. You can take a time later and watch it if you want to. And that's it. So let's jump to our agenda for today. As you can see, like a Python fan, like we have in it. I'm going to talk about a bit of avoiding Flamie Wars during the presentation. That is something that I think that is unhealthy. And it's not the purpose here for this presentation. And we'll also tell about the motivation that I have for writing this presentation. We are going to jump quickly into a reverse ARP bootpGCP. We're going to talk about the SysLinux. Mention very quick about the U-boot. Then we have a look into FTP, TFTP, HTTP. That gives us a way to fetch the live system image or any kind of diskless setup that we want to have. Then we jump into the IPXE project. And I will mention these two projects that use IPXE on behind the scenes for them. Finally, we get to the installers. And here we have the auto installers, because our idea is to not, let's say, waste time by sitting in front of the computer. That is actually the main purpose of this presentation, that we can automate as much as we can to deployment not only virtual machines, but also bare metal machines. If that was not clear in the beginning, but yet you can do it not only in VMs. You can also do this whole thing for physical machines. Yeah, so we get here the main VSTs, that I would say, Dragonfly, FTPC, NetVC, and OpenVST. And at the end, I will talk, I will have a few words about Puppet. That is the way that I use it to build the automated part for it. Really like it. There is the init. So avoiding the flame here is very important, because most people say that I can do better stuff if I kickstart a file with a pre-seed file. Or I can just use DD, and that saves me time. I can do like a dump restore, and then that's good. Good for you. As I said before, it's not the purpose here of getting into a battle. This solution is better than what you're presenting. You're presenting something that is unusual, poor-designed, whatever. That's your opinion.  And that is, again, I repeat myself again, the main purpose of this presentation. If you want to use a packer pre-seed file, kickstart a DD cloud config stuff, and say that's better and good for you, yeah, that's it. And, yeah, the motivation, using like a CD-POP more beer, not just because we want to hang out with friends and have a beer in a pub, but also I believe that the most important stuff that we can do in our life is not like sitting in front of a laptop or sitting in front of a computer, like waste time installing a machine, configuring some tweaks here and there, hardening the system, and, yeah. So we use the technologies and the software as the projects that we have to do it for us. So we can take care of our family, we can enjoy time with our friends, we can follow the sun, we can go to the beach, we can go to the park and whatever. You can enjoy like the hobbies, playing sports, taking care of like plants, gardens, and this kind of stuff. Also, of course, this part of hobbies, you can also do like other open source products. So here we jumped into the reverse ARP boot P with the bootstrap protocol and GCP. That will be like the kickstart for everything that we have when we boot like a client machine. So this demons for the reverse ARP, for the bootstrap protocol, and these people run in a server. And the server will be prepared to provide client machines. They can be like virtual machines or virtual machine or physical machines that will boot live system. And these days we have like a diskless setup for client machines, like machines that really do not have a hard drive or even machines that have the hard drive but they boot a live system and do any kind of special setup using this physical disks that not mainly run the operating system itself, they will just be used as a storage for some reason or yeah, whatever. So the reverse ARP, the bootstrap protocol and the dynamic host configuration protocol provided us like they are here sorted in kind of a historic way or poor feature way to the more fancy and elaborated features that we can get. Like the reverse address resolution protocol did not gives us like a DNS server, a gateway and we needed to manually configure like a Mac address table that will put like this Mac address is part of this. We'll get this IP address to this machine and this machine with a different Mac address we'll give this other IP address. And that's the way that the things work because in the past like it was like I don't know like 80s or something, this was the way that it goes. So bootstrap protocol, the boot came up and could gives us the DNS gateways. It also gives us the IP address of the server that will be used to provide us via like TFTP. We are gonna talk a bit later about it. The image that we are going to boot and it also needed like a pre configuration.  And now we reach like the times that we use the DACP. The DACP also like have the same features that we got from the bootstrap protocol. It gives us like a DNS gives us the gate to it but it also gives us like a way to put a full qualifier domain name into the clients, the client machines. We can like put the NTP servers to be used in this particular network in a way that we don't really need to configure every single machine that's going to use a configuration that's like, it's dynamic. And if we use like IPv6, we can also do this but it would be like a GCP v6. It's a bit different from the GCP v4 if we like use to be comparing the RFCs but we can actually say that's this same thing. It's the same thing for this purpose. We can say that's the same thing. Provides the main NTP servers. And of course for v6, we also have like a router advertisement but that's another thing. It's not important here for us. So the SysLinux. SysLinux is a lightweight bootloader. It's a thing that will, it kind of got replaced this idea of having a BIOS and finding in the hard drive an operating system that will boot for us. So SysLinux is a lightweight bootloader that we can like put in a floppy disk. We can use to boot for operating systems from a FAT file system from XT2, XT3, XT4, yeah and it's a bootloader. It's a project that also has small nuances, different binaries that will work for different purpose. Here we are going to focus more in the PIXLinux which is like the pre-boot execution environment that we get to boot the live image. The SysLinux also has a way to boot ISO images and also has a way to like chain loading, other binaries, like here I put like the main disk images. And basically that's it for the purpose here. We just need to know that SysLinux is going to help us, it helped me to boot the diskless setup for the system that I use it to get away for auto-installing themselves. And Uboot, Uboot a lot of people kind of confuse it that it's a module for SysLinux but it's not SysLinux, it's mostly used for embedded systems for ARM in this case and different from SysLinux, it's kind of a first stage bootloader. You don't really need to like have something before it to load it and it will be like the bootloader in a first stage that don't have, how can I say that, extra helpers to load the operating system itself in like this embedded system running in ARM system. And yeah, the main thing that we kind of say here is it's not SysLinux. So now that we have talked about the protocols that kind of bootstraps the client machines information, like IP address, the ID of the server that we're going to use for fetching the image, get the DNS and stuff, we get into the protocols that we're going to use to fetch, to download or load the images for us. So the SysLinux that we mentioned before can use all these three protocols to download the image that we're going to use for booting the system. Here, as you can see, it's just like pinpointing stuff. I'm not a fan of writing like long texts in the slides so you can use like to get like information and maybe go into the search engine of your preference and look for more information about this. So the differences here that I show is the TFTP, is the second one listed here, does not offer us a way of doing authentication and encryption. It has this limitation, let's say, of the file size that we're going to transfer the network and also doesn't provide a way for most cases that we're going to use, we are all, doesn't provide a way for us in most cases that we can download this image from remote sites across, let's say, continents from the internet, so we basically, most usually in LAN, very specific way like a DMZ or something like that. Different from the FTP and the HTTP protocols that we can use automation and encryption. For this case, we don't confuse the SFTP with the FTP as they are different things. I just mentioned the RFC for the FTP as and the port study use, the SFTP, it's going to work together with the SSED demon, it has, it's not FTP as you can see. And finally, I would like to mention the HTTP protocol that offers the way that we can use authentication and encryption with together with the TLS. Also just mentioned for information that runs in TCP for free. And I added a pin point that we can combine it with HAProxy in a way that we like add some special favor over setup if we're going to, I don't know if you have like a special setup that can not go down and must rely on favor over or load balancing of this kind of infrastructure that I need to build. And yeah, you can combine HAProxy to use HTTP and get that into like CDN for your company or for your purposes that you could not do. Like let's say with the TFTP. If you guys have a question, just put in the chat or try to have a look here in the chat notes, that's all fine. Don't be shy. So IPEXY, the IPEXY project, that is a fun thing about the, it's on the FAQ about the IPEXY, the I stands for love and special. Anyway, so the IPEXY is a full PICY implementation. The PICY here is the pre-boot environment that we're going to use. And the main pin points here that I want to show you and share with you is that it can use ATP, ATP-S, it can load images from ATP-S. It supports IPv6. You can also load boot images from iSCSI and fiber channel over internet. And a very nice feature of IPEXY is that you can make it, let's say, looking here for the chain loading. We see like the road scripting. So you can put the scripting logic to work for us in a way that it sets up a particular VLAN that is going to join, that's this specific line machine that booted into the VLAN that will serve only, let's say, DNS traffic. So this machine that got booted will be joined automatically, base it on the scripting logic, DNS VLAN or the NTP VLAN or the web service VLAN. And we can use the IPXY scripting to do this. It doesn't mean that you're going to have machines that you put like in a hack or in the basement. And you need to manually change a lot of configurations to say, oh, this machine will boot for my purpose of web server. And this will put the purpose for NTP servers or whatever. You can add this logic into a, let's say PHP script or something like this. And IPXY provides a way that this VLAN will be configured directly before you boot the operating system. All right. Different from the SysLinux project, you can kind of flash an image and expansion run with IPXY and put it like, let's say, in a network card of your preference. I listed here like the models, Broadcom, Intel, and it also has a way that you use it together with VMware. IPXY can also boot ISO images and yeah. That's an interesting part for us is more like the VLAN setup, HTTP and V6 support. This is one of the projects that I share with you that uses IPXY. It's the Altium One bootable software, ECO. And this link will send you to their website with instruction about how you can use it to boot VST. And this is how the IEO looks like. It gives different options to different systems from the network. We don't even need to waste time doing ourselves the multi-boot ISO image or USB stick. Similar to what we get from Netboot XYZ. There is a GitHub page of the project. You have the templates and the menu that offers us a way to boot free VST and open VST. You can actually use this as a hint or as a source for your testing purposes later if you want to play it a little bit after the talk, that will be cool. You can get the templates to use with IPXY to boot like your free VST, open VST or any system that you would like to try booting in Altium Solar. This is how it looks like. You can see there like installers, Linux installers, VST installers, and installers. Let's say you want to boot CentOS, you want to boot OpenSUSE or whatever. And you can just boot it. Let's say you chose Debian and go get the ISO image from the Debian, the Netboot part of it and boot your system. You don't even need to download the image and boot it to a CD or whatever. You can just use Netboot XYZ and boot these different systems. So we reached the installers. Here we talk about the four main VST systems. And they are installers. For us, in this case, auto installers. So how did I manage to auto install Dragonfly VST on a client machine? I got its CD, or IMG, the CD image, let's say, and kind of booted it manually. I saw that it offers us a way to install it with a fancy interesting system. But for me, as I wanted to auto install it, I jumped it into this class setup. So it offers us the Pixiboot or the Pixiboot TFTP. Those are the, let's say, the bootstrap folders that we can use. I choose to use the NFS version of the Pixiboot. And after setting an environment to boot the Dragonfly VST, base it actually on its ISO image. I kind of, I got the ISO image, mounted it into a file system, change it like a very few configurations, like the loader.conf that specify that we are booting for an ISO image. So I changed it to say that we are not booting for an ISO image. And yeah, added a line on the atcrc.local. What did I add it into the rc.local? We can see on the next slide. I was playing with these two possibilities. So they have the PFI, it's the preflight installer that we can add informations for auto installing the system in the media that we boot. It gives us like a backend and it gives us a way to run the comments with a binary or a script before jumping into the installer itself. I discovered a very interesting thing that they had in the past, a CGI, like a web server that we could use to install the system. Pretty interesting, but it did not serve from my purpose. So yeah, just a shame here. The PFI offers its defaults under atcrdefaults.pfi.conf. So you move that file and change what you need to change and make it on atcrpfi.conf. It works in the same way that we work with rc.conf. So we can say like, you have config interface, whatever, do the dacp thing, put the disks in that and we can have the PFI to work for us. But that I have like for every image that I need to boot, I discover a way to get the thing for me to work well, work better when I use the rconfig. It's the remote configuration client server that DragonflyBSD has. It's really cool, really interesting. We just need a server running with the rconfig daemon that was in a DragonflyBSD machine and we have different, let's say, flavors of getting us an automated setup, like an auto installation with encrypted route with Hama FS and you just need to adjust to your purpose. So you have the server running the rconfig and the client machine is booted and that was the configuration that I changed and I'll see it up to local. So you just broadcast that, hey, I'm a DragonflyBSD, do you have something for me? So if you have something for me, I will auto install myself, base it on the configuration that you offers. So that working really, really, really well. If you want to not use a DragonflyBSD running the rconfig, you can kind of copy paste that logic from their examples and put it everything under rc.lopo if you want to. There is this one ticket open on the Dragonfly redline that mentioned the way that we can enable headless installer if you want to check it for more information, maybe a patch that you want to test or something, you can use this link description. So the previous one, I again, use it the diskless setup and we booted a freeBSD like a diskless system. The machine has, of course, for my case, a hard drive and it booted from the network, the image of a freeBSD that I chose to use as was 13, not all release and was pretty easy actually to outinstall it because I used theBSD install with a script that does actually everything for us. That's actually one of the motivations that I have for writing this talk because most people say that I can outinstall CentOS, I can auto-install a Debian, but freeBSD doesn't provide us a way to outinstall it but it did like for a long time, the other BSD systems did it as well. Anyway, I use it the scripting thing that we can use with the freeBSD installed. It's divided into two parts, the preamble and setup. Preamble would be like you set your variables and setup is like the script itself that runs into this seed-ruled environment on the installed system. So again, I use the diskless setup to boot the machine, got the NFSD running, put it the exports, configurator to do the DNS thing, configurator here and there, pixie booted it using its own pixie boot, like the loader that it has, and use it BSD install, that's basically it. BSD install uses the BSD config. If people don't heard about BSD config yet, it's like behind the scenes that you can add the default or you can configure your time zone. If you have any freeBSD machine running or test machine or whatever, you just type a BSD config, space like a time zone, and you can change the time zone is a way that you can do it graphically. In a way, it's comfortable for most people. This is how the script looks like for us. We have like a BSD install disk site for you, let's say, living in Chile, you can choose a mirror close to your location. If you're living in a lot of countries, you choose a different mirror, or you create your own. You can also add custom variables and put some values here, values there, and use it later into the script itself that goes after the shebang that you see. This is actually one file, it's one single file. The BSD install will read, we work this out to see that the first part is the preamble and the second part is the setup script. You don't need to have two different files. When we think about the shebang that is there, like being a Sage, this is actually one file. So you just add your logics here, there is that your hostname, you can run the free BSD update, you can bootstrap the PKG, you can install packages, you can made some changes to use, let's say, the NTP service. I'd say that you're living in Brazil right now. You can go to NTP.br and get their service. Service. So you work it out and put the NTP.br service there into your NTP.gov after installing everything and just reboot the machine. When I first started to get stuff like Rio when I was preparing for this presentation, I kind of got a bit stuck. And filed this bug on bugzilla about auto-installing the free BSD. So it was working for me. I was happy with it a lot, but I just decided that other people could maybe get some benefits of it. And I filed the bug, I proposed the patches and it got fixed. And thank you for everyone that helped to get this fixed. It now gives us a way to auto-install with a nice script and we can just boot the machine and grab a coffee, sit on the deck and enjoy this one. This is also a very interesting reading that I would share with you. It's about MFSBSD from Martin. It's on the GitHub. Martin is also a free BSD committer. And I really recommend you to have a couple of minutes and read this about the MFSBSD. See one second, share notes. So we reached the NetBSD installer. The NetBSD installer for me was really interesting because as far as I read it, main pages here and there, way to auto-install it, I couldn't really find a way. But I got into its utility menu, login functions and enable it. At the end of my setup, I got these two files under the TMP folder. So I kind of steal it from the installer system, put it in the server that will be like my, let's say the PXE server, the TFTP server, that will be like the main machine that will provides us a way to boot the system and have the disk-class machine to be ready for us. So I just needed to work at very few lines of this sys-ins.sh and I was able to like totally destroy the virtual machine that I used the first time, create a new one, base it on its login functions from the first install. The server booted a disk-class system in this new machine. I checked, of course, for this example, I updated the MAC address and said, okay, this MAC address will give me this hostname stuff, very few changes that you can figure it out. So the second machine that I booted was able to install itself. So I could get the PXE in, I got some packages in the installer and then that was it, it rebooted itself. And in the next boot, the IPXE configuration that I used first tried to boot from the hard drive, it booted the fresh and new installed system. I also just, as I mentioned before, I used it to rely on the RC.local. And when I was researching a bit about all the installations, I found this very interesting project, that is the Anita, the AutomatedNet with the installation and test application that we can use to install not only x86 boxes, we can also use it to install like ARM, yeah, as you see. But it's only used with the QMO and GAN. Now we cannot use Anita to, as far as I understood, I might be wrong. You cannot use Anita to install a machine and a physical machine. Here is a talk about it from Martin. It's also from another EuroBSD.com. You can definitely take time to read it later if you want to. And finally, we reached the OpenBSD installer. To be honest, it was the easiest BSD that I used and was able to auto-install itself. It was really straightforward. I just needed to name the the PIXI boot loader correctly and it just auto-installed it. It boots, it checks for a file called install.gov or checks its hostname, install.gov, which hostname is the hostname of the client machine or Mac address will be the Mac address of this machine, install.gov and install itself. It was really straightforward. It just booted the BSD.RT and that was it, really, it was really, really easy. And here is how the install.gov looks like. Nothing pretty fancy. It's basically like the questions that we got from the installer itself. There we can put their HTTP server. We have a local machine in our network so we don't go to any CDN. We don't go to any external box to fetch the sets that we want to use. And it just auto-installed everything for us. It also sets up a user if we want to, gives us a way that we can just put the SSH key of this user there and that's it. Here you have the main triggers for me that motivated myself to write this talk. It's a talk from Micha and a talk from Philippe and from the Euribus Decon 2019. If you have time, just go to their links here and watch this, little fellas. While I was researching a bit how I could auto-install OpenBSD, I also found this project, Fugu Ita from Ishihiro Kawamata. I hope it's fine. Sorry if I pronounced it wrong. Fugu means blowfish in Japanese and Ita means disk hard drive or something like that. It's a very interesting product. You can check it out if you want to. So far so good. We are jumping into the final section but I want to share something here with you. I believe I can, let's try this because I have a recording here. And we're into the matrix. Can you all see the chair desktop? It's good, working. Yes, yes, and you're getting in the view. Because you're small, small. So here is the OpenBSD machine that is going to auto-install itself. I'm gonna speed it a little bit because I'm also checking the time here. We are good, but I don't want to take much time on this. I can actually skip a little bit. So it's booting from the network. I have this system and this is the point that it just auto-installed it as a, yeah. There's a little Easter egg here in this auto-install. I'm not sure if you guys are able to detect it. That is a small error. But yeah, it just boots itself, checks for a install.conf and easy going. I will just skip a very few seconds here. Yeah, got all the sets installed itself, making all device nodes. We're linking to break unique kernel. Skip a few seconds, skip a little more. It's just a nice blue screen, not the blue screen of that. We are booting with fresh install system. That's it. We have this sub-parer up and running. Not sure. So we got back to the presentation, right? Puppet. So I decided to use Puppets. You can combine your wishes or needs to use a different tool, a different automation schema or whatever you want to. As I said before, our idea is not to get into battles, flame wars or, yeah, you know. I choose to use Puppet and that's it. That's what I'm sharing with you guys here. So Puppet needs an agent to be running in the client machines. It will kind of has states define it for this machine. It will say that this machine has this and that and all our configuration to be changed to be an updater or whatever. This machine and that machine has this and this and this packages. This machine needs to run service A, B or M, whatever. And that's how Puppet agent from the machine talks to the Puppet server and do its magic. The Arting K, sorry, runs in the Puppet server. It gives us a way to have dynamic environments. It's going to be set it up in the server in a way that we have this thing called the control repository that gives us a way to have the dynamic environments. And here we need to set up it to use a version control system of our preference. I chose Git. It worked pretty well. Let's say you have different data centers, different locations, offices and you can have different branches or you don't have different offers. You don't have different data centers but it has different stages. Let's say the production, then development. You can test the development, boot your machines. They are going to be auto-installed after the reboot. Then we'll be joining the development environment and we'll do your tests. And if it's all green, you can apply your logic and put some measure requests from the development range into the production range. So you discuss with your team and see if it's all green. So you just merge it and put the development into the production.  That is really up to you. That is just a feature that I'm chairing with you. Based on what Puppet offers us. And of course, that is a very interesting thing that we don't want to do is to put passwords into this Git repositories. The plain text passwords. So I offer you the possibility that you can use the YAML to encrypt your plain text passwords. So a YAML uses the Hi-Ara, the Hi-Ara or call database that you can use to define groups or specific configurations that can be used in the Puppet manifests with the lookup function in a way that you don't really have to expose credentials, passwords, or you can even encrypt the whole block, the whole manifest yourself because it uses like a VKCS. You can have like a private key and a public key. It will be stored in the server. So you don't have to be one exposing it all on its manifest. This encryption plugins can also be used. If you want to, if it's mandatory, you can combine it with the GPG plugin to have multiple private keys. So if you have a team that, or if you have a policy that demands that nobody can share credentials or private keys, you add this plugin and combine it in a way that everybody has its private key, and yeah, whatever. You can also use the key management system from Google Cloud or AWS. You can also combine it with a Hashic or Vault. And this is how Puppet Manifest looks like if you want to use it with a YAML. As you see, you have the Vechini Hosheda plain text password being exposed here. But if you use a YAML, you can have like maybe the same password, nobody knows, being used in a way that it's encrypted. We are reaching the end of the talk. I really wanted to share with you the artworks from Drahan Magia. You can really have nice stuff from this artist. So share all the data. Sorry. And to finish it, I will share with you the last video here, which is the, you can see it all right. The version that has the IPXE floating free VC machine. I will also speed it up because I think we don't have much time. Yeah. We're actually keeping people from the lunch. We're slightly over. Sorry. So skip, skip. Yeah. This is the part where the auto installer just started to install itself. And skip, skip, skip, skip. Yeah. It's doing its magic behind scenes. Skip, skip, skip. There you see the puppet installed, the agent. Here we are booting the machine again. And here we have the impaleada. An extra user was set it up. And we check it if puppet agent is running already. It was actually done. And the change that we did was like the, as I talked before about the NTP change, I added like the Google and the Observatory National NTP server using puppet, using IPXE, and using the FreeBSD auto installer for this particular case. And that's it. Thank you very, very much for your time here. Thanks. I don't know if people want questions or should we just let people go to the lunch? I don't see any questions in the chat. I also don't see any questions here and also in the chat and the chat notes, but I will be here the whole day. So just hang out on the RSE special. I'm around. Yes, and there's also the spatial.chat, which is for the hallway tracks, so. Yeah, right. All right, thank you very much for the talk. And thanks for being at EuroBSD.com. Here's hoping we can do this in person next year. Yeah, as we go. Right. Thank you. Yeah.


Hi, I'm Zor. Welcome to Unizor Education. This lecture is part of the advanced mathematics course presented on Unizor.com and it belongs to a section about theory of probabilities. Now this is basically a very simple lecture which I would like to just basically exemplify a couple of concepts of theory of probabilities and to introduce you into a state of mind which anybody who solves the problems related to theory of probabilities should actually be. Now this state of mind is relatively simple. To evaluate the probability of something, you really have to analyze your experiment. What kind of outcomes, what kind of results of the experiments can be called elementary events. So these elementary events are supposed to be in some way symmetric. Like if you are rolling the dice, then every one result, like one on the top, two on the top, three, four, five or six, they are equivalent and they are symmetrical and they all have equal chances to occur. And that's why we assign equal probabilities to these events. And that's why each one of them has the probability of one divided by total number of these events. So that's the very important part. And a couple of examples which I have would illustrate how important it is. So let me just start with real examples. And these four examples are related to the dice games. So we will play with dice. A couple of games which some of them, you know some of them maybe you don't. Anyway, the first one is the game of craps. And I'm not talking about all the details of the game. I'm just extracting one particular aspect of the game. I know that if you throw two dice, you roll two dice and if the sum of numbers is equal to seven or 11, basically somebody won't, somebody wins. It doesn't really matter who wins, how much they bet, etc. My concern right now is that there are two dice rolled and we are calculating the sum of the numbers on the top. And there are supposed to be either seven in the sum or 11. So my question is, okay, this is an event. What's the probability of this event? So what's the probability to having seven or 11 as a sum of two numbers on the top? Okay, as I was saying before, what's extremely important in all these problems is to establish what are my elementary events. If you are rolling two dice, every combination of two numbers on one dice and on another dice represents an elementary event. These elementary events are all different, obviously, because we are talking about different pairs of numbers. So, for instance, number three and five. One dice is three, another is five. That's an elementary event. Elementary event two and two. That's another elementary event. Elementary event five and three, which is different from this one, by the way. So these are all elementary events. Now, how many of them are? Well, you have six different choices for the first number and six different choices for the second number. So basically, you have six times six, 36 different elementary events, which cover completely all the possible outcomes. So there are 36 possible results. They're all different and they're all having equal chances because we're supposed that the dice are symmetrical, right? So these are all symmetrical events, which means that the probability of each one of them is equal to 136. Now, my question is what's the probability of my event which I'm interested in, which is the event when the sum of these two numbers is either 7 or 11? Okay, well, actually in this particular case, the easiest way is just to count. So let's just consider. If you have one, two, three, four, five, six, one, two, three, four, five, six, this is the first dice and this is the second one. So when do we have seven? Seven we have one and six, two and five, three and four, four and three, five and two, and six and one. So one, two, three, four, five, six different cases when I have a sum of numbers equals to seven, six. Now, when do I have 11? I cannot have 11 if one of them is less than five, right? So it's five and six and six and five, two cases. So eight out of 36 elementary events make up my event. So all others, all other points in this table, so there are 36 different points on the crossing of all the different rows and columns, right? And I'm interested only in these six and these two. So they represent eight out of 36 elementary events, which means it's like you're calculating the area of some shape, right? So which means that the probability is equal to 836 or two-ninths. Okay, so that's the answer. With the probability of two-ninths, we will have a sum of two numbers on the tops of two dice which I am rolling equal to seven or 11. So an average out of every nine rollings of the pair of dice, I will have this winning combination. On average, doesn't mean that on every nine, I will have two. And it doesn't mean that on every 900, I will have 200 of these combinations, but somewhere close to this number I will have. So that's the first problem. The second problem is there is a game, a dice game called I wish I can pronounce it correctly. Yatsy or something like this. It's spelled like this. Yatsy or Yatsy. I don't know how to say it. Anyway, there are five dice. Actually, it's very close to poker, the card game, but it's played with dice. So we have five dice and different combinations which are in a way similar to the combinations of the poker, like a pair or two pairs or something like this. Well, are events which we are interested. And in this particular case, I'm interested in the combination which is called Full House. Very analogous to Full House in the poker game of cards, where you have three cards of one rank and two cards of another. Here as well, I have three dice out of five, have one number. Let's say five, five and five. And two other dice have also equal number, but different than this one. Let's say two and two. So this is the Full House. Question again is, what's the probability of this particular event? Now, as usually, we have to start with our elementary events. So what are elementary events? When we are throwing five dice, okay? We are rolling five dice. Each one has six different combinations from one to six, which means that the total number of all the combinations of, let's call it a quintet. I think quintet is five, right? So a quintet of dice. So every time I'm rolling a quintet of dice, I have some number, one of the six numbers on the first one, one of the six numbers on the second, etc., etc., so it's six to the fifth degree different combinations of my values on the tops of the quintet of dice, right? Six to the fifth degree. Now, all of them seems to be completely equal chance. So the probability of each elementary event must be the same. And since all of them comprise the total probability, which is always assumed to be one, we are talking about frequency, right? So what's the frequency of something happening? Well, obviously something always happens. So it's one, right? So every one of them has the probability of six to the fifth degree. Okay, so I have six to the power of five different elementary events. All of them have equal chances to occur. The probability of each one is one to the over six to the power of five. Now, question is, if we are talking about full house, how many of these elementary events make up a combination called full house? If I will find out the number of these combinations, I'll just multiply it by this n, right? So what's the n? This is a purely combinatorial problem. And as I said many times, combinatorics is a very, very important part of this course, which was preceding the theory of probabilities. And so let's just calculate how many different combinations of five numbers from one to six each are comprising the full house combination. So I have three dice with one value and two dice with another value, right? So first of all to count the combinations, I have to somehow position these three and two. Well, actually I have to position only three because the two will be left, right? So out of five, I have to choose my three positions where I will have one number. That determines the other two positions with another number. Now, what's important right now, so my positions are already fixed, okay? So I will use this as a multiplier because it doesn't really matter which positions. But let's say the position is fixed. Now for each position out of this number, for each position my choice for three numbers having the same value is basically from one to six, right? So I have six choices. Now the other two, they're not supposed to be equal to these ones, right? So I have to choose the value for the other pair from the remaining five numbers, right? So the combination of all these, the product of all these, give me the total number of different combinations. So I choose certain number of triplets out of my quintet. Then as soon as I chose a particular triplet, I have to choose what exactly the number is there and I have that many numbers to choose from. And then I have to choose the number for the remaining pair. Now this is 5, 4, 3, 1, 2, 3, which is 10. So this is 30. So my answer is, my probability is, of this event, is 30. Or if you wish 5, 6, 4, right? And I think I have, no, not 30, sorry, 300. Yeah, 300. So it's 10 times 30, right? So the probability is 50 over 6 to the 4. So I have an approximate value, actually. 0.03858, which is less than 4%, as you see. So the probability of the full house in the game of Yatsi is less than 4%, 3. Whatever percent, okay? So that's the second problem. I have four problems and the third and the fourth problems are related to the, well, this is actually a historical fact. Apparently it's written in many textbooks on theory of probabilities. I learned it very, very long ago when I was reading some kind of encyclopedia for children published in the Soviet Union in the 1950s. Anyway, it's about the French person called Frenchman. His name was Cavalier de Mer. I think it's pronounced de Mer. I'm not sure, maybe. I think it's de Mer. So the Cavalier or Chevalier de Mer. So he was a gambler, very simply. So he invented an interesting game. He said that, okay, let me throw a dice four times in a row, okay? So we have four rolls. And he's saying if out of these four rolls I will have one particular number. I think it was number one. Doesn't really matter which number. Let's say it's number one. So if number one is at least once, I win. So out of four rolls, if at least once there will be number one, he wins. And people did play with him. Now, he was a smart guy. So he decided, just think about it. I mean, the chances of having one on one roll is one six. I mean, he understood that, obviously. So approximately out of every six games, one will be on average, I will have my one, right? My number one on top. Now, then he decided, okay, if out of one game, my chances are one six, then out of four, if I roll it four times in a row, well, probably it would be four six, which is greater than 50%. And I will win. Well, guess what? He was really winning. Regardless of the fact that this is an invalid calculation and I will explain why, he was really winning. But let's do it a little bit more mathematically. So let's evaluate the problem. Well, first, let me criticize this. Why this is not right? Well, let's just think about it. If the probability is multiplied as the number of experiments is multiplied, then if we will make five experiments, it will be five six. If we will make six experiments, we will roll the dice six times. It will be six six, which is one, which means that it's like always out of six rolling of the dice, I will always have at least one time when number one will be on top, which is definitely wrong. But what if if I'm rolling it seven times or eight times, the probability goes seven six or eight six, which is greater than one, which is just impossible, right? So the whole mathematics of this is just wrong. This is not the way how it's supposed to be calculated because it definitely reaches to some absurdity. And okay, so what's the right way to calculate it? Okay, so let's just think about what's the right way to calculate the probability of having number one on top if you roll the dice four times. Okay, as usually, we have to start with the set of elementary events, right? So what's the set of elementary events when you're rolling dice four times? Well, it's a quartet, right? Quartet of numbers. Let's say two, two, five and four. And this is a quartet of numbers as well as any other quartet. So all these sets of four numbers are the results of rolling the dice four times.  Number of them is six to the fourth degree, right? Six choices for this, for this, for this and for this. So I have to multiply them. So that's the number of elementary events. They have all equal chances of occurrence, so the probability of each of them is equal to one over six to the fourth. So all I have to find out is how many of these elementary events make up my event to have at least one of these numbers to be equal to one? Well, what's actually easier is to count how many of these do not contain number one. Because if they do contain it can be one number one or two number ones or three number ones, I mean it's all separate. It's easier to calculate no number ones, all right? Okay, no number ones means that I have only choices from two to six for the first, from two to six for the second, two to six for the third and two to six for the fourth position, right? So I have only five choices for each position. So number of events is five to the fourth. These are all events which do not contain number one among them, right? So if I will subtract from the total number of quartets, the number of quartets where the number one is absent, then I will get the number of quartets where there is at least one number one, okay? Now, if I would divide it by a total number of events, that would be my relative frequency. That would be my probability of having my event, or one minus five six to the fourth, or again I have a number calculated 0.5177. Now, so as you see, the probability is not the one which demerer calculated, which was four six as he was thinking. Well, this is two-thirds. This is much smaller, this is much smaller than this one, but what's important is it's still greater than 50 percent and that's why he was still winning. Now, he was encouraged by that and now we go to the problem number four. Problem number four is about the continuation of his saga, his history. You see, he was winning too much and the problem is people stopped playing with the game. They kind of realized that something is wrong with these games whatever he is offering. So, they stopped playing with him and he was actually trying to persuade them to play, so he invented another game. Well, what's the other game? Okay, he said, you know what, instead of rolling a dice four times, I will roll a pair of dice 24 times. Now, his logic was exactly the same as before. He was thinking, okay, my pair of dice have 36 different combinations, right? Six on one, die and six on another die, so it's six by six, it's 36 different combinations. So, the probability of every one particular combination is 136. Now, I'm interested, he said, in one particular combination of two numbers, two ones in this particular case on the top, number one on the top of the first die and number one on the top of the second die, all right? So, he's interested in one particular combination, one-one on two dice and if you will repeat it 24 times according to his logic, it would be 2436, which is basically the same two-thirds, the same as before. So, it's from his perspective, it's the same problem as before, the same kind of rules as before and he would probably be winning the same as before. Well, guess what? He started losing and he lost a lot. Enough for him to persuade his acquaintance, his name was Blaise Pascal, very famous French mathematician. He actually wrote a letter to Blaise Pascal and basically saying, hey, something is wrong, I don't know what's wrong, could you help me? Well, Pascal did certain calculations and he also got involved another guy called Pierre Fermat, another very famous mathematician who is actually the author of the great Fermat theorem. So, they were actually exchanging letters, etc. And basically, that was the beginning of the whole theory of probabilities, believe it or not, or at least that's what legend says. Well, anyway, obviously Pascal did the correct calculations. So, what are the correct calculations? Let's just now do it the way how to do it properly. So, number one, what is a set of elementary events which we are talking about? Well, if you're throwing a dice, a pair of dice 24 times, the elementary event is 24 pairs. There are 24 pairs of them. So, the probability, well, the number of pairs actually is 36, right, 6 and 6, but the number of pairs, if you're repeating this 24 times, would be 36 to the 24th degree, right? 36 choices for this, for this, for this, for this, and 24 different things. So, it's 36 times, 36 times 36. So, we get 36 to the 24th different elementary events, which means that the probability of each one is this. So, this is a probability of concrete sequence of 24 pairs of numbers, where each number is from 1 to 6. Fine, great. Now, the same, exactly the same reasoning as before. What are those pairs which make up the event we need? So, what are those events, sorry, elementary events which make up? So, out of these, we need these sequences where there is at least one combination called 1-1, right? Again, it's easier to calculate those guys which do not have 1-1. So, 1-1 is only one pair out of 36. If we don't want this pair to have been represented in this sequence, then we have to choose for each place, and we have 24 places. We have to choose anything but 1-1, which means any other of 35 combinations. And obviously, the number of those is 35 to the 24th power, right? So, in each place out of these 24, we can have a pair, but any pair is good, but 1-1, which means other 35 pairs are fine. So, we have to subtract them and divide the result by 36 to the 24th. So, what will be here is 36 to the 24 minus 35 to the 24th, which is the same as 1 minus 35 36 to the 24th power. And guess what? This is equal to 0.4914, which is less than 50%, and that's why the mayor was losing money. So, again, what's very important in this particular set of problems, whenever you are trying to solve this problem, first of all, think about the set of elementary events. These are the smallest, so to speak, representatives of your experiment, out of which, combining them together, you can make up any event which you're interested in. Now, what's important is that these elementary events must be, must have the same chances to occur. They must be symmetrical. That's how you choose them. So, that's why, for instance, in the last problem, any combination of 24 pairs of numbers basically has the same chance to occur as any other combination. They are completely symmetrical, and that's why I have chosen these. And from these elementary events, now you can put together them into any event which you are interested in, like in this particular case, event is at least one of those 24 pairs equals to one one. All right. So, I do suggest you to go to unizord.com and review this lecture again. Try to solve these problems just yourself, first, and see if you get the same results as I'm getting here. Well, that's it for today, and good luck.


A bee, a wasp, sorry, not a bee. Okay, he's checking me out. Let's continue with our discussion on how to study. Okay, we've already talked about the first couple of tips that I can give you, the first one being for you to really sit down and ask yourself why it is you're studying, whatever it is that you're studying, right? Really ask yourself sincerely that question, because if you're studying it just to pass, then just do that amount of work to pass that course, to get the credit. If you're studying it because of something you love, if you're studying it because it's going to be something you're gonna be building on, then end up putting a lot of work into it, right? So it's a pretty important question before you get into any type of work that you do, why is it that you're doing this thing? That sort of dictates how much effort you're gonna put into it, right? And that sort of kicked us off into tip number two, which is basically trying to improve your efficiency, right? And one of the best ways to improve your efficiency is to sit down and study for long periods, right? And we talked about that and we did a little bit of mathematics and sort of just numbers-wise ratios. Took a look at what that meant to improve your efficiency, which is basically reduces the amount of time you have to spend on learning something, right? And those were tip number one and tip number two. As for the third bit of advice that I can give you regarding on how to study is for you to find spaces that you wanna be in, right? Basically to find your happy spaces, right? And it doesn't have to be one place where you go to study, right? Because what they used to tell me when I was studying, when I was growing up in high school basically, is they used to tell me is to create one space, usually your desk, clear it off, make sure it's clear, and you go to that space always to learn something, to study something, right? And that worked fine for certain courses I used to do where I had to sit down with a pen and paper and had to crunch numbers and I had to be sitting upright or whatever it was, right? For studying something that required the desk, it worked fine. For studying something that didn't require a desk, it really sucked because it wasn't comfortable and I really didn't have to be there, right? And it took me some time to figure out that I didn't have to read a textbook or a book or I didn't have to take notes, copy notes or sort of go over my notes over a desk. I could go lay down on my bed, I could go to the beach, I could go to the park, right? I could take my notes, read them, walk, think about them and then open up my books, sit down on a bench or on the grass and read the notes again, right? And think about them, walk, right? If you're trying to learn something, sometimes you need pauses between concepts, right? To connect the dots, to catch up with the idea, right? So you don't have to be sitting on your desk for that. So really important, if you're trying to improve your ability to absorb information, then don't study something that you don't like or something that you like in a space that you don't like. Change your setting, change your mood, right? That'll improve your abilities to retain the information. That'll improve the odds of spending longer periods at it, right? And I've tried this with students and I've had a student in grade 11 where we did some serious catch-up to learn the material to a certain point and this one location we got to, it was basically completing the square, graphing parabolas, right? And if you've done that work, you know that it requires a fair bit of crunching to learn to, for it to become intuitive, right? For it to become automatic for you because that's where you need that process to be when you walk into a test. So we had reached that point that she was going on vacation and I asked her what she did on her vacations and she told me that she likes going to the beach and she likes going swimming at the pool and I asked her what she did when she went to the beach or the pool and she said she would sometimes grab a buck and read a buck or just relax or listen to music and I recommended that she actually took her math to vacation with her, to start doing some factoring and to start doing completing the square to learn those processes really well, right? And after, it took some convincing to take math to vacation with you, but she did take it and after two weeks she came back to me and she had learned everything we needed to learn and the next step following the vacation was ridiculously easy and then after that she just coasted math 11, right? And she turned to me a few weeks later and she said to me I've stopped doing math every day and I miss it, right? And that was something magnificent, something magical to hear from someone that hated doing mathematics earlier in the year at the beginning of the year, right? So in two weeks, in one week of vacation and one week of being home she had come to a point where it had become automatic for her to do mathematics and she was doing something that initially she didn't like doing and a space that she loved being at and all of a sudden she associated the mathematics with being somewhere that she loved to be, right? So she was missing not being able to do math and it was beautiful and it was awesome to see and it really kicked her up to a level where the rest of math 11 became ridiculously easy and she was able to finish the course with really good marks by putting in minimal effort just because she had put in that time in a space that she really liked doing to learn the process, okay? So tip number three, find your happy spaces to be in, right? Find your happy zones. Put yourself in a mood where you're open to the information coming in, okay? As for tip number four, okay? It's a biggie.  And we'll talk about that. So what, I don't see, what's symmetrical here? Well, if you look at the frame I have set up I've broken it up into two parts. All right, take a look. Oh, that's okay. Oh, you're recording yourself? Yeah, yeah, yeah, I'm recording myself. Nice. And I'm sitting in the middle, right? And what I'm talking about right now is... I'm sorry for interrupting you. Oh, no, no, that's okay. It's twofold, right? It's sort of, I'm talking about, oh, hold on, let me move this stuff out of your way. Is that a good corner here? Yeah, yeah, here. Do you mind being on video? Yeah, not at all. No, okay, here. So I'm sitting in the middle here, right? And are you okay with me loading this on YouTube? If it looks good, okay, fantastic. So basically what I try to do when I'm making my math videos, I've created like maybe, I don't know, 200 plus, right?  Good. I think a lot of, one of the reasons there's a lot of people, one of the reasons that you're not out of work is because the school system sucks, our education system sucks, right? And one thing they don't show when they're teaching mathematics is, mathematics is beautiful. It's in nature, it's in, yeah, it's beautiful. Yeah, yeah, yeah, 100%, right? It's beautiful, it's in nature, it's embedded everywhere within the natural world and embedded everywhere within our structures, the way we structure our life, may it be financed, may it be... I don't know too much about it, but they're talking about like a golden ratio? There's golden ratio, yeah, for sure. I've done, I did a video on the Fibonacci sequence and the golden ratio. You know, I have a friend that's an artist and he's in the best... 1.618.03... Yeah, it depends if you divided this way or divide the other way, right? Yeah, yeah, and so, you know, I did a video with a friend of mine that's an artist that was embedding the Fibonacci sequence sort of golden ratio in his artwork, right? So when I shoot my videos, when I try to make my videos, I try to sort of put cemetery or beautiful imagery in the background because I like art, right? There doesn't necessarily have to be symmetrical and good chaotic as well, right? Do you know anything about like smell or taste that's closely associated with memory? Yeah, yeah, 100%. I do a lot of memorization, lyrics, poetry, sequences of guitar chords. And what's worked, and it may not be the most efficient way, but it's just repetition of a huge amount of repetition. For music? Yeah, like the background. Yeah, the basic drum. Yeah, I used to play drums, so playing drums, it's just a beat, right? Well, you know, the best drummers in the world aren't the drummers that can do fantastic stuff. The best drummers in the world are the ones that can keep a consistent beat. Consistent, yeah. Yeah, 100%. But when I'm doing a, I'm gonna sing a song with three verses. I will sit there and play the first verse. Okay, and then I'll play it, play it, play it, then I'll start playing it without looking at it until I can memorize it. And then, okay, I got it memorized, the first verse. Then I'll add the second one in, okay? I'll sing the first verse without looking, and then I'll look at the second verse, sing it. And then keep doing that until I can do both without looking at it. Yeah, yeah.  And then you can go on 4th, 5th, 6th, 7th, 8th, and it's just, you're just piling on your memory, but the nice thing about music is there's gonna be the same structure. Basically, when you're singing a verse, it is symmetrical in a sense. One verse to the other is generally gonna have the same melody. Yeah, they have to be synced to a certain degree. Yeah, yeah, yeah. So that's been my method for effectively, and I've piling a lot of lyrics. Like sometimes, you know, seven verses, eight verses, there's one song I was looking at was 16 verses. Oh, wow. Lily Rosemary and the Jack of Hearts. Is that something you wrote or something? By Bob Dylan, yeah. Oh, by Bob Dylan. And so he has a lot of, I sing a lot of Bob Dylan music. So he layers it. He has, he will write pages of lyrics. Yeah, yeah, yeah. Sad Eye, Lady of the Lowlands, Desolation, Roe, Lily Rosemary and the Jack of Hearts. Those are just a few examples of 11, 12, 16 verses of music of lyrics. And he layers that stuff on the same song. Yep. Oh, really, really?


As a black woman, a woman of the global majority, this work is essential. For what I've experienced in my life, dealing with racism and sexism, I feel as though we need to be able to create a classroom, create a community where we can talk because I know I'm not the only one that has experienced this. But as we've seen with George Floyd and a number of other black people who have lost their lives, we can no longer ignore talking about race or talking about sexism or talking about anti-Semitism and so forth. We have to. But for me, coming from my own standpoint, I feel that I have a responsibility as a professor to engage my students in these conversations. From my own identity, it's just like, I feel like I have to. It's like, but then what happens is people of color, we end up doing this work and this is tough work. And so we also have to do our own racial healing. One of the ways that I do this work is first of all, I take care of myself.  But I do believe that I, as well as my non-white colleagues, have the responsibility. For me, there are times that the work, talking about what people have experienced and we'll talk about slavery. We'll talk about police brutality. And it's tough.  But then once I'm rested, I get back up and I do this work again because for too long, we have kept this work hidden. I didn't talk about racism for many, many, many years throughout my teaching.  This person is talking about this only because they're black or they're Asian or they're Latinx and so forth, right? But these are our true experiences. We deal with racism and sexism on a daily basis. When I leave my house, I know what world, what kind of world I'm stepping into. And I know that if I can at least get my classes, my students talking about, for example, what black students at Western Washington University experience over the years and what they're experiencing now, my students can be more mindful. And mindfulness is another way that I take care of myself and I also encourage students to do the same. So in our classroom, we will look at different mindfulness videos. We'll read articles about how to be in the moment, how to be where we are. And if we can actually dialogue in the moment, we can get the work done. So for me, in order to do this work, yes, I have to be engaged in my own racial healing, my own mindfulness and self-care. And in turn, I teach the students how to do the same thing.