Question continuation
Determine the following probabilities:
a. P(A)
b. P(B)
c. P(A ∩ B)
d. P(A ∪ B)
Answer:
a. P(A) = 0.1389
b. P(B) = 0.1389
c. P(AnB) = 0.0193
d. P(AuB) = 0.2585
Explanation:
Given
Password length = 6
Letters (a-z) = 26
Integers (0-9) = 10
Total usable characters = 26 + 10 = 36
a. P(A) = Probability that a password begins with vowel (a,e,i,o,u)
Probability = Number of required outcomes/ Number of possible outcomes
Number of required outcomes = Number of vowels = 5
Number of possible outcomes = Total usable characters = 36
P(A) = 5/36
P(A) = 0.13888888888
P(A) = 0.1389
b. P(B) = Probability that the password ends with an even number (0,2,4,6,8)
Probability = Number of required outcomes/ Number of possible outcomes
Number of required outcomes = Number of even numbers = 5
Number of possible outcomes = Total usable characters = 36
P(B) = 5/36
P(B) = 0.13888888888
P(B) = 0.1389
c. P(AnB)
This means that the probability that a password starts with a vowel and ends with an even number
P(AnB) = P(A) and P(B)
P(AnB) = P(A) * P(B)
P(AnB) = 5/36 * 5/36
P(AnB) = 25/1296
P(AnB) = 0.01929012345
P(AnB) = 0.0193 ----_---- Approximately
d. P(AuB)
This means that the probability that a password either starts with a vowel or ends with an even number
P(AuB) = P(A) or P(B)
P(AuB) = P(A) + P(B) - P(AnB)
P(AuB) = 5/36 + 5/36 - 25/1296
P(AuB) = 335/1296
P(AuB) = 0.25848765432
P(AuB) = 0.2585 ----_---- Approximately
<span>Think about a basic sandwich, you have a slice of bread, some filling, and another slice of bread. The sandwich technique of feedback is exactly the same way, a slice of bread (complement the person), the filling (what you'd like to have improve), and finally another slice of bread (another complement). So with that in mind, let's look at the available options.
1.
I really appreciate your attention to detail when stocking shelves;
however, you need to be a little bit faster when doing the stocking.
I also like how nice the shelves look when you are done working on them.
* This looks good, you have a complement about the attention to detail, afterwards you mention that you'd like the person to do their job faster, and you follow up with a complement about how nice the final result works. Bread, filling, bread. This looks like the correct answer.
2.
I really appreciate your attention to detail when stocking shelves;
however, you need to speed it up.
You need to be a little bit faster when stocking shelves.
* This starts off well with a complement about attention to detail. It then starts with some filling about the job being needed to be done faster. But if falls down with a second serving of the same filling. So you have bread, filling, filling. Not a sandwich, so this is incorrect.
3.
I do appreciate how nice the shelves look when you are done working on them, though.
You're really not too fast when you are doing the stocking.
* Another nice start with a complement. And you sort of have some filling (not sure if you're merely observing the lack of speed, or recommending more speed). But you still lack the 2nd piece of bread. So this isn't correct either.
4.
I really appreciate your attention to detail when stocking shelves, but it would be great if you could maybe speed it up.
* Once again, you correctly start off with a complement. And you follow up with the filling (what you want done better), but you're lacking the 2nd piece of bread. Not the right choice.
So of the 4 available choices, the best choice is the 1st option.</span>
Ambiguous is not a type of nested class.
c. ambiguous
<u>Explanation:</u>
In computer programming languages class method or programming is used. Class or object is used in c++ or java.
But java has not having pointer so it has limitation of using class.
Inner class: - it is also as nested class where declared in inside the class to interface with other class.
Local: - it is local class declare to use inside the function or procedure
Ambiguous:- it is error on nested class
Anonymous: - it is class without proper declarations.
<em>Employees who work with hazardous energy must be trained in energy control procedures, also known as Lockout/Tagout. Measures must be taken to disable machinery to prevent the release of hazardous energy during maintenance procedures.</em>
Answer:
#include <iostream>
#include <vector>
using namespace std;
void swapFrontBack(vector<int>& nums) {
if(nums.size() < 2) {
return;
}
swap(nums[0], nums[nums.size()-1]);
}
void printit(vector<int>& arr) {
for(int i = 0; i < arr.size(); i++) {
cout << arr[i] << " ";
}
cout << endl;
}
int main() {
vector<int> num1;
swapFrontBack(num1);
printit(num1);
num1.push_back(1);
swapFrontBack(num1);
printit(num1);
num1.push_back(2);
swapFrontBack(num1);
printit(num1);
vector<int> num2(10, 1);
num2[9] = 2;
swapFrontBack(num2);
printit(num2);
return 0;
}
Explanation: