This change represents answers to the exercises

This felt different from unit 1 because it felt more like data
analysis rather than writing a program to have a specific output
The output was also entirely in the terminal which was different.

Something I thought of is how this would be an ideal tool for data
analysis, especially when you want to filter large data sets for
analysis.

I got stuck on exercises 7 and 10. I had an idea of what I needed
to do, but not the order of how to do it. The strategy that worked
best to getting unstuck was to try a part of the sequence of operations
that I wanted and see what happened, and then once I got that working
adding another operation to it.

I worked with a group last friday on the problem set and it was
very helpful to be able to bounce ideas off of each other while we
were working on them. I also used the discord to ask and answer questions
and that has been very helpful!
This commit is contained in:
Thomas Naber 2023-07-31 12:56:43 -04:00
parent 3cee893eb1
commit 740e216449
4 changed files with 111022 additions and 19 deletions

View File

@ -10,32 +10,35 @@ If you want to be really stylish, put your code inside of backticks like this:
`cat words_100k.txt | length | put 10 | equal | count`
## 1. What is the longest word?
`cat words_100k.txt | length | order -r | head -n 1`
antidisestablishmentarianism
## 2. How many words have two u's in a row?
`cat words_100k.txt | match "uu" | count`
16
## 3. How many words have the word "cat" in them?
`cat words_100k.txt | match "cat" | count`
893
## 4. How many words have all five vowels (aeiou)?
`cat words_100k.txt | match "a" | match "e"| match "i" | match "o" | match "u" | count`
812
## 5. Which words have two l's in a row, two m's in a row, and two t's in a row? (they don't have to be in that order)
`cat words_100k.txt | match "ll" | match "mm"| match "tt" | count`
0
## 6. How many words have sixteen or more letters?
`cat words_100k.txt | length | order -r | put 16 | lessthan -e | count`
696
## 7. What's the most frequent 10-letter word?
`cat words_100k.txt | length | put 10 | equal | frequency | order -r | head -n 1`
zoomorphic
## 8. What's the longest word which doesn't have any repeated letters?
`cat words_100k.txt | length | unique 1 | length | equal 0 2 | order -r | head -n 1`
salpingectomy
## 9. What's the longest word which only uses four different letters?
`cat words_100k.txt | length | unique 1 | length | put 4 | equal | order 3 | tail -n 1`
senselessness
## 10. If you rearrange the letters in "sidebar," what other words can you create?
`cat words_100k.txt | unique | match "abdeirs" | length | length 2 | equal`
braised
seabird
sidebar

100000
words_100k.txt Normal file

File diff suppressed because it is too large Load Diff

10000
words_10k.txt Normal file

File diff suppressed because it is too large Load Diff

1000
words_1k.txt Normal file

File diff suppressed because it is too large Load Diff