Each of the twelve edges of a cube of edge 'a' is tangent to a sphere. Find the volume of that portion of the cube which lies outside the sphere.

Denote the radius of the sphere to be $r$, and let $O$ be the center of the sphere. Also, let $A$ and $B$ be two vertices of the cube such that $AB$ is a side of the cube. Then, we let $C$ be the foot of the perpendicular drawn from $O$ to $AB$. Notice that right triangle $\triangle AOC$ is a 45-45-90 triangle because $AOC$ is half of a face-diagonal of the cube.

[asy] size(6cm); defaultpen(linewidth(0.4)); import graph; import solids; import geometry; import three; real unit = 1; triple I = (1,0,0), J = (0,1,0), K = (0,0,1); draw(Cube(1)); pair A = draw_circle_baricentre(I+J,K,unit).intersectionpoints(default_circleradius(I+J,K,unit)); pair B1 = draw_circle_baricentre(I,K,unit).intersectionpoints(default_circleradius(I,K,unit)); pair B2 = draw_circle_baricentre(J,K,unit).intersectionpoints(default_circleradius(J,K,unit)); draw(arc(A,K,B1)^^arc(A,K,B2)^^A--B1^^A--B2); draw(I--(I+J)--J^^I--(I+K)--J^^(I+J)--(1,1,1)--(I+K)); draw(Circle(I+J,unit)); D(D((1,1,-1)/3,2/3*unit,fontsize(9pt))); D(D(I+J,fontsize(9pt))); D(D(A,fontsize(9pt))); D(D((I+J)/2,fontsize(9pt))); D(D(B2,fontsize(9pt))); D(anglemark((I+J)/2,(1,1,-1)/3,A,0.6,0.6*size(I+J))); D(anglemark((1,1,-1)/3,(I+J)/2,I+J,0.6,0.6*size(I+J))); draw(I+J--B2^^A--(I+J),dashed); draw_circle_baricentre(I+J,K,unit,linetype("2 3")); [/asy]
It follows that $AO = AC = \frac{a\sqrt{2}}{2}$. Now note that $\triangle AOB$ is a 30-30-120 triangle because $AOB$ is half of a space-diagonal of the cube. Thus, $\angle AOB = 120^\circ$ and $AO = r$. Finally, we have the following equation:

$$\frac{a\sqrt{2}}{2} = r\implies a^3 - \frac{4}{3}\pi \left(\frac{a\sqrt{2}}{2}\right)^3 = \boxed{\frac{a^3\left(3\pi\sqrt{2}-4\right)}{6}}.$$

To find the volume of the portion of the cube that lies outside the sphere, we need to calculate the volume of the cube and subtract the volume of the sphere.

1. Volume of the cube:
The volume of a cube can be calculated using the formula: V_cube = a^3, where 'a' is the edge length of the cube.
So, the volume of the cube is V_cube = a * a * a = a^3.

2. Volume of the sphere:
The sphere is tangent to each of the twelve edges of the cube. Since a tangent line is perpendicular to the radius at that point of contact, the radius of the sphere is equal to half of the edge length, which is a/2.
The volume of a sphere can be calculated using the formula: V_sphere = (4/3) * π * r^3, where 'r' is the radius of the sphere.
So, the volume of the sphere is V_sphere = (4/3) * π * (a/2)^3 = (4/3) * π * a^3 / 8 = π * a^3 / 6.

3. Volume of the portion of the cube outside the sphere:
The volume of the portion of the cube outside the sphere can be found by subtracting the volume of the sphere from the volume of the cube.
V_outside = V_cube - V_sphere
= a^3 - π * a^3 / 6
= a^3 - (π/6) * a^3
= (1 - (π/6)) * a^3
= (6/6 - π/6) * a^3
= (6 - π) * a^3 / 6.

Therefore, the volume of the portion of the cube which lies outside the sphere is given by (6 - π) * a^3 / 6.

To find the volume of the portion of the cube that lies outside the sphere, we need to subtract the volume of the sphere from the volume of the cube.

Let's start by finding the volume of the cube. The volume of a cube is given by the formula V_cube = a^3, where 'a' is the length of the edge of the cube.

Now, let's find the radius of the sphere. Since each of the twelve edges of the cube is tangent to the sphere, we can draw a diagonal from one corner of the cube to another, passing through the center of the sphere. The length of this diagonal is the diameter of the sphere, which is equal to the edge length of the cube. So, the radius of the sphere is r = a/2.

The volume of a sphere is given by the formula V_sphere = (4/3)πr^3, where 'r' is the radius of the sphere.

Now, we can substitute the given values into the formulas and calculate the volume of the cube and the volume of the sphere.

V_cube = a^3
V_sphere = (4/3)πr^3 = (4/3)π(a/2)^3 = (4/3)π(a^3/8) = (π/6)a^3

Finally, we can subtract the volume of the sphere from the volume of the cube to find the volume of the portion of the cube that lies outside the sphere.

Volume outside sphere = V_cube - V_sphere = a^3 - (π/6)a^3 = (6/6)a^3 - (π/6)a^3 = ((6 - π)/6)a^3

So, the volume of the portion of the cube that lies outside the sphere is ((6 - π)/6)a^3.