I perceive two main challenges with the first table:
To meet these challenges, I suggest you employ (a) a tabular* environment whose width is set to \textwidth and (b) a \multicolumn directive, as is done in the code below. Incidentally, I would right-align rather than left-align the numbers.
A third challenge could be how to render the entire tabular material with a light-gray background. In the code below, I've used the technique proposed in this answer to address this challenge.
Regarding the second table, I'd say it's not right to set up the numeric material as a (mathematical) matrix surrounded by curly braces. What's far more important is to line up the header cells with their corresponding columns. Separately, I'd also say that it's important -- for the sake of legibility -- to align the numbers on their respective decimal markers. I would therefore use a tabular environment along with the S column type of the siunitx package for the four "real" data columns.

\documentclass{article}
\usepackage{booktabs,siunitx,xcolor}
\definecolor{lightgray}{gray}{0.85} % define a suitable version of "light gray"
\newcommand\mytab[1]{\smash{%
\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}}
\begin{document}
\noindent
\begingroup % localize scope of next two instructions
\setlength\tabcolsep{0pt} % make LaTeX figure out inter-column whitespace
\setlength\fboxsep{0pt} % see https://tex.stackexchange.com/a/63897/5001
\colorbox{lightgray}{%
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} *{17}{r}}
\toprule
\multicolumn{6}{@{}l}{Process ID: 3939}\\[0.5ex]
105 & 104& 104& 106& 105& 104& 104& 106& 105& 104& 104& 106& 5& 4& 5& 5 &0 \\
40 & 41 & \dots \\
3 & 3 & \dots \\
3 & 12 & \dots \\
\bottomrule
\end{tabular*}}
\endgroup
\bigskip
\begin{center}
\begin{tabular}{@{}c *{2}{S[table-format=1.3]}
c *{2}{S[table-format=1.3]} @{}}
\toprule
\mytab{Distinct\\System Call} &
\multicolumn{5}{c}{Trace} \\
\cmidrule(l){2-6}
& {1} & {2} & & {$m-1$} & {$m$} \\
\midrule
1 & 0.051 & 0.055 & \dots & 0.049 & 0.051 \\
2 & 0.122 & 0.125 & \dots & \\
&{\vdots}&{\vdots}&{\vdots}& \\
155& 0.101 & 0.1 & \dots & \\
167& 0.03 & 0.03 & \dots & 0.02 & 0.03 \\
\bottomrule
\end{tabular}
\end{center}
\end{document}
\documentclassand ends with\end{document}. Related question https://tex.stackexchange.com/a/63887/124842 (first question), https://tex.stackexchange.com/a/130799/124842 (secondquestion) – Bobyandbob Jul 01 '17 at 13:26