Week 13 - Markov, the basic of AI teaching

 

  1. Who did you work with?

I worked with my SoCal Software group as usual: Tariq Kakar, Jason Smevog and Yusra Ashar.

  1. What was your strategy for solving the Markov assignment?

After setting all the methods and variables, I started with basic methods: addFromFile(), addLine(), endsWithPunctuation() and randomWord(). They are the first step for the program as well as other methods to run.

I tested them with MarkovTest, adjusted if necessary until they were all passed. Then, I move on to addWord() and getSentence(). While working on them, I kept rereading the prompt, commented out to ensure that I understood the requirements correctly. Because those two methods are the core of the program, it is best to be safe.

Moving on, I tested two methods with MarkovTest again, adjusting any codes necessary. If there was a major problem, such as the output is completely different than the expected, I would have a look at my algorithm, reread the prompt again and came up with a new algorithm.

  1. What was THEIR strategy for solving the Markov assignment

Tariq: “My strategy was to first read through the assignment to get an idea of what is being created. I then went into IntelliJ and created all the members and method signatures for the class. I worked on methods that called other methods first. Once one chain was complete, I then debugged to make sure functionality worked. Then I continued that same pattern for the rest of the project.”

Jason: “My strategy for completing the Markov assignment was to first read through the prompt. I then created all of the member variables and the constructor, getWords, and toString. Following that I worked on the simpler methods that did not require any calls from other methods, such as randomWord and endsWithPunctuation. I then made the methods that called those methods, such as getSentence and addWord. Following that I made addLine, then addFromFile. After I finished writing my code, I tested it with the unit tests and adjusted my code as needed. The most challenging part of this assignment was passing the badLineTest. To solve this test I did some research on regex so that I could filter out the bad lines from being added to the list.”

Yusra: “To solve the Markov assignment, I started by thoroughly understanding the problem and breaking it into smaller tasks. I planned the solution on paper, outlining the logic for parsing input, building the Markov chain using a dictionary structure, and generating text. Each task was implemented incrementally, starting with basic functionality like reading input and constructing the chain, followed by generating text. I wrote pseudocode for clarity, tested methods as I progressed, and refined the code for efficiency and readability. Finally, I added comments and JavaDoc for documentation and ran markovTest.java with all tests passing.”

  1. How would you change your strategy having worked on the assignment?

Markov is a complex assignment, but it is still a small project that I can manage properly. Therefore, I felt like my strategy worked well and changing is unnecessary for now.

  1. According to your classmate(s): how well does your code follow the Java Style?
    My teammates agree everyone code follow the Java Style accordingly.

    In addition to those questions, I discovered that this assignment is a basic structure toward the more complex system of AI learning. For now, Markov only creates randomize sentences. But if the algorithm keeps expanding, the logic structure keeps growing, it will eventually pump out sentences that make sense in the right circumstances. Overall, this is quite a fascinating assignment with new knowledge to learn from.

Comments

Popular Posts