Posts

Showing posts from March, 2022

59

Image
I told our new cat, if you try and pick a fight with the big cat, it would be kind of like trying to pick a fight with a whale, or a hill, not much would happen. This week in Algorithms class we covered Depth First Search, Breadth First Search, Knapsack problem, Travelling Salesperson problem, permutations, I reviewed combinatorics, and we had a pretty hard quiz and really fun homework set. Some of these topics I covered in Algorithms I class which was also invaluable. Working on the homework set, I had a huge epiphany. One of the problems asked us to do something that was pretty common sense but required a small decision tree of conditionals for the correct output. Depending on your insight the tree got smaller. So after thinking about it for a long time and running initial versions and testing and simplifying I got it down to four cases, two of which being partly unified. Which got me on a method to unify all of them. Here is what I did: First I put all the things that happe

58

Image
journal 58 Fly Doctor Art I'm not sure exactly where it fits in to lecture but, algorithm-wise, any time you add print statements, especially in a loop or a double loop, algorithms go 1000x or a million x slower. This week we learned about big theta, big omega, and learned how to get big O, big theta and omega from various functions. There was a pretty hard quiz with various algorithm interpretation and analysis questions and a question with a huge tree of choices I tried to solve with my AccountBlaster, which helped because AccountBlaster can enumerate a huge tree, but I'm still not sure if I got the question right. The tree seemed enormous, even for AccountBlaster, the question was a levels optimization question, like how few levels can you do something in, and it reminded me of a strategy optimization problem from gaming, like chess (actually the game reversi is what I've put a lot of though into lookahead, my robot B.H. Baby has I think a two-move lookahead optimi

57

Image
journal 57 This week we had lots of introductory Algorithms material to study, definitions, terms, graphs, trees, and some simple algorithms to study, plus learning the pseudocode syntax so we can read them. Then we had a quiz on the same, and three homework programs in either/or Java or C++, solving three basic design-your-own algorithm problems, and we were allowed to use the languages' built-in containers. I had fun with the homework and it looks like I got a decent but room for improvement grade on my quiz. I personally did the homeworks in both Java and in C++, as a C++ refresher. (I'm a lot better at Java than C++ - I can write in Java and then somehow translate that to C++ but it's a lot harder for me to write in C++, even though I can, I even know some good tricks in C++ like making lambda API structures and hash APIs.) This algorithm material is very, very important, but also very complex at first glance. But is well presented and in a very manageable and

56

Image
Week 0 end of algorithms II quiz: figure out what some code does hw: turn in one very easy but initially a little opaque just because of context but there can only be so many ways - what got me was the way that was correct didn't work at first but I turned out to be right, something was getting stuck and now it all works. the second one was a little deceptively difficult, a term we all throw around but when it comes down to it, what exactly is the algorithm behind it? that was yesterday. today is day 1 of week 1, and the algorithms are already hard (looking, anyway) Even after doing fairly well in most of the other classes this class appears like it could be much, much more difficult. In a good way.