A sample of an ideal gas is compressed by a piston from 10 m

^{3}to 5 m^{3}and simultaneously cooled from 273 degrees C to 0 degrees C. As a result there is:

A. an increase in pressure

B. a decrease in pressure

C. a decrease in density

D. no change in density

E. an increase in density

**Reasoning**

Density refers to the mass per unit volume. First condition describes the decrease in volume, therefore density increases. Second condition describes the decrease in temperature. Base on kinetic molecular theory, molecules are closer together as energy is removed from the matter. Again, the volume decreases.

**Answer**

E. is the correct answer, stating “an increase in density”.

σ is the Stefan-Boltzmann constant, which is approximately 5.68×10

ɛ is the emissivity of the object’s surface

Freeman also talked albedo (e), and after doing some research online, I found that there is a difference between these two terms.

ɛ (emissivity) is the emissivity of the object’s surface

e (albedo) is the percentage of light energy being reflected away

So if the body is not transparent, ɛ+e should equal to 100% or 1.0.

]]>On CEMC website it recommends the book Programming Challenges by Skiena and Revilla (published by Springer), and honestly this is probably one of few good books that provide abundant algorithm problems and also has brief introduction in C++ and java for each topic. Personally I’m fluent in C and its dialects such as Objective-C and C++, so I find this book extremely helpful. The style of questions (how it’s presented) is similar to that of CCC, where firstly introduction is presented, then input explanation, output explanation, example input and output, and finally (sometimes) example output explanation.

This book serves as an extra resources if you have exhausted all CCC past exams available, or would like to learn about various types of problems before attacking real CCC problems.

The book is available on Amazon.ca currently for around $55, either paperback or Kindle Edition.

]]>– Often implemented by maintaining a queue of vertices to visit

Well.. CCC 2015 is on Feb. 18 so now it’s probably a good time to review all kind of stuff in C++. BFS is an important algorithm for searching paths, and here is how it works.

Pseudocode (CS106B Stanford Lecture note, distributed under CC 2.5 License):

function bfs(v1, v2): queue := {v1}. mark v 1 as visited. while queue is not empty: dequeue a vertex v from the queue. if v is v2: a path is found! for each unvisited neighbor n of v mark n as visited, and enqueue n in queue //if we get here, no path exists.

An implementation in C++ follows (CCC 2008 Senior Problem No. 3, did it quickly probably poor code style):

// // main.cpp // 2008CCC // // Created by Yuhui Li on 2015-02-11. // Copyright (c) 2015 Yuhui Li. All rights reserved. // #include <iostream> #include <fstream> #include <sstream> #include <cmath> #include <vector> #include <queue> using namespace std; struct Coords { int x=0; int y=0; int steps=0; }coord; int main(int argc, const char * argv[]) { ifstream testFile ("/Users/YuhuiLi/Desktop/CCC/s3.5.in"); string line; if (testFile.is_open()) { getline(testFile,line); int numberOfTest =atoi(line.c_str()); for (int i=0;i<numberOfTest;i++) { int row; int col; getline(testFile,line); row=atoi(line.c_str()); getline(testFile,line); col=atoi(line.c_str()); vector<vector<char> >board(row, vector<char>(col)); vector<vector<int> >checks(row, vector<int>(col)); for (int j=0;j<row;j++) { getline(testFile,line); for (int k=0;k<col;k++) { board[j][k]=line[k]; checks[j][k]=-1; } } // BFS queue<Coords> qu; Coords c1; c1.steps=1; qu.push(c1); checks[0][0]=1; bool a = false; while (qu.size()>0) { Coords c = qu.front(); qu.pop(); if (c.x+1==board.size()&&c.y+1==board1.size()) { cout << c.steps << endl; a=true; break; } char ch = board11; if (ch=='-') { if (c.x>=0&&c.x<board.size()&&c.y-1>=0&&c.y-1<board1.size()&&board11!='*'&&checks11==-1) { checks11=1; Coords cc; cc.x=c.x; cc.y=c.y-1; cc.steps=c.steps+1; qu.push(cc); } if (c.x>=0&&c.x<board.size()&&c.y+1>=0&&c.y+1<board1.size()&&board11!='*'&&checks11==-1) { checks11=1; Coords cc; cc.x=c.x; cc.y=c.y+1; cc.steps=c.steps+1; qu.push(cc); } } else if (ch=='|') { if (c.x-1>=0&&c.x-1<board.size()&&c.y>=0&&c.y<board1.size()&&board11!='*'&&checks11==-1) { checks11=1; Coords cc; cc.x=c.x-1; cc.y=c.y; cc.steps=c.steps+1; qu.push(cc); } if (c.x+1>=0&&c.x+1<board.size()&&c.y>=0&&c.y<board1.size()&&board11!='*'&&checks11==-1) { checks11=1; Coords cc; cc.x=c.x+1; cc.y=c.y; cc.steps=c.steps+1; qu.push(cc); } } else if (ch=='+') { if (c.x-1>=0&&c.x-1<board.size()&&c.y>=0&&c.y<board1.size()&&board11!='*'&&checks11==-1) { checks11=1; Coords cc; cc.x=c.x-1; cc.y=c.y; cc.steps=c.steps+1; qu.push(cc); } if (c.x+1>=0&&c.x+1<board.size()&&c.y>=0&&c.y<board1.size()&&board11!='*'&&checks11==-1) { checks11=1; Coords cc; cc.x=c.x+1; cc.y=c.y; cc.steps=c.steps+1; qu.push(cc); } if (c.x>=0&&c.x<board.size()&&c.y-1>=0&&c.y-1<board1.size()&&board11!='*'&&checks11==-1) { checks11=1; Coords cc; cc.x=c.x; cc.y=c.y-1; cc.steps=c.steps+1; qu.push(cc); } if (c.x>=0&&c.x<board.size()&&c.y+1>=0&&c.y+1<board1.size()&&board11!='*'&&checks11==-1) { checks11=1; Coords cc; cc.x=c.x; cc.y=c.y+1; cc.steps=c.steps+1; qu.push(cc); } } } if (!a) cout << "-1" << endl; } } return 0; }]]>

