Mathematics 5300 Assignment 3
1. Why does color space look like a shark fin? Look at the chromaticity diagram. Make a table of wavelengths versus x, y, and z =1-x-y for each of the wavelengths. Plot wavelengths vs. x/y, y, and z/y. what do these graphs represent.
Color space looks like a shark fin because it tells us that red, green, and blue can be mixed additively to match colors. It also tells us that no 3 primary colors can reproduce the human vision.
W/ L= wavelengths
{380,460,470,480,490,500,510,520,530,540,550,560,570,580,590,600,610,620,700}
x = {.18,.14,.12,.09,.04,.01,.015,.09,.15,.25,.32,.38,.45,.51,.57,.63,.67,.69,.73}
y = {.015,.04,.07,.13,.30,.53,.75,.89,.81,.75,.69,.62,.55,.49,.43,.37,.33,.31,.27}
2. Consider any two colors c1 and c2 with coordinates (x1, y1), (x2, y2), in the chromaticity diagram of figure 6.5. Derive the necessary general expressions for computing the relative percentages of colors c1,c2 composing a given color that is known to lie on the straight line joining these two colors.
“The chromaticity diagram is useful for color mixing because a straight line segment joining any two points in the diagram defines all the different color variations that can be obtained by combining these two colors additively. Consider, for example, a straight line drawn from the red to the green points shown in the chromaticity diagram. If there is more red light than green light, the exact point representing the new color will be on the line segment but it will be closer to the red point than to the green point.”
(page 399 textbook)
The above statement tells us that the necessary general expression for computing percentages can be found using the distance formula. Given a line segment with endpoints c1 and c2. As well, consider a point B on the segment between the endpoints. B has coordinates (x, y)
The percentage of c1 in B is given by distance formula
{((x-x2)^2 + (y-y2)^2)^.5 / ((x1 – x2)^2 + (y1 – y2)^2)^.5} X 100%
The percentage of c2 in B is given by distance formula
{((x-x1)^2 + (y-y1)^2)^.5 / ((x1 – x2)^2 + (y1 – y2)^2)^.5} X 100%
3. Consider any three valid colors c1, c2, c3 with coordinates (x1, y1), (x2 , y2) , (x3 , y3) in the chromaticity diagram. Derive the necessary general expressions for computing the relative percentages of c1, c2, c3 composing a given color known to lie within the triangle whose vertices are at the coordinates of c1, c2, c3.
Since we are given points c1, c2, c3 in the chromaticity diagram we can connect these points to form a triangle.
As well we can assume that there is a point c which is a point defining a given color known to lie within the triangle. Point c with coordinates (x,y) lies on a line joining c1 to the opposite side c2 c3. We can call this point c4 with coordinates (x4,y4). The same idea exists for points c5 with coordinates (x5,y5) and c6 with coordinates (x6,y6).
The distance of c from each vertex of the triangle determines the amount of each color (%) making up point c.
The percentage of c2 in c (x,y) is given by distance formula
{((x-x5)^2 + (y-y5)^2)^.5 / ((x2 – x5)^2 + (y2 – y5)^2)^.5} X 100%
The percentage of c1 in c is given by distance formula
{((x-x1)^2 + (y-y1)^2)^.5 / ((x1 – x4)^2 + (y1 – y4)^2)^.5} X 100%
The percentage of c3 in c is given by distance formula
{((x-x6)^2 + (y-y6)^2)^.5 / ((x3 – x6)^2 + (y3 – y6)^2)^.5} X 100%
4. Sketch the CMY components of the image in problem 6.6 as they would appear on a monochrome monitor.
(C,M,Y) = (1,1,1) – (R,G,B)
RGB Component CMY Component
Black (0,0,0) White (1,1,1)
Red (1,0,0) Cyan (0,1,1)
Yellow (1,1,0) Blue (0,0,1)
Green (0,1,0) Magenta (1,0,1)
Blue (0,0,1) Yellow (1,1,0)
Cyan (0,1,1) Red (1,0,0)
Magenta (1,0,1) Green (0,1,0)
White (1,1,1) Black (0,0,0)
Gray (.5,.5,.5) Gray (.5,.5,.5)
Tried the rest of the question but did not know how to proceed.
5. What is the transformation on the RGB coordinates of the image which inverts the color of the image? That is what is the transformation which sends white to black, a pixel with a lot of blue to a pixel with a little blue, a pixel with a lot of red to a pixel with a little red, etc. what effect does this transformation have on the HSI coordinates of the image?
Convert colors from to HSI to RGB first we
Multiply H x 360. The RGB components are given by the equations:
B = I(1 – S)
R = I{1 + (S cos H) / (cos(60 – H))}
G = 3I – (R + B)
To invert the color image we use the fact that (CMY) = (111) – (RGB) (page 406 textbook)
Thus
C = 1 - I{1 + (S cos H) / (cos(60 – H))}
M = 1 – (3I – (R + B))
Y = 1 – (I(1 – S))
6. Consider the transformation on color space which switches the red and blue components.
a) What does this do to the HIS coordinates of the color point?
b) Take the image of figure 6.5 and use GIMP to exchange the red and blue color channels of the image.
Tried this question but did not know how to proceed.
Pre – Amble #1
Student number mod 8 is 7
Student number mod 3 is 1
Student number mod 7 is 4
1. Show that every binary function (all 16) can be expressed as a composition of the binary operations AND / OR and NOT. Note that the function x is defined as 0011 and y is defined as 0101.( class notes)
a) X AND NOT X
Function x Not x
0 0 1
0 0 1
0 1 0
0 1 0
b)
X AND Y
Function X Y
0 0 0
0 0 1
0 1 0
1 1 1
c) X AND NOT Y
Function X Not y
0 0 1
0 0 0
1 1 1
0 1 0
d) X AND X
Function X X
0 0 0
0 0 0
1 1 1
1 1 1
e) NOT X AND Y
Function NOT X Y
0 1 0
1 1 1
0 0 0
0 0 1
f) Y AND Y
Function Y Y
0 0 0
1 1 1
0 0 0
1 1 1
g) ( X AND NOT Y) OR (Y AND NOT X)
Function X NOT X Y NOT Y
0 0 1 0 1
1 0 1 1 0
1 1 0 0 1
0 1 0 1 0
h) X OR Y
Function X Y
0 0 0
1 0 1
1 1 0
1 1 1
i) NOT(X) and NOT(Y)
Function NOT X NOT Y
1 1 1
0 1 0
0 0 1
0 0 0
j)
Function
1
0
0
1
k) NOT Y AND NOT Y
Function NOT Y NOT Y
1 1 1
0 0 0
1 1 1
0 0 0
l) X OR NOT Y
Function X NOT Y
1 0 1
0 0 0
1 1 1
1 1 0
m) NOT X AND NOT X
Function NOT X NOT X
1 1 1
1 1 1
0 0 0
0 0 0
n) NOT X OR Y
Function NOT X Y
1 1 0
1 1 1
0 0 0
1 0 1
o) NOT( X AND Y)
Function X Y
1 0 0
1 0 1
1 1 0
0 1 1
p) ((NOT X) OR Y) OR X
Function NOT X Y X
1 1 0 0
1 1 1 0
1 0 0 1
1 0 1 1
2. Which if any of the 16 binary functions (if any) cannot be represented using only compositions of (h) {NOT,IMPL}?
x y Not x Not y x impl y y impl x Not x impl y Not y impl (y impl x)
0 0 1 1 1 1 0 1
0 1 1 0 1 0 1 1
1 0 0 1 0 1 1 1
1 1 0 0 1 1 1 1
The following binary functions cannot be represented by {NOT,IMPL}
0000, 0001, 0010, 0011, 0100, 0101, 0110, 1000, 1001, 1110
3. Which of the 16 binary operations are commutative?
x y f (x,y) f (y,x)
0 0 0 0
0 1 0 0
1 0 0 0
1 1 0 0
a)
Commutative
b)
x y f (x,y) f (y,x)
0 0 0 0
0 1 0 0
1 0 0 0
1 1 1 1
Commutative
c)
x y f (x,y) f (y,x)
0 0 0 0
0 1 0 1
1 0 1 0
1 1 0 0
Not Commutative
d)
x y f (x,y) f (y,x)
0 0 0 0
0 1 0 1
1 0 1 0
1 1 1 1
Not Commutative
e)
x y f (x,y) f (y,x)
0 0 0 0
0 1 1 0
1 0 0 1
1 1 0 0
Not Commutative
f)
x y f (x,y) f (y,x)
0 0 0 0
0 1 1 0
1 0 0 1
1 1 1 1
Not Commutative
g)
x y f (x,y) f (y,x)
0 0 0 0
0 1 1 1
1 0 1 1
1 1 0 0
Commutative
h)
x y f (x,y) f (y,x)
0 0 0 0
0 1 1 1
1 0 1 1
1 1 1 1
Commutative
i)
x y f (x,y) f (y,x)
0 0 1 1
0 1 0 0
1 0 0 0
1 1 0 0
Commutative
j)
x y f (x,y) f (y,x)
0 0 1 1
0 1 0 0
1 0 0 0
1 1 1 1
Commutative
k)
x y f (x,y) f (y,x)
0 0 1 1
0 1 0 1
1 0 1 0
1 1 0 0
Not Commutative
x y f (x,y) f (y,x)
0 0 1 1
0 1 0 1
1 0 1 0
1 1 1 1
l)
Not Commutative
m)
x y f (x,y) f (y,x)
0 0 1 1
0 1 1 0
1 0 0 1
1 1 0 0
Not Commutative
n)
x y f (x,y) f (y,x)
0 0 1 1
0 1 1 0
1 0 0 1
1 1 1 1
Not Commutative
o)
x y f (x,y) f (y,x)
0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0
Commutative
x y f (x,y) f (y,x)
0 0 1 1
0 1 1 1
1 0 1 1
1 1 1 1
p)
Commutative
3. Which of the 16 binary operations are associative?
x y z f(x,y) f(f(x,y),z) f(y,z) f(x,f(y,z)
0 0 1 0 0 0 0
0 0 1 0 0 0 0
0 1 1 0 0 0 0
0 1 1 0 0 0 0
1 0 0 0 0 0 0
1 0 0 0 0 0 0
1 1 0 0 0 0 0
1 1 0 0 0 0 0
4. How do things grow / change if you are working in trinary? That is assume that there are 3 possible inputs {0,1,2}, how many possible binary ( 2 input arguments – one output) operations are there?
Inputs
0 0
0 1
0 2
1 0
1 1
1 2
2 0
2 1
2 2
Given the above inputs there are 39 possible binary operations.
5. Working with trinary inputs, how many binary operations are necessary so that compositions of these binary operations can be used to express every possible two argument function on trinary operations?
The following operations are necessary so that compositions of binary operations can be used to express every possible two argument function on trinary operations:
Negation
Disjunction
Conjunction
Implication
6. Use GIMP or Photoshop to create pictures:
a) Pic1and Pic 2
b) Pic 1or Pic 2
(e) NOT(pic1IMPL pic2)
7. Choose truth values to represent the truth values of phrase that appear in the following paragraph which cannot be decomposed in terms of the operations of AND, OR ,NOT. Join these symbols together with the 3 connectives and represent each sentence with connectives and symbols.
Poison caused the victim’s death if and only if there was a change in his blood chemistry or a residue of poison in his stomach is represented by:
a) A and (B OR C), where A = Poison caused the victim’s death if and only if, B = there was a change in his blood chemistry, C = a residue of poison in his stomach.
There was neither a change in blood chemistry nor a residue of poison in his stomach, but there were puncture marks on the body is represented by:
b) There was neither D NOT(OR) E, AND F where D = a change in blood chemistry, E = a residue of poison in his stomach, F = but there were puncture marks on the body
Poison was injected by a needle only if there were puncture marks on the body is represented by:
c) Poison was injected by a needle only if G, where G = there were puncture marks on the body.
Either poison was the cause of the victim’s death, or there are no puncture marks on the body is represented by:
d) Either H OR I where H = poison was the cause of the victim’s death, I = there are no puncture marks on the body.
Orders of magnitude
1. A commodore 64 had 64K of memory. How many times more memory does a computer with 1GB of memory have?
64 KB = 216 bytes and 1GB = 230 bytes. Therefore 1GB has 2 14 times more memory than a commodore 64. (230 / 216 = 214)
2. A double sided floppy could hold 800K of storage. How many floppy disks are equivalent to DVD’s which can store 4.75 GB of data?
( 4.75 x 230) / ( 800 x 210) = 6225.92
6225.92 floppy disks are equivalent to a DVD.
3. Estimate the processor clock rates of early computers by finding information on the internet. Estimate some typical computers on the market today and compare factors of speed.
The clock rate is the fundamental rate in cycles per second (measured in hertz) at which a computer performs its most basic operations such as adding two numbers or transferring a value from one processor register to another.
The clock rate of a computer is only useful for providing comparisons between computer chips in the same processor family. An IBM PC with an Intel 486 CPU runs at 50 MHz. ( http://en.wikipedia.org/wiki/Clock_rate)
The Atanasoff–Berry Computer (ABC) was the first electronic digital computing device.[1] Conceived in 1937, the machine was capable of solving up to 29 simultaneous linear equations.
The AC power line frequency of 60 Hz was the primary clock rate for the lowest level operations.
(http://en.wikipedia.org/wiki/Atanasoff%E2%80%93Berry_Computer)
Modern computer system designs may specify a wide range of system clock rates, e.g. from 10-MHz or less to 100-MHz or more.
(http://www.patentstorm.us/patents/5506878-description.html)
A comparision of factors of speed tells us that today’s computers are approximately 1.7 million times faster today than the first ABC computer mentioned above.
100MHZ = 100,000,000 HZ / 60 HZ which is about 1.7 million.