On procedures & operations: a dialogue with some basic programming concepts

33
On procedures & operations: a dialogue with some basic programming concepts SM2220 Generative Art & Literature January 23, 2006 Linda Lai

description

On procedures & operations: a dialogue with some basic programming concepts. SM2220 Generative Art & Literature January 23, 2006 Linda Lai. I. Review. 20 th -C art innovations: generative art & literature review of Week 01 discussion. Openness: - PowerPoint PPT Presentation

Transcript of On procedures & operations: a dialogue with some basic programming concepts

Page 1: On procedures & operations: a dialogue with some basic programming concepts

On procedures & operations:a dialogue with some basic programming concepts

SM2220Generative Art & Literature

January 23, 2006Linda Lai

Page 2: On procedures & operations: a dialogue with some basic programming concepts

I.

Review

Page 3: On procedures & operations: a dialogue with some basic programming concepts

20th-C art innovations: generative art & literaturereview of Week 01 discussion

Openness: -Demarcation of art/non-art and the boundary of a work is fluid: stretchable, modifiable, invites participation

Emphasis on Concept-a work of art doesn’t have to be about something in the world out there; it can be about thoughts and abstractions-what is actual what is possible what is virtual

Dematerialized art-Process-oriented-Set of instructions that govern the process of the making of the work

(significance)Role of authorship co-authorship co-creativity

Page 4: On procedures & operations: a dialogue with some basic programming concepts

20th-C art innovations: generative art & literaturereview of Week 01 discussion

Serialism as our first examplePermutation / combination

Repetition / variation

Mind-mapping based on the collaboration of divergent thinking and lateral thinking

AutomatismRule-driven-ness

*Execution / the procedures (today’s emphasis)

Page 5: On procedures & operations: a dialogue with some basic programming concepts

20th-C art innovations: generative art & literaturereview of Week 01 discussion

[#slide 32-33 from week 01]

TWO kinds of generative systems in 20th-C art history (Diane Kirkpatrick):

(1) Closed generative systems:-fixed pool of elements-in each work a closed analytic structure is set up which becomes a generator for exploration

(2) Organic generative systems:A work begins with creating one word or idea and uses that to generate the next, and the next and so on…(creating generators)

Page 6: On procedures & operations: a dialogue with some basic programming concepts
Page 7: On procedures & operations: a dialogue with some basic programming concepts

II

Processes & Procedures…:

Conceptual Structured

Page 8: On procedures & operations: a dialogue with some basic programming concepts

Generating a possible / virtual work

Shifts–

more humanistic input in the creative process ↓conception↓design of rules and procedures

Page 9: On procedures & operations: a dialogue with some basic programming concepts

What is Generative Art?

Generative Art performs the idea as process.

Execution / the procedures

Designing the procedures and the set of instructions becomes the core activities

Page 10: On procedures & operations: a dialogue with some basic programming concepts

Algorithms: procedures in computing

Algorithm is the systematic procedures that computer science adopts to final correct solution to complex problems.

Algorithm is a procedure for solving a problem in terms of:

1) the actions to execute

2) the order in which these actions execute

Page 11: On procedures & operations: a dialogue with some basic programming concepts

Setting workable procedures…

Generative principles ≠ the technical procedures

Sorting out solutions for a problem ≠ doing the actual scripting with a certain programming language

Page 12: On procedures & operations: a dialogue with some basic programming concepts

Algorithms: actions in order

“rise-and-shine algorithm”[source: H.M. Deitel & P.J. Deitel (2005), C++: How to Program 5th edition, p. 121]

(1) Get out of bed

(2) Take off pajamas

(3) Take a shower

(4) Get dressed

(5) Eat breakfast

(6) Drive to workConsider other sequencing possibilities and the qualitative change in

narrative meaning, e.g.:

(1) – (2) – (4) – (3) – (5) – (6)

Page 13: On procedures & operations: a dialogue with some basic programming concepts

Algorithms: actions in order

Setting actions in the right order in a computer program is called program control.

“Structured programming”:Concerned with sequential execution, that is, the execution of statements one after the other in the order in which they are written.

Page 14: On procedures & operations: a dialogue with some basic programming concepts

Actions in order: Structured Programming

Böhm and Jacopini (1960s) demonstrated that all programs could be written terms of only three control structures for sequential execution:

(1) Sequence structure: about succession(2) Selection structure (OR “decision structure”)

if a single selection statement (conditional performance) if…else a double selection statement (conditional performance) switch a multiple selection statement

(3) Repetition structure looping statements OR loops (loop-continuation condition)

for () while () iteration

recursion

Page 15: On procedures & operations: a dialogue with some basic programming concepts

III.

Recursion? Iteration?

preliminaries

Page 16: On procedures & operations: a dialogue with some basic programming concepts

