It’s another day at the office, doing SEO and coding stuff. The busy ambiance of the place made my head ache like hell. The suddenly out of nowhere, came out my officemate. He begun talking all of a sudden and showed his new camera that he bought yesterday with his girlfriend. In the past we were discussing about them (my friend and his girlfriend) starting a new business, a film studio. This friend of mind is a photography fanatic. He loves on taking pictures and videos (note: pictures of his girl). He would take pictures and made slide shows on that and upload it on youtube.

He’s new camera, Canon EOS 1000D, then I said “Wow!”, I envy him. They want to start a new business because they were inspired once, when our company hired a Camera Hire. My friend was amazed by their equipment, including a Sony HVR-Z1E. We enjoyed doing the set for the company anniversary video.

My friend told me, “I got to have those Sony cameras! And start my own new Sony camera hire Studio”. I think he would succeed on that, because he’s just too hard working. I think I can be a part of that, I can be a photo shoot model, or a camera man, or just an assistant, lol.

I've been also dreaming of having a camera. I want to take pictures of nude woman. I was inspired by these one photographer, Dave Naz (if you want to know him more, just Google his name). I really like his photographs with all those beautiful women. I'm also fan of taking panoramic views; I love nature, especially underwater. I think that would be an expensive photography. My favorite diving photography spot where I want to take pictures, the Tubbataha reef, it's in the Philippines. Although the most popular reef on earth is the Great Barrier, I prefer the Tubbataha, why is that, It's near our place.

Maybe It will take years before my dream of becoming a photographer cam true, and I'm hoping I'll have that dream.

### Exercise Postfix..Prefix..Infix

I) Infix to Prefix Notation Translation for Expressions

• Translation defined inductively as: Prefix(E) where E is an expression

1) If E is a variable or constant then Prefix(E)=E

2) If E is E1 op E2 then Prefix (E) = Prefix (E1 op E2) = op Prefix (E1) Prefix (E2)

3) If E is (E1) then Prefix(E1) = Prefix(E1)

Example:

Infix A*B+C/D to Prefix +*AB/CD

Prefix ((A*B)+(C/D))

+ prefix(A*B) prefix (C/D)

+* prefix (A) prefix (B) / prefix (C) prefix (D)

Ans: +*AB/CD

II a)Prefix to Infix

• Translation defined inductively as: Prefix(E) where E is an expression

1) If E is a variable or constant then Infix(E)=E

2) If E is E1 op E2 then Infix (E) = Infix (op E1 E2) = Infix (E1) op Infix (E2)

3) If E is (E1) then Infix(E1) = Infix(E1)

Example:

Infix( - ( / A B ) (* C D) )

= ( Infix ( / A B ) - Infix( * C D ) )

= ( ( Infix (A) * Infix (B) ) - ( ( Infix (C) / Infix (D) )

Ans: ( ( A / B ) - ( C * D ) )

II b). Postfix to Infix

1) If E is a variable then Infix(E) = E

2) If E is E1 E2 op then Infix(E) = Infix(E1 E2 op) = Infix (E1) op Infix (E2)

3) If E is (E1) then Infix(E) = Infix (E1)

Example:

Infix( ( A B + ) C + )

= ( Infix(A) + Infix(B) ) + Infix(C)

Ans: ( A + B ) + C

III) Postfix to Prefix Notation Translation for Expressions

• Translation defined inductively as: Prefix(E) where E is an expression

1) If E is a variable or constant then Prefix(E)=E

2) If E is E1 op E2 then Prefix (E) = Prefix (E1 E2 op) = op Prefix (E1) Prefix (E2)

3) If E is (E1) then Prefix(E1) = Prefix(E1)

Example:

a) From Postfix((AB*)(CD/)+)

Prefix ((AB*)(CD/)+)

= + Prefix((AB*)) Prefix((CD/))

= + Prefix(AB*) Prefix(CD/)

= + * Prefix (A) Prefix (B) / Prefix (C) Prefix (D)

Ans: + * AB / CD or (+(*AB)(/CD))

• Translation defined inductively as: Prefix(E) where E is an expression

1) If E is a variable or constant then Prefix(E)=E

2) If E is E1 op E2 then Prefix (E) = Prefix (E1 op E2) = op Prefix (E1) Prefix (E2)

3) If E is (E1) then Prefix(E1) = Prefix(E1)

Example:

Infix A*B+C/D to Prefix +*AB/CD

Prefix ((A*B)+(C/D))

+ prefix(A*B) prefix (C/D)

+* prefix (A) prefix (B) / prefix (C) prefix (D)

Ans: +*AB/CD

II a)Prefix to Infix

• Translation defined inductively as: Prefix(E) where E is an expression

1) If E is a variable or constant then Infix(E)=E

2) If E is E1 op E2 then Infix (E) = Infix (op E1 E2) = Infix (E1) op Infix (E2)

3) If E is (E1) then Infix(E1) = Infix(E1)

Example:

Infix( - ( / A B ) (* C D) )

= ( Infix ( / A B ) - Infix( * C D ) )

= ( ( Infix (A) * Infix (B) ) - ( ( Infix (C) / Infix (D) )

Ans: ( ( A / B ) - ( C * D ) )

II b). Postfix to Infix

1) If E is a variable then Infix(E) = E

2) If E is E1 E2 op then Infix(E) = Infix(E1 E2 op) = Infix (E1) op Infix (E2)

3) If E is (E1) then Infix(E) = Infix (E1)

Example:

Infix( ( A B + ) C + )

= ( Infix(A) + Infix(B) ) + Infix(C)

Ans: ( A + B ) + C

III) Postfix to Prefix Notation Translation for Expressions

• Translation defined inductively as: Prefix(E) where E is an expression

1) If E is a variable or constant then Prefix(E)=E

2) If E is E1 op E2 then Prefix (E) = Prefix (E1 E2 op) = op Prefix (E1) Prefix (E2)

3) If E is (E1) then Prefix(E1) = Prefix(E1)

Example:

a) From Postfix((AB*)(CD/)+)

Prefix ((AB*)(CD/)+)

= + Prefix((AB*)) Prefix((CD/))

= + Prefix(AB*) Prefix(CD/)

= + * Prefix (A) Prefix (B) / Prefix (C) Prefix (D)

Ans: + * AB / CD or (+(*AB)(/CD))

Labels:
Exercise prefix.postfix.infix

Subscribe to:
Posts (Atom)