Match 2 columns, but bring along all associated rows from the second column - excel-2010

What is the easiest way for Example1 to be converted to Example2 (I would be doing this with much longer lists)? Column C and D shall be associated to Col B for the output of Example2. This is not just to make Col B replicate Col A, although that is part of the solution. Thank you in advance!
Example1:
Col A Col B Col C Col D
a e d c
l l o a
e x g t
x a s s
Example2:
Col A Col B Col C Col D
a a s s
l l o a
e e d c
x x g t

It is not totally clear what you want to achieve and what the data qualities are, so a few assumptions:
all items in Col A are also in Col B
items in Col A are unique
Consider the following screenshot. Column A has been copied into column F. The formula in G1 is
=INDEX(B$1:B$4,MATCH($F1,$B$1:$B$4,0))
Copy the formula across to I1 and then copy G1 to I1 down.
If that does not do what you need, please edit your question, add a better data sample and more explanation.

Related

How to learn pocketsphinx for bi-lingual system?

I did create a dictionary with 2 languages(English/Persian) at the one file like this:
بگو B E G U
خزنده KH A Z A N D E
قدت GH A D E T
چنده CH A N D E
قد GH A D
من M A N
شب SH A B
hi H AA Y
hello H E L L O
how H O V
are AA R
you Y U
what V AA T
is I Z
your Y O R
name N E Y M
old O L D
where V E R
from F E R AA M
And used http://www.speech.cs.cmu.edu/tools/lmtool-new.html to build the language model. Then I tried to learn an acoustic model with that language model and test it.
It works good for Persian voices but doesn't work for English words. After some try&error I found that the problem is about my phoneset. I used my own phoneset as you can see above, but it seems pocketsphinx doesn't accept this phoneset for English words and it only accepts it's own phoneset for English!
So I want to know did I found the problem true? Should I use the pocketsphinx phoneset for my Persian words as well? Where should I find it's complete phoneset and a guide to learn how to use it for Persian words?
You have to build a new acoustic model with joined phoneset

Spreadsheet: ADRESS() works in ARRAYFORMULA(), wrapping it in INDIRECT() doesn't?

For Google Spreadsheet,
I'm using this formula in column B to try and acquire specific cells over the columns B to Z:
=ARRAYFORMULA(IF(ISODD(COLUMN(B:Z)),ADDRESS(ROW(),(COLUMN(B:Z)-2),1,TRUE),ADDRESS(ROW(),(COLUMN(B:Z)-1),1,TRUE)))
This Output is correct:
A B C D E F G H I J
CellA7 $A$7 $A$7 $C$7 $C$7 $E$7 $E$7 $G$7 $G$7 $I$7
But when i try to use these strings to get the values in each one with INDIRECT:
=ARRAYFORMULA(IF(ISODD(COLUMN(B:Z)),INDIRECT(ADDRESS(ROW(),(COLUMN(B:Z)-2),1,TRUE)),INDIRECT(ADDRESS(ROW(),(COLUMN(B:Z)-1),1,TRUE))))
it seems to go wrong somewhere, and the result is now:
B C D E F G H I J
CellA7 #VALUE! CellA7 #VALUE! CellA7 #VALUE! CellA7 #VALUE! CellA7
Where the #VALUE! error message in column C,E,G,I is:
Error
Function ADDRESS parameter 2 value is 0. Valid values are between 1 and 18278 inclusive.
Solved it by:
=ARRAYFORMULA(IF(ISODD(COLUMN(B:Z)),EDATE($A7,FLOOR(COLUMN(B:Z)/2)),EDATE($A$7,FLOOR(COLUMN(B:Z)/2))-1))

Proving MC/DC unique cause definition compliance

