Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.

Slides:



Advertisements
Similar presentations
CS 1031 Recursion (With applications to Searching and Sorting) Definition of a Recursion Simple Examples of Recursion Conditions for Recursion to Work.
Advertisements

JAVA Coursework (the same for 2A and 2B). Fundamental Information The coursework is 30 marks in your O’Level = 15% of the exam Must be word processed.
Lecture3: Algorithm Analysis Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
Zhang Hongyi CSCI2100B Data Structures Tutorial 2
Dr. Yang, Qingxiong (with slides borrowed from Dr. Yuen, Joe) LT4: Control Flow - Loop CS2311 Computer Programming.
1 Chapter 11 l Basics of Recursion l Programming with Recursion Recursion.
Computer Science 1620 Loops.
Writing and Testing Programs Drivers and Stubs Supplement to text.
Complexity Analysis (Part I)
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
Tirgul 8 Universal Hashing Remarks on Programming Exercise 1 Solution to question 2 in theoretical homework 2.
School of Electrical Engineering & Computer Science
CS107 Introduction to Computer Science Lecture 5, 6 An Introduction to Algorithms: List variables.
Chapter 5: Control Structures II (Repetition)
Simple Recursion. COMP104 Lecture 35 / Slide 2 Recursion: Example 0 * What does the following program do? #include using namespace std; int fac(int n){
Scheduling Master - Slave Multiprocessor Systems Professor: Dr. G S Young Speaker:Darvesh Singh.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
CHAPTER 7: SORTING & SEARCHING Introduction to Computer Science Using Ruby (c) Ophir Frieder at al 2012.
Study Tips for COP 4531 Ashok Srinivasan Computer Science, Florida State University Aim: To suggest learning techniques that will help you do well in this.
1 Project 5: Median. 2 The median of a collection of numbers is the member for which there are an equal number less than or equal and greater than or.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
EGR 2261 Unit 5 Control Structures II: Repetition  Read Malik, Chapter 5.  Homework #5 and Lab #5 due next week.  Quiz next week.
Problem-Based Learning (PBL) Henry Shu-hung CHUNG Department of Electronic Engineering City University of Hong Kong.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
COMP 208/214/215/216 Lecture 3 Planning. Planning is the key to a successful project It is doubly important when multiple people are involved Plans are.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
1 Project Information and Acceptance Testing Integrating Your Code Final Code Submission Acceptance Testing Other Advice and Reminders.
Lecture 10: Class Review Dr John Levine Algorithms and Complexity March 13th 2006.
Analysis of Algorithms
Lecturer: Dr. AJ Bieszczad Chapter 11 COMP 150: Introduction to Object-Oriented Programming 11-1 l Basics of Recursion l Programming with Recursion Recursion.
Welcome to Physics 1D03.
LAB#7. Insertion sort In the outer for loop, out starts at 1 and moves right. It marks the leftmost unsorted data. In the inner while loop, in starts.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
Functions Introduction to Programming By Engr. Bilal Ahmad 1ITP by Engr. Bilal Ahmad.
COMP 208/214/215/216 – Lecture 8 Demonstrations and Portfolios.
The Role of Teaching Assistants. Session outline The Workshop includes four elements: (1)Roles and Responsibilities of Staff (2)Establishing a Professional.
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
IST 210: Organization of Data
CCR Deadlock By: Laura Weiland April 30, Project Description Implement a module to the Train Operating System (TOS) that manages the deadlock problem.
Control of flow We learned that default flow of instructions is sequential. Then, we learned how to control the flow using "if" and "switch." Now, we will.
Chapter 11Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 11 l Basics of Recursion l Programming with Recursion Recursion.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
Before we get started…. First, a few things… Weighted Grading System Programming Style Submitting your assignments… The char and string variable types.
REPETITION STATEMENTS - Part2 Structuring Input Loops Counter-Controlled Repetition Structure Sentinel-Controlled Repetition Structure eof()-Controlled.
Ma123: Fall 2002 Sections Dr. Paul Eakin:Instructor Kyle McCormick:Recitation Leader ( ) Zhiqiang.
Agent program is the one part(class)of Othello program. How many test cases do you have to test? Reversi [Othello]
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
Reading from a file, Sorting, and a little Searching Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics,
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Chapter 15 Running Time Analysis. Topics Orders of Magnitude and Big-Oh Notation Running Time Analysis of Algorithms –Counting Statements –Evaluating.
C++ Programming: CS102 LOOP. Not everything that can be counted counts, and not every thing that counts can be counted. −Albert Einstein Who can control.
Class Introduction IST 210: Organization of Data IST2101.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 23, 2005 Lecture Number: 11.
Introduction to Loop. Introduction to Loops: The while Loop Loop: part of program that may execute > 1 time (i.e., it repeats) while loop format: while.
Introduction to Computer Programming
CS1010 Programming Methodology
Chapter 5: Control Structures II (Repetition)
Intro to Programming Week # 6 Repetition Structure Lecture # 10
Controlling execution - iteration
Engineering Problem Solving with C++, Etter/Ingber
Control Statements Kingdom of Saudi Arabia
Welcome to Physics 1D03.
Let’s all Repeat Together
CS 144 Advanced C++ Programming January 31 Class Meeting
SEMESTER SYSTEM IN B.A./B.Sc. (Hons.)
Programming Fundamental-1
Presentation transcript:

Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal Rekhi Building IIT Bombay Lectures 13, Examples, CS101 group projects at IITB Tuesday 6 July 2010

