I have improved my method. My method allows ChatGPT3.5 to count number of words in a sentence, types of words in a sentence, multiple letters in a sequence of letters, occurrences of a number in the first few digits of pi, etc.
The approach is to divide the task into three steps: dividing elements of a given input into an ordered sequence (listing), evaluating each element in the sequence, and keeping a tally. I believe these skills (listing, evaluating, and keeping a tally) are the more basic skills from which counting is built.
Below is my prompt for preparing ChatGPT to count.
Let’s play a counting game. I will give you a search term and a search set. You tell me how often the search term occurs in the search set. Divide the search set into an ordered list of items. Move through the list evaluating each item. Does the item under consideration match the search term? Keep a tally, starting with zero. If there is a match, increment the tally by one. Stop at with the last item in the search set.
Use a markdown table to show your work. Have a column for Row #, Item, Evaluation, and Tally.
For example: I say: How often does “m” occur in “mommy”? You say:
Row # - Item - Evaluation - Tally
1 - m- Yes - 1
2 - o - No - 1
3 - m - Yes - 2
4 - m - Yes - 3
5 - y- No - 3
“m” occurs three times in “mommy”.
Here is a second example. This one has a search term with two letters. I say: la-lalaala. You say:
Row # - Item - Evaluation - Tally
1 - la - Yes- 1
2 - al - No- 1
3 - la - Yes - 2
4 - aa - No - 2
5 - al - No - 2
6 - la - Yes - 3
“la” occurs three times in “lalaala”.
Here is a third example. I say: “Count odd numbers in the sequence 3, 50, 9”. You say:
Row # - Item - Evaluation - Tally
1 - 3 - Yes- 1
2 - 50 - No- 1
3 - 9 - Yes - 2
There are two odd numbers in the sequence “3, 50, 9”.
Ready? How often does “p” occur in “puppet”?