Take the challenge: compute the CO 2e emissions of your programming course

Sustainability constraints ask for quick and drastic changes in the ways to teach at university. Here we study the amount of carbon emissions of lecturing a first course in programming. In addition to fix costs estimations, our study relies on a pool on student mobility patterns at our university. We estimate, per campus and level of presentiality, the amount of CO 2e emissions of the course. Our results show that the main contributed cost of the course is not always due to transportation. Indeed, the difference in emissions between virtual and face-to-face is not huge and in some cases face-to-face is even better. This offers a discussion about the convenience of replacing face-to-face by virtual teaching through minimizing transportation emissions. We claim that the former can be made CO 2e competitive by disseminating the lectures across the city avoiding the use of costly traveling means.


Introduction and Methodology
As it is well known, the recent coronavirus pandemic caused drastic changes in Universities. The most important one was having to transform teaching from face-to-face to online in record time. The change had various consequences, some positive and others not so much. Among the positive ones we find the beneficial impact on the environment thanks to reducing CO2e emissions due to transport mainly in large cities. Of the refusals, there is talk above all of the serious impact of confinement and online teaching on the mental health of young people mainly due to the lack of socialization and movement [Sahu (2020)]. As a consequence of this facts there is a growing discussion on the necessity of rethinking the teaching methodology at the university level moving from traditional face-to-face teaching to complete online teaching through virtual meetings. One of the benefits of a pure online teaching model is the possibility of implementing the so called Distributed university [Heller (2022)] in which a distributed effort to design the online courses could be used. Another one is to reduce traveling time which reverts in less CO2e emissions.
In this paper, we provide a first study analyzing the teaching design among both extremes (totally online versus totally face-to-face) taking into account the environmental impact of the implementation of the course. For doing so we take as a base for our study the PROGRAMMING1 course (PRO1) of the Barcelona School of Informatics (FIB) at the Universitat Politècnica de Catalunya (UPC).
In order to estimate the total carbon emission, we separate the estimation in two parts on one side we estimate the carbon emissions due to teaching and on the other the ones due to transportation. For the first estimation, we take a coarse-view to the main carbon emission sources involved in the teaching, we identify the following ones: • Computer Usage: a running computer can generate between 52 and 234 gCO2e/h. • E-mails: It depends on the size of the message and how large the attachments are. It oscillates between 4 gCO2e (no attachments), to 19 gCO2e (single simple attachment), up to 50gCO2e (large multiple attachments, e.g., images) (eCo2greetings). • Cloud Storage: The data centers' electricity consumption represents a total emission of 97 MT (million tonnes) of CO2e a year [Masanet et al. (2020), Obringer et al. (2021)]. • Virtual Meetings: As for a quite standard video meeting, we could assume a 1-hour time, 25 people in it, with HD 1080p video quality. That would emit around 210 gCO2e according to Zoom emissions' calculator. Turning off the camera, lowering the streaming quality and having small groups reduces the environmental footprint of the meetings drastically (up to by 96% [Obringer et al. (2021)]). Among the previous sources, we considered only computer usage and virtual meetings. The main data centers' suppliers (i.e., Google and Microsoft) declare themselves as carbon neutral companies and are rapidly moving to buy renewable energy to match all their energy usage.
In view of that, we did not consider this source of emissions. The amount of paper in teaching is very small and thus can be neglected. It is difficult to measure the e-mail traffic, however in our experience the volume of e-mails due to teaching has been similar in face-to-face and online teaching; therefore, we did not take it into account.
The second source of carbon emissions is transportation. An average European car emits around 120.4 gCO2e/km, a local bus around 82 gCO2e/km and the underground 14 gCO2e/km, approximately (European Environment Agency). These values have to be averaged by the number of people traveling together. Nevertheless, figuring out the particular transportation patterns of the students is not easy. In recent years, the UPC has given increasing importance to the sustainability of its studies and infrastructures. Taking advantage of its scientific and technical nature, and as a preliminary need to make strategic operational decisions that adapt to the future, the UPC is carrying out very interesting studies in this regard (UPC Sostenible). One of them is a study on the carbon footprint of student transportation to its different campuses [Zamata Romero (2020)]. UPC campuses are distributed throughout the province of Barcelona, but they are of different sizes and are located in cities of different size, connectivity and importance. It can be seen from the study that there are big differences in the transportation patterns (and consequent carbon emissions) of the different campuses. We analyze the carbon emissions due to student mobility when face-to-face teaching is done in one of the UPC campuses.

