  In device-to-device (D2D) coded caching problems, it is possible that not all
users will make file requests in the delivery phase. Hence, we propose a new
D2D centralized coded caching problem, named the 3-user D2D coded caching with
two random requesters and one sender (2RR1S), where in the delivery phase, any
two of the three users will make file requests, and the user that does not make
any file request is the designated sender. We find the optimal caching and
delivery scheme, denoted as the 2RRIS scheme, for any number of files N by
proving matching converse and achievability results. It is shown that coded
cache placement is needed to achieve the optimal performance. Furthermore, the
optimal rate-memory tradeoff has a uniform expression for N>=4 and different
expressions for N=2 and 3.
  To examine the usefulness of the proposed model and scheme, we adapt the
2RR1S scheme to three scenarios. The first one is the 3-user D2D coded caching
model proposed by Ji et al. By characterizing the optimal rate-memory tradeoff
for the 3-user D2D coded caching when N=2, which was previously unknown, we
show that the adapted 2RR1S scheme is in fact optimal for the 3-user D2D coded
caching problem when N=2 and the cache size is medium. The benefit comes from
coded cache placement which is missing from existing D2D coded caching schemes.
The second scenario is where in the delivery phase, each user makes a file
request randomly and independently with the same probability p. We call this
model the request-random D2D coded caching problem. Adapting the 2RR1S scheme
to this scenario, we show the superiority of our adapted scheme over other
existing D2D coded caching schemes for medium to large cache size. The third
scenario is the K-user D2D coded caching with K-s random requesters and s
senders problem, for which an achievability result is obtained by generalizing
the 2RR1S scheme.
