Delete array items if repeats more then once, Php
How to remove duplicate values from an array in PHP
$k$ times's draw from $n$ numbers with replacement, each number at least appear once Sample $k$ times with order from $n$ distinct numbers with replacement where $k\ge n$. Here "with order" means the sample is treated like a sequence rather than a set, so results like "1,3,3" and "3,1,3" are different.  The question is what is the probability that every number is sampled at least once? My answer is $1-\frac{{\sum\limits_{i = 1}^n {C_n^i\times i! \times {{(n - i)}^k}} }}{{{n^k}}}$ where $C_n^i$ denotes $n$ chooses $i$.  ${C_n^i\times i! \times {{(n - i)}^k}}$ means first choose $i$ ($i=1,2,...,n-1$) of numbers not to appear in the sample, and then we sample from the remaining $n-i$ numbers for $k$ times.   My question is, is there more elegant solution where the numerator can be directly computed? i.e. can we directly calculate the number of possible sample sequences in which every number has at least one occurrence? Thank you!    PS: my attempt was $C_k^n\times n!\times n^{n-k}$, meaning that we first choose $n$ positions in the sequence of length $k$ to place $n$ numbers, and then permute the $n$ numbers. This is to ensure every number to appear once. The remaining $n-k$ are sampled from the $n$ numbers without restriction.   However, I later found this seems not correct, and it counts the same sequence multiple times.  PS2: as pointed out in the comments, my first answer "1- ..." is not correct either. Responsive Breakpoints? Twitter Bootstrap uses these break points for responsive design:  Large Display: 1200px Default: 980px Tablet: 768px Mobile: 480px  A client said they are using 1280px for their Large Display breakpoint.  Is there an industry standard for these or are they just made up as we go right now? What is the command to minimize the gnome terminal? How can I minimize the Terminal window using a command? For example: I use the clear command to clear the terminal output, which command can I have to use to minimize the terminal window? Group of order $pqr$, $p < q < r$ primes Do I use ext4 for all partitions (such as / and /boot)? What are the other formats used for? I'm installing ubuntu onto a new laptop with 24gb SSD and a 500gb HDD. I wanted to put / and swap onto the SSD and /home onto the HDD. Is there anything I shouldn't use ext4 for?  I do not ever intend to dual boot. Ubuntu only. Problems with Groups in Traminer I'm having a problem using the group function in TraMineR. I have a data set that contains SPELL data, so multiple rows per case. I also have demographic data per case, at one row per case. I merge these together and end up with data that has a demographic covariate per row, so multiple rows per case. An example of this data would be:  id startmin stopmin activity educ4 4      1      20       work    HS 4      20     40       play    HS 8      1      15       sleep   College 8      15     40       work    College   I can make sequence data from this, but when I try to run a plot using the group command        seqiplot(atus.seq, group = atus.seqdata$educ4, border=NA,                 withlegend="right",  cex.plot=.55)   it tells me:       &gt;"Error: group must contain one value for each row in the sequence object".   I have gotten this to work with the example of the mvad data in the training manual, but I can't seem to get it to work with the groups, whether I link to the original demographic data, the merged data, or try to pass the covariates by seqformat and seqdef. Ideas? Low Voltage AC Smoothing Capacitor Calculation I have a 9V AC source which will have a max load of 100mA.  I'm trying to figure the value of a smoothing capacitor with less than a 10% ripple.  I don't have a scope or else I'd just try a bunch out.  I'm just a hobbyist, but I'm trying to understand this.  Since I'm not sure if I'm doing this right, I'll just step through what I've done so far.  First I found this formula: $$V_{ripple}={V_p \over R_LC} \times \Delta T$$  I'm using 60Hz 9VAC that is full wave rectified and I want a 10% ripple so:  $$(9V \times .1)={9V \over R_LC} \times {1 \over 60Hz}$$  I'm calculating my resistive load with Ohm's law. $$R = {9V \over .1A} \quad R = 90 \Omega$$  So plugging that in I get: $$.9V={9V \over 90\Omega \; C} \times {1 \over 60Hz}$$  If I solve for C (admittedly using wolfram alpha), I get: $$C={1\over 540}F \quad C=1851 \mu f$$  1850µf seems pretty high to me...  And if I lower the ripple percent it get crazy high.  Is this the right way to find this?  Or did I screw up somewhere?  Also, my circuit has the capacitor between the full bridge rectifier's positive and negative outputs.  I've only seen this type of smoothing circuit, but maybe my circuit needs to change? Restate theorem in separate file I state a theorem in the main body of a document and prove it in the appendix. I use thmtools's restatable environment to restate the theorem there. However, I now need to have my appendix in a separate pdf file (hence a separate tex document). I'm using xr and xcite to get the cross-references and bibliographical references to play nicely.  But the commands created by restatable are not carried. Is there any way to to the restating of the theorem in the appendix in a separate document?  Here's a MWE:  main document: main.tex  \documentclass{article} \usepackage{thmtools} \newtheorem{theorem}{Theorem}  \begin{document}  \begin{restatable}{theorem}{thmcmd}\label{thmlabel} Here is the statement of the theorem. \end{restatable}  The above is Theorem~\ref{thmlabel}.  In this way I can restate it: \thmcmd*  \end{document}   appendix: appendix.tex  \documentclass{article} \usepackage{xr} \externaldocument{main} \usepackage{thmtools} \newtheorem{theorem}{Theorem}  \begin{document}  I can refer to Theorem~\ref{thmlabel}.  But I cannot restate it like this: % \thmcmd*  \end{document} How to prove that minimum of two exponential random variables is another exponential random variable? How can I prove that the minimum of two exponential random variables is another exponential random variable, i.e. Z = min(X,Y) How do we know for certain that space is expanding? How do we know for certain that space is expanding?  Let's say that in the year 1950, we observe that galaxy 1 is 5 billion light years away from us and galaxy 2 is 10 billion light years away from us, putting both galaxies at a distance of 5 billion light years from each other. Then in 2013, we observe that they are now 7 billion light years away from each other so we conclude space is expanding.  We see that galaxies are move away from each other but how does that prove that space is expanding? Could this illusion of expanding space simply be due to something larger in mass pulling the farther galaxy 2 away from galaxy 1? This larger mass could be accelerating the velocity of galaxy 2 faster then it's accelerating the velocity of galaxy 1. Question from HNQ widget on Android doesn't load, showing last viewed question instead I have found myself in an uncomfortable situation after clicking the Hot Network Question widget.   I click the widget, it opens Stack Exchange app and doesn't refresh. That causes me seeing the question I haven been reading a while ago. Fact is that I haven't killed the app since using it last time.   Is there any known workaround to prevent this bug occurring every time I want to read a question opened from a widget? Killing the app/deleting data every time is not a convenient option.   It happens on all Android devices, so device specs aren't relevant, I guess.   Edit: it isn't reproducible 100% of the time. Sometimes it works. Prove $(a^2+b^2)(c^2+d^2)\ge (ac+bd)^2$ for all $a,b,c,d\in\mathbb{R}$. How can I recover data from a 2TB hard drive? I have a Western Digital 2TB External Hard Drive. I basically use it to keep all my movies and videos. Its file system is NTFS, and currently I'm using 1.4TB. One night I turn it on and copied a 4GB file and there was no problem. Then I tried to copy another 6GB file and Ubuntu throw the following error: "Input/output error". I tried to create a new folder with no luck. I still could read the disk an play a file, so I thought restarting the computer would solve the problem, but it didn't. The next time, Ubuntu didn't mount the disk.   After that I tried in another PC with Window 7. It throwed a message telling me: first, that the disk needs to be formatted, and second, a "Local Disk #: Is not accessible. Data error (cyclic redundancy check)". Here is when I started to worry. I tried to fix the disk with CHKDSK (chkdsk \r). After about 5 hours, it crashed with the following error: "An unspecified error occurred".  My guess to all this is that the disk is dying. :'(  Lastly I did one more thing. I installed GSmartControl on Ubuntu to see the SMART info and the attributes tab appears in red with the following line highlited:  ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE ... 197 Current_Pending_Sector  0x0032   197   197   000    Old_age   Always       -       977 ...   Just to check, I left the disk on for about 2 minutes and then refreshed the page, and the Current_Pending_Sector RAW_VALUE increased from 977 to 979. My guess is that sectors on the disk are dying. Am I right?  If every time I turn on the disk more sectors are going to die, I need to copy the data fast. I don't know if there is a solution on Windows, and I'm worried about the time that it could take to do it with the slowness of Windows. Basically my question is: How can I recover the data? (Or at least some of it). Is there any program on Ubuntu that can help me with this (If I'm still on time)?. My main concern is the size of the disk (2TB), so I think I would need at least another 2TB disk to copy to.  Any help would be appreciated. What does f-stop mean? I was reading a  where the author mentions: "The coefficient of variation is primarily a descriptive statistic, but it is amenable to statistical inferences such as null hypothesis testing or confidence intervals. Standard procedures are often very dependent of the normality assumption and current work is exploring alternative procedures which are less dependent on this normality assumption."  The paper is from 2010. So my question is: has there been any recent "advancements" in terms of a coefficient of variation statistic that is not dependent upon the normality assumption? And, is this what one may call a non-parametric CV? Why is super.super.method(); not allowed in Java? I read  and thought that would easily be solved (not that it isn't solvable without) if one could write:   @Override public String toString() {     return super.super.toString(); }   I'm not sure if it is useful in many cases, but I wonder why it isn't and if something like this exists in other languages.  What do you guys think?  EDIT: To clarify: yes I know, that's impossible in Java and I don't really miss it. This is nothing I expected to work and was surprised getting a compiler error. I just had the idea and like to discuss it. How to remove the URL from the printing page? I want to remove the URL that gets printed on the bottom of the page.   like:  yomari.com/.../main.php?sen_n   How can it be omitted or prevent from getting printed?  To be more specific, is there any way I can prevent the page URL, date and the page title being printed along, while printing the web page? Suppose you have a physical . It is true that as amplitude increases, the period increases. Can we demonstrate this fact without explicitly finding the period (which is pretty involved and pretty messy) in:    an intuitive fashion,  rigorously? Photoelectric effect in a a frequency range I know how to calculate the kinetic energy of the emitted electrons   $$KE=hf-\phi$$  And the number of the emitted electrons, but this is valid for a certain frequency  $$N=\frac{IA}{hf}=\frac{P}{hf}$$  What happens if I have a frequency range? for example between λ1 and λ2?  BTW: It's not homework, I'm an engineering student,  not a physics student Is there a way to force Google Photos to recognize new faces? I have "Face grouping" enabled in my Google account and I can see around 10 faces successfully tagged when I go to my Albums. However, there's a lot of other people who are not tagged, as well as some unrecognized photos of people who are already tagged.   Is there a way to force Google Photos to run the facial recognition algorithm on a given photo, so that it adds new faces or maps a new photo to an existing face?