I searched the name of the theme in admin panel but it doesn’t show up in the results. Then with a quick search on Google, I was able to find a svn repository for downloading all themes available to wordpress.com blogs. The link is http://themes.svn.wordpress.org/. To download these, you would need a SVN client, and on mac I recommend SmartSVN.

]]>Through searching one of the problems in Energy Worksheet Package, I arrived at Google Books website, and found this Fundamentals of Physics(see below), and that’s where some of the questions came from. It is a complete set of physics concepts and with abundance of problems. It also has a separate Student Solution Manual where detailed explanation with each step is provided for each problem from the book.

In short, these books are extremely helpful because firstly the textbook talks about physics itself, and also gives practice problems, for which you could find solutions in the study manual.

Things to note:

- The link above is an older edition, the newest currently is the 10th edition.
- These books are college-style, therefore the price range is around $100. But take a step back, Chemistry textbook and study guide together are also around $100.

Visit the problem list at here. Or for plain directory of files, visit here.

]]>I’ve known that Wolfram provides a problem generator, but only available to pro plan subscribers. $3 a month for students is not that big of a deal, but right now I don’t have needs to use it frequently enough so that $3 is actually worth it, I’ll look for some other alternatives.

Then I found this awesome derivative practice generator written by Darryl Nester from Bluffton University Mathematics. It has different difficulty level, which is very user friendly, because most of the time when I try to find problems on the Internet, they are either overly easy, or overly complicated. It also has additional parameters, such as adding e^x, a^x, ln x and trig functions in the given problem. It also offer detailed yet concise description of how to use it, and answer feedback in human readable equation format. If you get stuck on one problem, copy the machine readable equation from the page (probably need to modify some functions so that Wolfram understands it) and solve it in Wolfram or Symbolab.

Overall this generator written in javascript works really well, hope Mr. Fugu won’t give question more nasty than the ones I got from here, for some of them I need to spend time to find common denominator to group up all constants.

]]>This is my final project for Electrical Engineering Course (EE47) at Stanford University during 2014 summer.

An Apple fan, I designed this player for the interest of recreating the design of the original Macintosh 128K. There isn’t really a need that this project is aiming to solve, it’s merely for collection purpose. I won’t be able to buy one anymore, so why shouldn’t I make one myself?

**New! Updated Feb 8 2015**:**Now with illuminated Apple Logo!**

Criteria: View

Source code: https://github.com/yuhuili/BTArduinoMusicPlayer

Documentation:

Video Demonstration:

Schematics (open the image in new window):