I'm reading the following paper on MC/DC: http://shemesh.larc.nasa.gov/fm/papers/Hayhurst-2001-tm210876-MCDC.pdf.
I have the source code: Z := (A or B) and (C or D) and the following test cases:
-----------------
| A | F F T F T |
| B | F T F T F |
| C | T F F T T |
| D | F T F F F |
| Z | F T F T T |
-----------------
I want to prove that the mentioned test cases comply with unique cause definition.
I started by eliminating masked tests:
A or B = F T T T T, meaning it masks the first test case from C or D as F and (C or D) = F.
C or D = T T F T T, meaning it masks the third test case from A or B as (A or B) and F = F.
I then determined MC/DC:
Required test cases for A or B:
F F (first case)
T F (fifth case)
F T (second or fourth case)
Required test cases for C or D:
F F (third case)
T F (fourth or fifth case)
F T (second case)
Required test cases for (A or B) and (C or D):
T T (second, fourth or fifth case)
F T (first case)
T F (third case)
According to the paper, this example doesn't complies to unique cause definition. Instead, they propose changing the second test case from F T F T to T F F T.
-----------------
| A | F T T F T |
| B | F F F T F |
| C | T F F T T |
| D | F T F F F |
| Z | F T F T T |
-----------------
I determined MC/DC for A or B again:
F F (first case)
T F (fifth case)
F T (fourth case)
Then, they introduce the following independence pairs table that shows the difference between both examples (in page 38):
I understand that for the first example, the independence pair that they show changes two variables instead of one, however I don't understand how they are computing the independence pairs.
In the A column, I can infer they take F F T F from the test cases table's A row, and they compute the independence pair as the same test case with only A changed (T F T F).
In B's column, however, they pick F F T F again. According to my thinking, this should equal to the B's column: F T F T instead.
The rest of the letters show the same dilemma.
Also for D's first example column, they show that the independence pair of F T F T is T F F F, which ruins my theory that they are computing the independence pair from the first value, and proving that they are picking it from somewhere else.
Can someone explain better how (and from where) do they construct such independence pair table?
First the let’s re-read the definitions:
(From www.faa.gov/aircraft/air_cert/design_approvals/air_software/cast/cast_papers/media/cast-10.pdf)
DO-178B/ED-12B includes the following definitions:
Condition
A Boolean expression containing no Boolean operators.
Decision
A Boolean expression composed of conditions and zero or more Boolean operators.
A decision without a Boolean operator is a condition.
If a condition appears more than once in a decision, each occurrence is a
distinct condition.
Decision Coverage
Every point of entry and exit in the program has been invoked at least once
and every decision in the program has taken on all possible outcomes at least once.
Modified Condition/Decision Coverage
Every point of entry and exit in the program has been invoked at least once,
every condition in a decision in the program has taken all possible outcomes
at least once, every decision in the program has taken all possible outcomes
at least once, and each condition in a decision has been shown to independently
affect that decision's outcome.
A condition is shown to independently affect a decision's outcome by varying just
that condition while holding fixed all other possible conditions.
So, for the decision '(A or B) and (C or D)' we have four conditions: A,B,C and D
For each condition we must find a pair of test vectors that shows that the condition
'independently affect that decision's outcome'.
For unique cause MC/DC, only the value of the condition considered can vary in the pair of test vectors.
For example let's consider condition A. The following pair of test vectors covers condition A:
(A or B) and (C or D) = Z
T F T F T
F F T F F
With this pair of test vectors (TFTF, FFTF) only the value of A and Z (the decision) change.
We then search pairs for conditions B, C and D.
Using the RapiCover GUI (Qualifiable Code coverage tool from Rapita Systems - www.rapitasystems.com/products/rapicover) we can see the full set of test vectors (observed or missing) to fully cover all conditions of the decision.
RapiCover screenshot
Vector V3 (in yellow in the screenshot above) isn't used in any independence pair.
Vector V6 (in red in the screenshot) is missing for MC/DC coverage of condition D.
This is for the definition of 'unique cause' MC/DC.
Now for 'masking MC/DC':
For 'masking MC/DC' the requirement that the value of a single condition may vary in a pair
of test vectors is relaxed provided that any other change is masked by the boolean
operators in the expression.
For example, let's consider the pair of vectors for condition D:
(A or B) and (C or D) = Z
T F F T T
T F F F F
We can represent these two test vectors on the expression tree:
and
/ \
or1 or2
/ \ / \
A B C D
and and
[T] [F]
/ \ / \
or1 or2 or1 or2
[T] [T] [T] [F]
/ \ / \ / \ / \
A B C D A B C D
[T] [F][F] [T] [T] [F][F] [F]
This is a pair for unique cause MC/DC.
Let's now consider a new pair of test vectors for condition D:
(A or B) and (C or D) = Z
F T F T T
T F F F F
Again we can represent these two test vectors on the expression tree:
and and
[T] [F]
/ \ / \
or1 or2 or1 or2
[T] [T] [T] [F]
/ \ / \ / \ / \
A B C D A B C D
[F] [T][F] [T] [T] [F][F] [F]
This is a pair for masking MC/DC because although the values for 3 conditions (A, B and D) have changed
the change for conditions A and B is masked by the boolean operator 'or1' (i.e. the value of 'A or B' is unchanged).
So, for masking MCDC, the independence pairs for all condition D can be:
RapiCover screenshot

Array expand with one formula

input:
A 4
B 3
C 2
output:
A
A
A
A
B
B
B
C
C
Using only one formula. no code please.
=ArrayFormula(IFERROR(TRANSPOSE(SPLIT(CONCATENATE(REPT(A:A&CHAR(9);B:B));CHAR(9)))))

Dependency Preserving in decomposition of tables

I am confused with dependency preserving property of database relations (tables). Do we have to look at initial FD set or what else? I tried to solve some problems on this subject. The questions before this one all feed my initial estimation, which is 'look at the given FD set. If you don't lose any of them in your new relation set, then this is dependency preserving'.
But when I come to this question I am confused.
Consider the relation R = (A B C D E F G H) and the following FD set:
FD1 E -› D
FD2 B, E -› C G
FD3 D, G -› E
FD4 C -› A B
FD5 E, G -› C
FD6 A, E -› B D
FD7 C, E, D -› G
FD8 A, G -› E
These are the given relations
R1 (E F G H)
R2 (A B E G)
R3 (C D E G)
R4 (A B C)
Answer says that this decomposition is dependency preserving. According to my estimation we lose FD2 so, this must not be dependency preserving.
I need an expert to clarify this concept for me.
This question was a part of homework questions. I wasn't sure if I am thinking right when I do the homework.
In my answer I wrote:
This decomposition is not dependency preserving because in this decomposition we loose the FD DF--> BC .
And my database teacher accepted this answer as an right answer I wanted to clearify the subject here also.
Ferda
The decomposition is dependency preserving as FD2 BE->CG can be achieved by relations R2(BE->G) and R3(EG->C).
Closure of BE gives CG.

Resources