I have two .txt files (please see attached) that I will be importing as input to the program we will create
The first is an array of subsets of integers.
The other is derived from another program of mine and will be input to our program turn by turn. It contains ‘chapters’ under the headers ‘-Digit10’ or ‘-Digit9’ etc
I want to see what subset of my first txt is missing from each chapter’ as follows.
Suppose we are talking about the ‘chapter called ‘-Digits:9’
AS you see, it shows three ‘answers’, three results:
First it says
-----
(Number of permutations ending in 1: 96
Missing number: 2
-----
So we go in row 1, position 2 of our array and ‘translate’ this that the subset
[1,2,3,4] is missing
Then our .txt file says
(Number of permutations ending in 3: 96
Missing number: 2
Hence we go to row 3, position 2 of our array and see that the subset [5,6,9,10] is ‘reported missing’
Lastly, our input .txt says
------
(Number of permutations ending in 6: 96
Missing number: 3
Hence we go to row 6, position 3 od our array and see that the subset [3,4,11,12] is reported missing there.
We are DONE with the ‘chapter’ called ‘Digits9’.
So now we ask:
- What is the INTERSECTION of these three subsets [1,2,3,4], [5,6,9,10] and [3,4,11,12] we derived?
It is numbers 3 and 4. We print them on the screen under the phrase, say, ‘Common to all’or ‘Always’
BUT ALSO we need to know and hence we ask:
‘From our universe (integers 1 to 12) what numbers can NEVER be found in these three ‘answers’ we got before in -Digits:9 chapter?’
How we answer that? By finding the COMPLEMENTARIES for each one!
For the first, the [1,2,3,4] subset, its complementary is
(i) [5,6,7,8,9,10,11,12]
for [5,6,9,10] it is
(ii) [1,2,3,4,7,8,11,12] and
for [3,4,11,12] it is
(iii) [1,2,5,6,7,8,9,10]
So we take the INTERSECTION of all these complimentaries (i)-(iii) and report that
7 and 8
under the header say ‘Never been found’ or just ‘Never’
That’s it!
We do this not for every ‘chapter’ in [login to view URL], but for the chapters I will be defining each time, by selecting the corresponding ‘telephone keys’, as shown in the attached jpeg.
so if I press there say 10, 9, 6 and hit ‘Go’
then I will get ‘Always… Never….’ results like the above only for Digit10, Digit9 and Digit6, no need to deal with the others.
Part 2:
As you see, MainINput provides a set of rows at the bottom.
I want those printed in the large ‘array’ box on the left of the attached jpeg AND ‘colored’, as follows:
Let us take- as a nexample - these three rows that consists of ‘pairs of numbers’ separated by -----:
20----36 20----90 24----80 26----108 39----36 40----120
21----24 21----90 25----40 27----108 40----24 41----120
22----24 22----30 26----20 28----72 41----12 42----120
1. If for a pair a----b the pair ABOVE it is (a-1)----b, then we make a----b
BOLD.
2. If a pair has a bold pair ABOVE it but it is not bold itself, we color it bold+green
3. If a pair has a bold+green pair above it, we color it bold+blue and lastly
4. If a pair has a bold+blue pair above it, we color it bold+red