Case of Study: PROGRAMMING1 at FIB-UPC
The PRO1 course for the Bachelor Degree in Informatics Engineering at FIB-UPC receives each semester around 700 students. It is a 7.5 ECTS course, consisting in 5 hours of lessons per week (2-hours theory with 60 students/group, plus 3-hours lab with 20-22 students/group), plus approximately 7 hours of autonomous study. The course has two midterm exams and a final exam. Every exam runs for 2 hours in a lab classroom (with a PC for each student). The UPC dedicates around 20 lecturers for covering all the teaching necessities of PRO1 and two of them take also care of the coordination. Our estimations assume that all students attend all lectures. The results can be easily tuned to the adequate abstention percentages, when it is the case.
In order to calculate the cost in CO2e emissions of this course, we identify the elements that are involved in its production for each type of lecture and use the power consumption calculators at Energuide and DisplaySpecification websites. Let us start with the lab sessions, where every student (and lecturer) uses a PC for working [Adán Navarro (2020) We are not considering the costs of heating/cooling classrooms since this data is difficult to estimate and, moreover, one can consider that it is probably quite equivalent to the costs incurred by heating/cooling private homes when working 100% virtually. We consider the differences in cost for the theory sessions with respect to the lab sessions: • PCs and Monitors: now only one for the lecturer that consumes about 150 Wh.
• Laptops and Tablets: we observed that at most 20% of the students at FIB-UPC use an electronic device to take notes during the theory lesson; so, assuming that 10 out of 60 do that, that represents a consumption of 800 Wh. Gathering all together, a 1-hour lab class (for 20 students) at FIB-UPC consumes around 3670 W, while a 1-hour theory class (for 60 students) consumes about 2020 W. Thus, every 3-hours weekly lab session of PRO1 requires about 11 kW (2.85 kgCO2e, considering that a kWh produces 259 gCO2e) and every 2-hours weekly theory session of PRO1 uses approximately 4 kW (1 kgCO2e).
The 700 students enrolled in the course are organized in 12 groups for the theory lessons, and in 35 groups for the lab sessions. Thus, the total approximated carbon footprint of the PRO1 lessons for those 700 students sum up to 112 kgCO2e per week. Multiplied by 15 weeks, that represents an approximated total emission of 1680 kgCO2e per semester (that we approximate as 1.7 mt -metric tonnes -). Please note that these costs do not include transportation, which we take care of in the next section.

Different Scenarios at the UPC Campuses
In what follows we calculate the costs in CO2e emissions of two opposite (in terms of transportation costs) models of lecturing: completely face-to-face and completely virtual.
Face-to-face Model: Many of the big Universities in the world are placed in big cities since it is an easy way to maximize the number of students that have the university relatively near from home. Depending on the cities, these Universities are sometimes placed in huge campuses (where everything is centralized) or they may have its schools and faculties distributed within the city.
There is also a type of distributed model of big university in which the campuses are around the big city, placed in smaller cities that have a good transport connection with it. One of the big problems with this model is the high daily traveling distance of many of the students, since they use to live in the big city or in other smaller cities close to it. Cities are too close to each other to make students change their living place, but too far to avoid carbon-producing transportation. This is the case of the UPC that is distributed across the province of Barcelona and structured in big and medium-size campuses. The bigger concentration of students is to be found at the combination of Campus Nord plus Campus Sud, which are both placed at the SW-border of Barcelona (at one end of the 50-meters wide grid-crossing Diagonal street in Barcelona). At the opposite NE-end of the Diagonal, 12 km away from the Campus Nord and Campus Sud, there is the medium-sized Diagonal-Besòs campus. UPC has other mediumsized campuses in smaller cities like Terrassa and Vilanova i la Geltrú.
As currently designed, students are enrolled to a specific campus and do not have to move through several campuses. However, lecturers might teach in different campuses on the same day with the corresponding impact in fatigue, time consumption and CO2e emissions due to their mobility (even if this is not significant in comparison with the travel emissions due to all the students). As an example of this let us note that a lecturer that teaches both at Campus Nord and at Campus Diagonal-Besòs on the same day, needs more than one hour by (probably highly-crowded) bus to travel from one campus to the other (even that both campuses are inside the same city, Barcelona).
Coming back to our PRO1 course, let us calculate, in terms of CO2e emissions, the cost of transportation of the 700 students of the course to each of the UPC campuses. Just to attend our PRO1 course, each student needs to move to campus twice a week (one day for the theory lessons and one day for the lab sessions); this makes 4 trips a week, which for the 15 weeks of classes it is a total of 60 trips per student. Multiplied by the 700 students of the course, it represents a total of 42000 trips.
In order to have the corresponding impact on CO2e emissions of the total amount of trips per campus, we multiply this amount by the average distance of trip per person by campus and the cost in CO2e emissions per kilometer per person per campus. The obtained results are shown in Table 1.
To obtain the total number of emissions due to the PRO1 course as if it were given at a particular campus it suffices to sum the total emissions due to the transportation of the students to the emissions calculated in previous section (around 1.7 mt -metric tonnes -) where only the transportation cost was missing.
Virtual Model: Under this model, students and teachers work completely remotely from somewhere outside the university, typically at home. A number of traditional Universities also offer nowadays an online option for students who wish to pursue a degree but cannot attend courses in a traditional classroom setting. The virtual university model uses the Internet to deliver classes and seminars. As we already mentioned, this is optimal in terms of transportation costs but it is not optimal in students' achievements and mental health [Son et al. (2020), Sahu (2020)]. In order to calculate the total cost of the course in a pure virtual model we consider as fixed cost the around 1.7 mt (metric tonnes) of CO2e calculated previously. This is a simplification, since we consider that the cost of lighting a classroom of 60 students is almost equivalent to the up to 60 home-spotlights used virtually, we also consider that the cost of the projector plus the air purifiers and others might be, roughly, similar to the cost of using personal computers, laptops, cell phones or tablets to view the zoom transmission during theory lectures. Considering that an hour of virtual meet for a group of 25 students contributes with 210 gCO2e, the five hours per week along the 15 weeks of the course for the 28 required groups we obtain a total of 441 kgCO2e. The total is about 2 mtCO2e.

Conclusions and Further Work
On-line working, climate change and associated health problems (both mental and physical) are today trending topics. University has to be aware of that. University studies need to be redesigned to deal with this new reality. To do that, more data and more models should be developed. This work is a step in this direction. Our study quantifies in terms of CO2e emissions the cost of lecturing the PRO1 course in the different UPC campuses. The results of our study show that, in terms of CO2e emissions, transportation is in some cases competitive with on-line teaching. The total amount of CO2e emissions of the PRO1 course at FIB-UPC is of about: • 1.7 mt (metric tonnes), without taking transportation into account.
• 0.5 mt are strictly due to virtuality. This is similar of the amount of CO2e due to transportation of the Campus Baix Llobregat and -surprisingly-some campuses (such as the Campus Nord and the Campus Diagonal Sud, for instance) are more efficient in CO2e emissions than the fully virtual version of the course.
We can observe that the campuses with highest CO2e emissions per km, Nautica and Sant Cugat, are small campuses, below 800 students, offering quite specialized studies. The campuses with highest total CO2e emissions, Vilanova and Manresa, are the ones with largest transportation time. They are located in small cities at around 50 Km from Barcelona. The other campuses are located inside the city of Barcelona and the average CO2e emissions show that their students reach the university mostly by low emissions public transportation.
We can draw from our studies some ways to reduce the carbon emissions due to lecturing. In those cases, with costly travel, a balance among face-to-face and on-line teaching together with improvement on the public transportation will reduce emissions.
Complete on-line teaching has relevant drawbacks on mental health and sociability as it was observed in [Sahu (2020)] and therefore it should be avoided or tuned. On the other hand, as we see it, it makes no sense that every day, a student takes private transportation to travel for about 45 minutes to go to university. With the city design in mind, we envisage a model of university that tries to avoid the transportation cost by "spreading" the university across the city. We advocate for a solution having campuses distributed in the different neighborhoods of the city in a similar model to the one of undergraduate schools agreeing with the general design principles of the 15 minutes city planning [Moreno et al. (2021)]. With this idea in mind it should be possible to place university at most at 15 minutes walking distance from students and (in most cases) lecturers' homes. The university could re-use and share existing infrastructures like civil centers for instance which in general are underused and improve on the assignment of students to campuses. In the case of late afternoon lectures schools could be reused. It makes no sense to duplicate to infinity expensive technical labs. To allow the students to work with expensive technical material they can be asked to go where those labs are placed, in general the big campuses, but only once a week or every two weeks, depending on the course, the lab, the specific topic, etc.
The data in which the present study is based corresponds to the first pool on mobility launched by our university. Due to this fact, the level of participation, especially in some smaller campuses, was low. We expect, that in the forthcoming pools participation will improve. We plan to perform a comparative study as soon as new data is available.
We are working towards devising a model quantifying other aspects involved in the learning process with regard to sustainable development goals. In particular, we want to relate the learning effort and (a quantification of) the well-being with a teaching paradigm that considers a combination of face-to-face and virtual lessons. As our goal is a medium-sized macroscopic approach because we are not interested in countries but in university campuses. One line of work is to ground the model in the Cobb-Douglas production function [Cobb et al. (1928), Jones (2002], that measures the GDP production of a country in terms of the capital and the labor.