What is the probability that the first defective item occurs in the the fifth item inspected - probability-distribution

Q In a production line, the probability of finding a defective item is 0.3 . What is the probability that the first defective item occurs in the the fifth item inspected.
f(x)=(1−p)^(x−1)P
How to apply this formula here?

Congratulations, you got the right formula for the problem in the first place. This is the hardest part most of the time. Now, let's use it.
[Side note: I don't know why you wrote the "p" uppercase one time and lowercase another time. It should be the same.]
[Side note 2: I assume you know how to evaluate this formula with an electronic calculator. Just to make sure: The notation x^y means "take x to the y-th power", or: "multiply x with itself y times".]
So your formula has two variables (p and x) and you got two numbers (0.3 and 5). What is left is to figure out which is which. I'd say 50% chance to get it right by guessing. Let's increase this chance by understanding the formula.
f(x) is the overall probability that an event with probability (1-p) occurs (x-1) times in a row, followed by one event with probability p.
In your example, we want to find the overall probability that the event "item is ok" occurs 4 times in a row, followed by one event of type "item is defective".
See the correspondences?

Related

JK-Flip Flop: K-Map to find the Value of Next State (Qn+1)

Given the Truth Table, Characteristic Table and Excitation table for a JK Flip Flop. I am doing a K-Map to find Qn+1 (next state) given J, K and current State. The K-Map from a tutorial explaining this is shown below:
Why isn't JK' (not K) not included in the equation for Qn+1 ? Why is Qn+1 = QnK'+JQn when there is a grouping of two 1's in the right most corner which equals JK'
There should be atleast one non-overlapping cell in every group we are considering.
In your situation, JK' cannot be considered as both the cells is already present in 2 other groups and there is no non-overlapping cells.
Hence there is no point in considering JK'

Random select in with a bias towards certain outcomes (ie 60/40)

Lets say I have 2 lists and I would like to randomly select a winner between the lists but I would like to select the winner from list A 60% of the time and from list B 40% of the time, how can that be done in Google Sheets?
You can randomly select names from a list using this formula
INDEX(A2:A, RANDBETWEEN(1, COUNTA(A2:A)))
Without knowing some more information on your setup here is a general formula that does what you're describing:
=IF(RAND()<=0.6,INDEX(A2:A, RANDBETWEEN(1, COUNTA(A2:A))),INDEX(B2:B, RANDBETWEEN(1, COUNTA(B2:B))))
Essentially it is rolling a random number between 0 and 1. If it is equal to or less than .6 (simulating 60%, since there is a 60% chance it will be less than or equal to .6) it then selects a random name from Column A, otherwise (bottom 40%) it selects from column B.
You can also replace the "0.6" with A1 in my example to have the weight be a dynamic number. Changing A1 to 75% for example will then compare the random value against less than or equal to .75.
EDIT: Image shows the wrong condition, I was corrected in the sense you want less than or equal to .6 and not greater than, I had the weights flipped.

Google Sheets - Multiply field by field three to the left

My title might not be very specific, so I'm going to try to explain a little better.
The sheet is divided into a name(Column A), containing a certain number of values(Column B), that get added together to a total in Column C. Furthermore, Column D, E and F contains the values I want the Total in Column C multiplied by. These first columns A to F I just fill in manually, but I would like a function to calculate the Columns I've called x, y and z total (G, H and I).
I see a pattern in this, I just can't figure out the syntax to get Sheets to see it aswell.
The pattern I'm invisioning is for each row, I want column G, H and I to take the value 3 fields to their left, and multiply it by Column C, at their row number.
Is this somehow achievable? I tried finding a solution online but I guess I don't know how to word myself.
Here's a picture to maybe make everything a little clearer
This would save me alot of time, given that I have over a hundred different rows this calculation needs to be performed on...
If something is not clear, please feel free to write a comment. I'll be following this thread quite liberally.
Thanks in advance!
You can have this formula on the first xTotal:
cell G2: =ARRAYFORMULA(if(len(C2:C),C2:C*D2:D,))
cell G2: =ARRAYFORMULA(if(len(C2:C),C2:C*E2:E,))
cell G2: =ARRAYFORMULA(if(len(C2:C),C2:C*F2:F,))
I created a sheet with the same results you had before, but this time you don't need vertical columns, just say in the # of Values column how many numbers you should have below. You just need to input the values with the grey columns.
Note: This is assuming you will always have growing vertical numbers like 1,2,3,4,5. In the new sheet you just need to set 5 in the column and it will calculate the result.
Please make a copy of this sheet and edit as you wish.
Sheet
You can use a single, simpler formula for this in cell G2
=ARRAYFORMULA(if(C2:C="",,C2:C*{D2:D,E2:E,F2:F}))

Creating a Total Amount Minus Percentage Forumla

Can someone help me fix this formula so i can get the total? Here is the problem:
=sum(K10:K29)-M15
So basically, Im looking for Cells K10:K29 total displayed on L3 Minus M15 which M15 is the user % input. So like in math it would look like $1,230- 14% = ‭$1,057.8‬. Please and thank you, Im working on a project that needs that formula to work.
The formula in L3 should be:
=K9*(1-M15)
Because that way you are actually substracting between percentages (100%-User%).
What you are after is the remainder of the percentage (in your example 100%-14%=86%) so the formula to use is =sum(K10:K29)*(1-M15).
Your problem is in the math part. The percent is just that, a ratio. You need to multiply the ratio with the amount to reach the value you're after, e.g. 14% equals the value 0.14. However, multiplying it with 1,230 gives you 14% of 1,230 (172.2) which is presumably what you want to deduct.
I think this must be due to many calculators allowing for exactly the shortcut you're trying to do despite being mathematically dubious. This to make calculations simpler in shops.

Detect text columns from word positions

I have a tiff file and the text on it, which has been OCR'd at an earlier stage. The words have their exact positions as information (upper left, lower right). I now need to read the text within a user-drawn rectangle.
Normal paragraphs are no problem, but I don't know how I should handle text columns. If there are two paragraphs next to each other, simply taking the row as a single line would make the result unusable.
Are there algorithms to help me put the words in the right order? I'm guessing that I have to examine the spaces between words to detect patterns that identify columns. I would like to avoid processing the image directly, although it should be possible (but no OCR).
I am also unsure about the influence of lists/tables, e.g. in orders & bills. A line-orientated approach would probably be better here.
I am developing in Delphi, but adaptable algorithms in other languages would also be appreciated.
edit: I will try to post sample data tomorrow, but basically I have an Array of Words, with their respective coordinates on the image (I could easily draw a rectangle around them, for example).
Suppose your original text is in two columns like this:
Aaaa bb ccc ddddd mmmm nn oooo pp
eee fff ggggg hh qqq rrrrrrrrr
i jjjj kkk lll sss tttt uu.
From your description, it sounds like your OCR has given you the individual words and their bounding rectangles. If the original page is scanned orthogonally, then all of the words on a given line should have the same (or very close) y values. If they're not exactly the same, you can do an integer division on the vertical positions with some fraction of a typical box height. That should cluster the y values. You can do similar processing on the x coordinates to ensure that words at the edge of a column also have identical x values.
To detect the separate columns, I'd try making a histogram of all the "left" values of all the words (or right edges if your text runs right-to-left). You should see a peak at the beginning of each column.
You can probably rule out any false positives by ensuring that, on every line, there is a gap between the right coordinate of the last box before the candidate start of a column. The gap should probably be at least as large as the smallest width of any word.
You can then partition your words up into column groups by checking which horizontal range their left and right coordinates fall in to. In our example, the words from Aaaa through lll would end up in the first partition and the words from mmmm through uu. would end up in the second partition.
Within each partition, you can then partition on line by sorting on the y coordinates. Finally, for each line, you sort on the x coordinate. (Whether you sort on ascending or descending depends on your coordinate system and the direction your text flows.)
The same basic idea could be applied to tables as well as columns of text, but you might need some tweaks to deal with things like right-justified cells.

Resources