Overview  The load balancing problem  Course projects in CS 101 at IIT Bombay

Problem of balancing load in two trucks  There are two trucks, each of which contains packages having different weights. We make an assumption that all weights are integers (e.g. 85 Kg, 23 Kg, 7 Kg, etc.).  We wish to balance the load in both the trucks and wish to find out if it is possible to swap exactly one pair of packages between two trucks to achieve this.

Initial thoughts on program design  How should we represent the problem data?  Since we will be required to compare weights of packages from each truck with those in the other, the best way would be to read the respective load values in two arrays  Assuming max no of packages in each truck to be 100, We will use integer arrays A and B of size 100, each will have M and N elements respectively.

What should our program find?  There may exist pairs of elements of the type (x, y) such that; x is an element of A and y is an element of B, and if these are swapped across the arrays, then the resultant arrays will have the property that sum of elements in new array A = sum of elements in new array B  One possible algorithm is to iterate on one array B, and for each element of B, which represents a weight y, find the permissible value of x (how?); and then find if A has an element whose value is x

Program for load balancing #include using namespace std; int main(){ int A[100], B[100], M, N, i, j, sum1, sum2, diff, x, y; // Read numbers in two arrays cin >> M; for (i=0; i > A[i]; cin >> N; for (i=0; i > B[i];

Program for load balancing … // Find sum of all elements of each array sum1 = 0; for (i=0; i<M; i++) sum1 += A[i]; sum2 = 0; for (i=0; i<N; i++) sum2 += B[i]; diff = abs (sum1 - sum2); if (diff%2 !=0) { cout << “Difference of sums is not even”; cout << “Desired elements do not exist”; cout << endl; return 1; }

Program for load balancing … // Now locate the elements meeting the criterion // if x is element of A, and y element of B, // we need to find x and y such that // sum1 +y = sum2 + x // or x = sum1 - sum2 + y // // In general, for some j, // if we are looking at B[j] // then for some I, we must have // A[i] = sum1 –sum2 + B[j]

