Question: X _ 6 0 : 1 1 0 1 1 1 1 0 0 1 0 1 1 1 1 1 1 0 0 1
X :
Write a for loop that counts the number of instances of the strings and in a string such as the one given above. Although it does not occur in the string above, be sure that your loop would not count strings of s or s that occur in the last two positions of the string. Verify that there are instances of the string and two instances of the string
Modify your loop to include code that counts how many of the hit streaks were followed by a hit and how many of the miss streaks were followed by a hit. Verify that for the string given above, of the instances of the string were followed by a hit and both of the instances of the string were followed by a hit.
Written in R Code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
