I have a standard correlation matrix from an academic paper with means and standard deviations:       mean sd   var1 var2 var3 var1 4.23 1.23 1.00  var2 3.01 0.92 0.78 1.00 var3 2.91 1.32 0.23 0.27 1.00   How can I generate a simulated dataset with a specific N (e.g. 212) using R?
I'm sorry if this seems a bit too basic, but I guess I'm just looking to confirm understanding here. I get the sense I'd have to do this in two steps, and I've started trying to grok correlation matrices, but it's just starting to seem really involved. I'm looking for a concise explanation (ideally with hints towards a pseudocode solution) of a good, ideally quick way to generate correlated random numbers.   Given two pseudorandom variables height and weight with known means and variances, and a given correlation, I think I'm basically trying to understand what this second step should look like:     height = gaussianPdf(height.mean, height.variance)    weight = gaussianPdf(correlated_mean(height.mean, correlation_coefficient),                          correlated_variance(height.variance,                          correlation_coefficient))    How do I calculate the correlated mean and variance? But I want to confirm that's really the relevant problem here.  Do I need to resort to matrix manipulation? Or do I have something else very wrong in my basic approach to this problem?
How to add a user to sudoers file? I have an account named as Chankey (local user). I had to use some commands like viewing the shadow file etc. I tried it using sudo command     sudo vim /etc/shadow   It said:      Chankey is not in the sudoers file. This incident will be reported.   How can I add this user Chankey to the sudoers file? Can graduated Stack Exchange sites get closed too? Unable to send e-mail. Contact the site administrator if the problem persists When my web form is filled and submitted, I get redirected to a page that says:     Thank you for submitting.   but theres a red warning box there that says:     Unable to send e-mail. Contact the site administrator if the problem persists.   I think its the SMTP server, but I don't know how to fix that. I'm attempting to cut a hole in a plane. I added a cylinder object, added the Boolean modifier to the plane, selected "cylinder" and "Difference", but no hole is made. The lower half of the cylinder just highlights, moving/deleting the cylinder reveals a hole-less plane.      How can i cut a hole in the plane? #1115 - Unknown character set: 'utf8mb4' When I Import Mysql from local server to web ser it is showng me error 1115 - Unknown character set: 'utf8mb4' in Creating wordpress wp_comment table CREATE TABLE IF NOT EXISTS  `wp_commentmeta` ( // // ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 AUTO_INCREMENT =1;  #1115 - Unknown character set: 'utf8mb4'  My mysql version is Version information: 4.0.4, latest stable version: 4.4.10 (local version)  Version information: 4.0.10.7, latest stable version: 4.4.10( server version)  Please help me to solve out the error "BAD ARCHIVE MIRROR" error while installing ubuntu server 12.04 I downloaded the server version of Ubuntu from Ubuntu's official site. Created a Bootable USB from the ISO file I downloaded. I connected through Internet using DHCP in the installation process. While I was installing it on my Desktop Computer (pentium D 1 GB RAM) I have this error "Bad Archive Mirror".   I also found 2-3 questions with same problem on forum but I didn't get solution of my problem from them. Trouble enabling Cube surfer addon Every time I have tried to enable the Cube Surfer addon but this error message comes up. FYI I have the correct versions of everything.  I have had this problem with some other add ons as well. Sometimes it's when I have tried to click a button in an addon (after 'successfully' installing) Representing every positive rational number in the form of $(a^n+b^n)/(c^n+d^n)$ About a month ago, I got the following :      For every positive rational number $r$, there exists a set of four positive integers $(a,b,c,d)$ such that    $$r=\frac{a^\color{red}{3}+b^\color{red}{3}}{c^\color{red}{3}+d^\color{red}{3}}.$$      For $r=p/q$ where $p,q$ are positive integers, we can take    $$(a,b,c,d)=(3ps^3t+9qt^4,\ 3ps^3t-9qt^4,\ 9qst^3+ps^4,\ 9qst^3-ps^4)$$   where $s,t$ are positive integers such that $3\lt r\cdot(s/t)^3\lt 9$.      For $r=2014/89$, for example, since we have $(2014/89)\cdot(2/3)^3\approx 6.7$, taking $(p,q,s,t)=(2014,89,2,3)$ gives us $$\frac{2014}{89}=\frac{209889^3+80127^3}{75478^3+11030^3}.$$   Then, I began to try to find every positive integer $n$ such that the following proposition is true :   Proposition : For every positive rational number $r$, there exists a set of four positive integers $(a,b,c,d)$ such that $$r=\frac{a^\color{red}{n}+b^\color{red}{n}}{c^\color{red}{n}+d^\color{red}{n}}.$$  The followings are what I've got. Let $r=p/q$ where $p,q$ are positive integers.   For $n=1$, the proposition is true. We can take $(a,b,c,d)=(p,p,q,q)$. For $n=2$, the proposition is false. For example, no such sets exist for $r=7/3$. For even $n$, the proposition is false because the proposition is false for $n=2$.   However, I've been facing difficulty in the case of odd $n\ge 5$. I've tried to get a similar set of four positive integers $(a,b,c,d)$ as the set for $n=3$, but I have not been able to get any such set. So, here is my question.     Question : How can we find every odd number $n\color{red}{\ge 5}$ such that the following proposition is true?      Proposition : For every positive rational number $r$, there exists a set of four positive integers $(a,b,c,d)$ such that $$r=\frac{a^n+b^n}{c^n+d^n}.$$   Update : I posted this question on .  Added :  asks the case $n=3$. Proof that two basis of a vector space have the same cardinality in the infinite-dimensional case I am having a difficulty setting up the proof of the fact that two basis of a vector space have the same cardinality for the infinite-dimentional case. In particular, let $V$ be a vector space over a field $K$ and let $\left\{v_i\right\}_{i \in I}$ be a basis where $I$ is infinite countable. Let $\left\{u_j\right\}_{j \in J}$ be another basis. Then $J$ must be infinite countable as well. Any ideas on how to approach the proof? Justify text in moderncv cover letter I am writing a cover letter and CV using moderncv. Everything works fine so far, but the text in the cover letter is not justified. I think it is good that it is not hyphenated, but it would look much nicer if the text was justified.  Here is a minimal example:  \documentclass{moderncv} \moderncvstyle{classic}  \usepackage{lipsum} % just for dummy text  \firstname{John} \familyname{Doe}  \begin{document} \recipient{Prof.\ Dr.\ Foo Bar}{} \opening{Dear Professor Dr.\ Bar,} \closing{Yours sincerely,} \enclosure[Attached]{curriculum vit\ae}  \makelettertitle \lipsum[1] \makeletterclosing  \clearpage  \makecvtitle  \section{Education} \cventry{2009--present}{PhD Student}{here}{and}{there}{} \end{document} Is there a place on the internet where I could find actual Star Trek episode scripts? Through the years I have purchased a few Star Trek scripts. I even have a DS9 script a buddy of mine mistakenly took off set and dazzled me with at Christmas years ago. As neat as those are to own, they are impossible to search. Is there a place on the internet where the Star Trek show or movie scripts can be obtained in digital format?  (Sometimes I remember a quote and would love to find it. From time to time the internet delivers. Occasionally it does not. I want to have a resource to find quotes as I think of them.) This is a question from Stromberg related to Steinhaus' Theorem:     If $A$ is a set of positive Lebesgue measure, show that $A + A$ contains an interval.   I can't quite see how to modify the Steinhaus proof though. I know that if the moment generating function of two distribution converges to the same function then the two distribution converges in CDF. But how can we prove this thing explicitly ? I want to upgrade my disk from MBR to GPT, and I tried using Windows' MBR2GPT.EXE tool to do the job. I used Windows' DISKPART tool to identify the disk I want to convert. However, this happened:  C:\WINDOWS\system32&gt;MBR2GPT.EXE /convert /disk:0 /allowfullos  MBR2GPT will now attempt to convert disk 0. If conversion is successful the disk can only be booted in GPT mode. These changes cannot be undone!  MBR2GPT: Attempting to convert disk 0 MBR2GPT: Retrieving layout of disk MBR2GPT: Validating layout, disk sector size is: 512 bytes Disk layout validation failed for disk 0 MBR2GPT: Conversion failed   and the conversion failed. Using Diskpart again, I get the following output:  DISKPART&gt; list disk    Disk ###  Status         Size     Free     Dyn  Gpt   --------  -------------  -------  -------  ---  --- * Disk 0    Online          465 GB      0 B   Disk 1    Online         3841 MB   960 KB  DISKPART&gt; select disk 0  Disk 0 is now the selected disk.  DISKPART&gt; list partition    Partition ###  Type              Size     Offset   -------------  ----------------  -------  -------   Partition 1    Primary            100 MB  1024 KB   Partition 2    Primary            464 GB   101 MB   Partition 3    Recovery           813 MB   464 GB   Partition 4    Recovery           511 MB   465 GB   Looking at the partitions on disk 0, there are 2 primary partitions and 2 hidden ones, I read  that the partitions might have something to do with the conversion failing, so I believe this is the culprit. If anyone could offer help converting my disk, that would be greatly appreciated. Replace a long string with the sed command: Argument list too long error I'm trying to execute this command  sed -i -e "s/BASE_64/$BASE_64/" FILE_NAME   where $BASE_64 is a base 64 representation of a file content.  sed gives me an error since the string is too long.     Argument list too long   How is it possible to avoid this error? How can I get more of this macro photo in focus? I just purchased a D5100 and I am  slowly learning the basics.  I mostly shoot landscape/scenery shots.    I have been trying to capture the full moon unsuccessfully.  It looks focused in the viewfinder and I've experimented with slow shutter speeds and large apertures but the resulting image always comes out as a bright glare.  I'm never able to see the details of the moon.  How can I improve my shots? Can anyone please tell me whether the following function $d:\mathbb{R}^2 \times \mathbb{R}^2 \to  \mathbb{R}$ is really a metric or not on $\mathbb{R}^2$.  $$ d((x_1,x_2),(y_1,y_2))= \begin{cases} |x_1-y_1|, &amp;\text{ if } x_2=y_2\\ |x_1|+|y_1|+|x_2-y_2|, &amp;\text{ if } x_2 \neq y_2. \end{cases} $$  If it really is indeed a metric, please give the proof of triangle inequality.(I'm OK with the other two conditions). How to kill all process with given name? How does one change the Attribute table view on QGIS 3? An initial answer says to use the Switch to Table view button but I can't seem to find this button.