Program for load balancing … for (j=0; j < N; j++){ // start with some B[j] // Find desired value x x = sum1 - sum2 + B[j]; // search for x in array A for (i=0; i < M; i++){ if (A[i] == x){ cout >> A[i] >> ? ? >> B[j]; } else{ break; // abandon search, } }

Analysis of algorithm If M = N, the problem “size” is N In our program, We have an outer iteration executing N times - every time considering one value from B[] For each outer iteration, - we have an inner iteration also executing N times checking every value in A[] So the complexity of this algorithm is O(N 2 ) - If we search A using binary search, the inner iteration will execute only Log 2 N times Complexity will be O(N log 2 N)

An important Note  Some of us are confusing between the complexity of an algorithm with the time required to execute a specific program, [as seen from the ‘time’ command]  THESE TWO ARE COMPLETELY DIFFERENT THINGS. Thus, there is no notion of reducing ‘complexity’ by, say, 6 seconds  Complexity is ONLY expressed as O(f(N)) [and NEVER as minute or seconds], representing the behaviour of an algorithm as its ‘size’ N becomes very large (tends to infinity)

CS 101 project activities at IIT Bombay  The class was divided into 40 batches Each batch had ~ 20 students Divided into 5 teams  A batch was required to do a single project involving the following Tasks: Task 1 (25%) Programming project Task 2 (10 Marks). Preparation of Quiz and exam questions, along with answers

Programming Projects  Open ended Projects What is to be done is not well defined Team work will mean skewed efforts  But the learning here will be unique and important Learn to take decisions Learn to discuss, design, document  Spend time on deciding Naming conventions File structure, Memory data structures Identify functions, write stubs

Project Groups  There were ten groups: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9  Each group will together work on 4 projects R, C, D, A  Group will have 4 lab batches: Each lab batch will work independently on one project The four lab-batch coordinators together will be responsible for taking decisions on basic data/file design and for common interface definitions

Course Projects  The coordinator for a batch, in consultation with other team leaders, will allocate each of the five ‘activities’ under the project to a team.  Within the team, the team leader will allocate work to individual members. Since the work involves not just programming, but also testing, documentation, data and file management, schedules and meetings, reporting, etc., there is considerable flexibility in the allocation of work

Course Projects... Minimally, every student should write at least one program/function for his/her team, and additionally should carry out at least one common task for the batch/team Each student must maintain a record of the time spent for the project and specific work done in that time. The categorization of nature of the work could be as shown in the next slide

Course projects... Discussions (names of participants, nature of discussion, decisions taken) Design: Data/file/algorithm/function/program Programming Testing/Documentation/Report writing Logistics (maintaining manual records of fingerprints collected, uploading files, CVS work) Miscellaneous

Course Projects...  Each student must submit the diary entries in the form of a common electronic document on a weekly basis.  The format is to be decided by the group. A simple text format, which can be edited using g-edit is recommended. Each lab-batch will count the weekly total of person hours spent by each team of the lab-batch, and by the batch as a whole on the project All individual diary entries for the week, in the form of a single consolidated document is to be submitted to batch JTA (also upload on Moodle)

Submissions  All submissions are due midnight of each Sunday. This is a hard deadline. The submission need not be perfect, it needs to be complete and in time Suggestion: Do not wait for the last minute, target your submission by Saturday midnight Each weekly submission will be include  Consolidated diary-document for the week  Any design/documentation/partial program code/testing/report prepared  All files/directories should be put together in a single tar, and uploaded on the batch Moodle

Submissions and evaluation  Project evaluation 15 Marks for The lab-batch  Each student gets the same marks  Will be evaluated jointly by the batch JTA and te group’s Senior TA 10 Marks for each student based on peer review

Peer review  Perhaps never attempted by any of you earlier Good time to learn  Award Marks out of 10 Based on the quantitative and qualitative contribution by each student  Initial inputs from the team leaders  Scrutiny by the coordination committee of all team leaders from a batch  Finalization in a group meeting where every student defends himself/herself

Peer review  I may choose any two students from a batch and conduct a rigorous viva Examine their diaries in detail asking questions to corroborate the details Ask questions on the specific work they claim to have done Arrive at my own judgment of marks out of 10  If the marks awarded through peer review are significantly higher, then the difference between my marks and those given through peer review will be deducted from the marks of each student of the batch

Sample questions  TEST QUESTIONS : (Batch 1D) QUESTION 1 : Difficulty : Simple Armstrong number is a number wherein the sum of the cubes of its digits is equal to the number itself. Format, abc = a^3 + b^3 + c^3 For e.g, (a) 153 = 1^3 + 5^3 + 3^3 Using the above information, write a program to find all Armstrong numbers between 1 and a given number "n" inputted from the user.

Sample questions … Student1 > #include using namespace std; int main() { int i,n,d,j,sum,flag=0; cout<<"Enter the number upto which armstrong number are to be found"<<endl; cin>> n; cout<< endl<<"The result for Armstrong numbers is : "<<endl;

Sample questions … for (i=1;i<=n;i++) { j=i; sum=0; while( j != 0) { d= j%10 ; sum = sum + (d*d*d); j= j/10; }

Sample questions... if (sum==i) { cout<< i<<endl; flag=1; } } if (flag==0) {cout<< "No Armstrong numbers in this range"<<endl;} return (0); }

Sample Questions... Student2 > #include using namespace std; int main() Student3> FINAL SOLUTION QUESTION 1 : (student1) /* Program to find all Armstrong Numbers between 1 and 'n' (entered) */

Sample questions...  Each lab batch had five teams  Each team prepared one question Total 3 test questions and 2 quiz questions of differing complexity  3 students from each team wrote sample answers, the other 2 selected the final model answer, modified it and submitted

Sample project documentation  Included in files uploaded on workshop moodle

Peer Evaluation TEAM 1 ROLL NO. NAME MARKS Yogesh Kove 09 coding, task, allotment,discussion Prashi Badkur 09 test files and code documentation,discussion Trushna Khivasara 09 test files and code documentation, hepled in coding,discussion Abhijeet Alase 10 "main code developer",discussion,basic algorithm

Peer Evaluation … team Sumit Singh 08 - discussed and make basic algo. and use of "eof“ Radhika Goel 06 - use of "ctime" Soumitra Bag 07 - basic code to read a file Raunak 10 total code and finalise it. ("best work in team 4")

Proposal for next offering of CS101  Continue with the same approach  Increase the weightage of peer evaluation marks from 10% to 20% Last time the class average was 7.3

THANK YOU