Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started