Generating a possible / virtual work

Shifts–

more humanistic input in the creative process ↓conception↓design of rules and procedures

Page 17: On procedures & operations: a dialogue with some basic programming concepts

An illustration of Recursion

Recursion is one class of algorithms

Recursion: the process of solving a large problem by reducing it to one or more sub-problems which are:

(1) Identical in structure to the original problems; and

(2) Simpler to solve

Page 18: On procedures & operations: a dialogue with some basic programming concepts

An illustration of Recursion

How to collect $1000 in a fundraising event in which coupons are printed at $1 per piece:

One way to do it is to find one person who can donate the total amount…

[Source: Eric S. Roberts (1986), Thinking Recursively, pp. 1-4]

Page 19: On procedures & operations: a dialogue with some basic programming concepts

How to collect $1000

One way to do it is to use an iterative solution:

[Pascal-like language]

PROCEDURE COLLECTION 1000; BEGIN FOR 1 := 1 TO 1000 DO Collect one dollar from person I END;

[Actionscript]

For (i=1; i<=1000; i++) operation performedInitial value condition (the loop will continue to execute until the condition is false)

Page 20: On procedures & operations: a dialogue with some basic programming concepts

How to collect $1000: a recursive solution

Principle:

to break down the problem into identical, sub-problems that are simple to solve

Enlist 10 people, each in charge of raising $100.

Each person asked 10 volunteers who will raise $10 each.

Each volunteer will find 10 others who agree to raise $1.

Page 21: On procedures & operations: a dialogue with some basic programming concepts
Page 22: On procedures & operations: a dialogue with some basic programming concepts

How to collect $1000: a recursive solution

The use of recursion here is a “divide-and-conquer” method.

The original problem divides to form several simpler sub-problems, which branch into a set of simpler ones…until the simple cases [the simplest case(s), base case(s)]

Page 23: On procedures & operations: a dialogue with some basic programming concepts

How to collect $1000: recursive solution

[Pascal-like language]

PROCEDURE COLLECTION (N); BEGIN IF N is $1 THEN Contribute the dollar directly ELSE BEGIN Find 10 people; Have each collect N/10 dollars; Return the money to your superior END END;

[Actionscript]

??????

Page 24: On procedures & operations: a dialogue with some basic programming concepts

More illustrations on the use of Recursion

Mondrian-like computer art

1907-1914: Cubism (a modern art movement) flourished in Paris

[nature should be represented in terms of its primitive geometrical components, e.g. cylinders, cones, spheres

etc.]The Cubist community was dissolved at the outbreak of

WWI ideas influenced and shaped the development of abstract art, e.g. works of Piet Mondrian, characterized by rigid patterning of vertical and horizontal lines.

Page 25: On procedures & operations: a dialogue with some basic programming concepts
Page 26: On procedures & operations: a dialogue with some basic programming concepts
Page 27: On procedures & operations: a dialogue with some basic programming concepts
Page 28: On procedures & operations: a dialogue with some basic programming concepts
Page 29: On procedures & operations: a dialogue with some basic programming concepts
Page 30: On procedures & operations: a dialogue with some basic programming concepts
Page 31: On procedures & operations: a dialogue with some basic programming concepts

Iteration? Recursion?

There’s a Hole in the Bucket

There’s a hole in the bucket, dear Liza, dear Liza

There’s a hole in the bucket, dear Liza, a hole

Then fix it, dear Charlie, dear Charlie

Then fix it, dear Charlie, dear Charlie, fix it

With what shall I fix it, dear Liza, dear Liza

With a straw, dear Charlie, dear Charlie

But the straw is too long, dear Liza, dear Liza

Then cut it, dear Charlie, dear Charlie

With what shall I cut it, dear Liza, dear Liza

With a knife, dear Charlie, dear Charlie

Page 32: On procedures & operations: a dialogue with some basic programming concepts

Iteration? Recursion?

There’s a Hole in the Bucket (cont’d)

But the knife is too dull, dear Liza, dear LizaThen sharpen it, dear Charlie, dear Charlie

With what shall I sharpen it, dear Liza, dear LizaWith a stone, dear Charlie, dear Charlie

But the stone is too dry, dear Liza, dear LizaThen wet it, dear Charlie, dear Charlie

With what shall I wet it, dear Liza, dear LizaWith water, dear Charlie, dear Charlie

But how shall I fetch it, dear Liza, dear LizaIn a bucket, dear Charlie, dear Charlie

There’s a hole in the bucket, dear Liza, dear Liza,There’s a hole in the bucket, dear Liza, a hole

Page 33: On procedures & operations: a dialogue with some basic programming concepts

To be continued next week…

*Comparing iteration and recursion

*Generative Grammar, an introduction