Find the probability that the equation $[x+y+z]=[x]+[y]+[z]+2$ is true, where $x,y,z \in R$. [.] Represents the greatest integer function.
I got two different answers by two different methods.
1st method: $x=[x]+\{x \}$ etc in LHS, where {} is the fractional part function.
So $[\{x \}+\{y \}+ \{z \}]=2$
So $\{x \}+\{y \}+ \{z \}$ is between $[2,3)$.
All $\{x \},\{y \},\{z \}$ are between $[0,1)$ and are uniformly distributed in this interval.
So if we consider the "expectation" instead of actual probability. The expectation that $\{x \},\{y \},\{z \}$ is between $[2,3)$.
= Expectation that $3\{x \} $ is between $[2,3)$.
= Expectation that ${x}$ is between $[2/3,1)$
$= (1-\frac{2}{3})/1 = \frac{1}{3}$
(Due to uniform distribution of {x}).
Can we call this the final required probability?
Method 2: consider a unit cube with vertices $(0,0,0),(1,0,0),(0,1,0),(0,0,1),(1,1,0),(1,0,1),(0,1,1),(1,1,1)$ and the plane $x+y+z=2$.
The required probability (of $\{x \}+\{y \}+ \{z \}$ is between $[2,3)$). is the volume of the cube cut out of the plane(not including the origin) /volume of cube = volume of tetrahedron with vertices $(1,1,1),(1,1,0),(1,0,1),(0,1,1)$/1 = $\frac{1}{6}$.
Which method is correct (if at all any) and is there any other way to solve this question?
The second method is correct. The first fails because you've improperly applied linearity of expectation.
Linearity of expectation says that, if $X$ and $Y$ are two random variables (if this isn't a term you've come across, don't worry; it means pretty much what you'd think it should), then $$\mathbb E[X+Y]=\mathbb E[X]+\mathbb E[Y].$$ So, one thing you could say is that, since $\{x\}$, $\{y\}$, and $\{z\}$ are all random variables, $$\mathbb E[\{x\}+\{y\}+\{z\}]=\mathbb E[\{x\}]+\mathbb E[\{y\}]+\mathbb E[\{z\}],$$ and then calculate each of the things on the right individually. What you can't do is conflate expectation and probability -- they are different things. Given an event $A$, you can define a random variable $$X=\begin{cases}1&\text{if }A\text{ occurs} \\ 0&\text{if }A\text{ doesn't occur,}\end{cases}$$ and you will get that $\operatorname{Pr}(A)=\mathbb E[X]$, but $X$ and whatever $A$ is measuring are different objects. In particular, if $A$ is the event $$2\leq \{x\}+\{y\}+\{z\}<3,$$ the random variable $X$ you get with the above process is sometimes $0$ and sometimes $1$, but it isn't the sum of anything useful depending on what $\{x\}$, $\{y\}$, and $\{z\}$ are. The random variable $\{x\}+\{y\}+\{z\}$ is the sum of useful things, but you care about $\mathbb E[X]$, not $\mathbb E[\{x\}+\{y\}+\{z\}]$.