my question is about gibbs energy, entropy and all that 
*

*I learnt that Gibbs energy is a free energy to do work! Tell me, what is this free energy and what is the work done (I mean what kind of work). Please also provide me an example of Gibbs free energy, like which energy and what work it is doing.

*Entropy is said to be a measure of randomness in a gas...is there any device which measures randomness in a body? Based on this, the second law of thermodynamics states that it is not possible to have a process in which the entropy of isolated system is decreased - what does this mean?

*Suppose we take a Carnot engine diagram: We will see it is a cyclic process so change in internal energy is zero therefore work done = heat change, so if we take the formula for efficiency as the ratio of work done to the change in heat, we will get 1 which is violating Carnot's theorem that no process can have efficiency 1 - how can that be?
 A: I can answer your points 2 and 3:


*

*2.) If you consider entropy as a chaos factor, then it is easier to grasp. The 2nd law of thermodynamics then says that entropy can only rise (or remain constant) for a process - this means that you can only get more chaos. Fx, if you mix ink into a pool, the water and ink will mix - it will not seperate. This process will always go towards the most chaotic and random state, which is the most mixed state. So actually, this law says something about direction of reactions and processes.
In reality entropy is calculated from the number of possible microstates. These are namely the features that determine chaos. Many possible microstates means many possible outcomes - in other words, more randomness / less knowledge, because we know less about the system if the system can take many different micro-states / more chaos.
A good example is when you flip coins. If you flip four coints, what is the most likely overall outcome? That will be 2 heads and 2 tails. Why? Because this outcome has the most possible "micro-states" (there are many ways to have 2 heads and 2 tails). Similarly, having 4 heads is much more unlikely, because only 1 micro-state gives this result (namely the micro-state where they are all heads). This "process" will always tend towards the state of most micro-states, simply because that is the most propable outcome. Other are possible but unlikely - scale this up to many, many, MANY atoms for example, and it becomes ridiculous unlikely that oxygen and hydrogen will unmix instead of mixing, or that water and ink will unmix instead of mixing or that a tempered room will suddenly become cold in one half and hot in the other half because the temperature "unmixed".

*3.) You are right that for a cyclic process, $Q=W$. But remember here that $Q$ is net heat (and $W$ is net work). In a heat engine, you add heat $Q_H$ to get work $W$ and then cool it down to remove excess heat $Q_C$. See the picture below.
There will always be heat loss as $Q_C$ - just like when water falls from a waterfall and hits a mill-wheel to turn it to do $work$; the water will be slowed down and will move slower below the mill-wheel but it will not stop. There will always be some (kinetic) energy in the water that won't be converted into work (rotation).
So, in reality $Q=Q_H-Q_C$. When you find the efficiency, then always ask "How much work did I get out of the energy that I put in". Efficiency is always usefull energy compared to energy input - wasted energy is skipped. The efficiency is therefore: $\eta = Q_H/W$ and not just $Q/W$.

