X=the number of cards that are drawn until the 1st ace is chosen. Find E[X] Consider a deck of $52$ cards. Let $X$ be the number of cards that are drawn until the first ace is chosen (e.g., if the first two cards are not an ace and the third card is an ace then $X=2$). Find $E(X)$.  Hint: Let $I_j$ denote be the indicator variable that is $1$ if the $j$th non-ace is chosen before the first ace and $0$ otherwise for $j=1,…,48$.  I don't really know how to approach this problem, the hint makes it sound more confusing to me.
Expected value of sums Suppose we draw cards out of a deck without replacement. How many cards do we expect to draw out before we get an ace?
import os xp1 = "\Documents and Settings\" xp2 = os.getenv("USERNAME") print xp1+xp2   Gives me error   File "1.py", line 2  xp1 = "\Documents and Settings\"                                ^ SyntaxError: EOL while scannning single-quoted string   Can you help me please, do you see the problem? Calculate distance of galaxy 13 billion years ago How can I calculate the distance of a point from Earth now vs 13 billion years ago? The excerpt below claims it is 8 times further now. Can someone provide relevant equations ? How to use inotifywait to watch a directory for creation of files of a specific extension I have seen .      You should consider using inotifywait, as an example:  inotifywait -m /path -e create -e moved_to |     while read path action file; do         echo "The file '$file' appeared in directory '$path' via '$action'"         # do something with the file     done    My question is that, the above script watches a directory for creation of files of any type, but how do I modify the inotifywait command to report only when a file of certain type/extension is created (or moved into the directory) - e.g. it should report when any .xml file is created.  WHAT I TRIED:  I have run the inotifywait --help command, and have read the command line options. It has --exclude &lt;pattern&gt; and --excludei &lt;pattern&gt; commands to EXCLUDE files of certain types (by using regEx), but I need a way to INCLUDE just the files of a certain type/extension. What's the difference between "it excites me" and "that excites me"? How to create a separate subnet for wireless access? I need to configure my wireless router so all wireless devices are on a different subnet (192.168.2.1).  The wireless devices should be able to access the internet, but ideally not the workstations on the LAN.  Here is my network:    All suggestions welcome! I work at an embedded software company. This morning I found a USB stick in the parking lot in front of the building. With all the stories of "dropped USB stick attacks" in mind, I'm obviously not going to just plug it into my laptop. OTOH, I'm curious to know whether this was actually an attempt to compromise our systems, or it's really just an innocent case of somebody accidentally losing a USB stick. How do I safely inspect the USB stick without risking exposure?  I'm worried not just about malware and crafted file system images; there's also stuff like power surge attacks:.  EDIT: Many of the answers seem to assume I want to keep the drive and use it afterwards. I have no interest in that at all, I know USB sticks are cheap, and that it wouldn't be mine to keep anyway. I only want to know whether this was indeed a semi-targeted attack, partly out of curiosity whether this actually happens in real life and not just in security papers, but also so that I could warn my coworkers.  I want to know how I would figure out whether the stick contains malware. And that's not just a matter of looking at the drive contents and seeing a suspicious autorun.inf or a carefully crafted corrupt file system - I very much also want a way to inspect the firmware. I sort-of expected that there were tools for extracting that and comparing to known-good or known-bad binaries. Possible Duplicate:          I would like to use round parentheses () instead of square brackets [] for citations in a document that I'm working on.   I figured out how to get them in the text using the round option with natbib.  I can't figure out to have the generated bibliography to show () instead of [] when it lists the references.  What do I need to change to fix the way it formats the bibliography? What is the fallacy that privileges one person over another? I see this a lot, someone in a category of people attempts to shut down anyone with an opinion that is not from the same category. For example, people without children weighing in on parenting; the parent may say something like "well, since you don't have kids and I do, my position is of more validity than yours."  Another example: a drug user (of some kind) telling someone who has never done drugs and does not care to, "until you tried it, you have no right to judge me."  People frequently try to limit the consideration on opinions to those in their same group, while it is perfectly reasonable that the non-drug user, especially if they are a chemist or well read on the subject, may have an equally valid opinion, or even more valid. In fact some might even say that someone NOT in the category has a better chance of being objective and seeing the forest for the trees.  So what is the fallacy of trying to shut down opinions when the source of the opinion is not someone who has personally had the experience under discussion? Do I have an SSD and a hard drive on my MacBook Pro? I looked at the details provided in  my system report/storage and I noticed that it appears I have a hard drive of 499.05GB and an additional SSD drive of 499.42GB. Does this mean I have 1TB of data? I only have 139GB available so do I have 500GB 'hiding' somewhere? (If so where??)  I am unsure how to interpret this information- why does it list both storage types? Is it duplicating the information?     Macintosh HD:      Available:    139.8 GB (139,800,666,112 bytes)   Capacity: 499.05 GB (499,046,809,600 bytes)   Mount Point:  /   File System:  Journaled HFS+   Writable: Yes   Ignore Ownership: No   BSD Name: disk1   Volume UUID:  EF0908C8-XXXX-XXXX-XXXX-XXXX80333709         Logical Volume:  Revertible:  Yes (unlock and decryption required)   Encrypted:    Yes   Encryption Type:  AES-XTS   Locked:   No   LV UUID:  8CC9C88D-XXXX-XXXX-XXXX-XXXX2002329B        Logical Volume Group:   Name:    Macintosh HD   Size:    499.42 GB (499,418,034,176 bytes)   Free Space:  18.9 MB (18,903,040 bytes)    LVG  UUID: EE040070-XXXX-XXXX-XXXX-XXXXA83B309         Physical Volumes:      disk0s2:     #is this a second disk?      Device Name:  APPLE SSD SM0512G   Media Name: APPLE SSD  SM0512G   Media   Size:   499.42 GB (499,418,034,176 bytes)   Medium Type:  SSD    Protocol:  PCI    Internal:  Yes   Partition Map Type: GPT(GUID Partition Table)  #does this mean its partitioned?   Status: Online   S.M.A.R.T. Status:  Verified   PV UUID:    A1391405-XXXX-XXXX-XXXX-XXX2E8FCDF3 Sequences or 'chains' of adjoint functors Suppose we have (some categories and some functors such that) $F_1$ is left adjoint to $G_1$, $G_1$ left adjoint to $F_2$, $F_2$ left adjoint to $G_2$. Will $F_1$ then be equal to $F_2$ (and $G_1$ to $G_2$)?  Or can there exist arbitrarily long 'chains' of adjoint functors that do not trivialize? Set of limit points of a subset of a Hausdorff space is closed. Let $X$ be a Hausdorff space and $A\subset X$.  Define $A'=\{x\in X\mid x\text{ is a limit point of }A\}$.  Prove that $A'$ is closed in $X$.  Relevant information:  (1.) Every neighborhood of a point $x\in A'$ contains a point $y\in A'$ distinct from $x$ (in fact, in a Hausdorff space, every neighborhood of $x$ contains $\infty$-many points of $A$ distinct from $x$)  (2.) In a Hausdorff space, every sequence has a unique limit.  On first glance, it should be an easy proof, but I've made little progress.  I was planning on showing $\overline{A'}=A'$.  Firstly, $A'\subset \overline{A'}$ trivially.  To show $\overline{A'}\subset A'$, proceed by contradiction.  Assume there exists $x\in\overline{A'}$ such that $x\not\in A'$.  This should yield an easy contradiction but I don't see it.  In particular, I'm unsure if the fact that $x\in\overline{A'}$ implies that there actually exists a sequence in $A'$ converging to $x$.  By (2) we know all sequences have unique limits, but do we know that elements in the closure are limits of sequences?  If this is true, it should yield an easy contradiction.  Any help? Carrying a handgun in other countries with a US concealed carry permit How do I call one constructor from another in Java? Is it possible to call a constructor from another (within the same class, not from a subclass)? If yes how? And what could be the best way to call another constructor (if there are several ways to do it)? getting exception while putting list data into the map I am wondering whether there is a bulletproof way to know if one is successful in decrypting a file.   As an example, say I encrypt a text file and protect it with a 3 letter password. I use brute force to decrypt it, but two different passwords lead to a file that contains English intelligible text. Is there a way for me to know which one is the original one? In other words, is there an infallible way to know I've entered the password correctly? Problem with IMPORTRANGE function in Google Sheets I’m trying to get IMPORTRANGE to work for me with no success. I made two simple spreadsheets:  and . In the destination sheet I’m using the import range function:  =importrange(“1-5F1_zz0ZpGj7SfeQhewsCe0CsrA0eyPbjfmUrLBsyk”,”Sheet1!a1:a1”)   I tried already:   Replacing the , with ; Referencing just the key as well as the full URL in the first argument Switching from “ to ‘ With the sheet name and without it   Not sure what else to do.  Any ideas? How do I create a PPA? How do I create my own custom PPA to share with the Ubuntu community? I am trying to create my own custom package set and I would really like to share it with the community. The Safari Back Button Problem I do some minor programming and web work for a local community college. Work that includes maintaining a very large and soul destroying website that consists of a hodge podge of VBScript, javascript, Dreamweaver generated cruft and a collection of add-ons that various conmen have convinced them to buy over the years.   A few days ago I got a call "The website is locking up for people using Safari!" Okay, step one download Safari(v3.1.2), step two surf to the site. Everything appears to work fine.  Long story short I finally isolated the problem and it relates to Safari's back button. The website uses a fancy-pants javascript menu that works in every browser I've tried including Safari, the first time around. But in Safari if you follow a link off the page and then hit the back button the menu no longer works.  I made a pared down webpage to illustrate the principle.  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt; &lt;html&gt; &lt;head&gt;&lt;title&gt;Safari Back Button Test&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt; &lt;/head&gt; &lt;body onload="alert('Hello');"&gt; &lt;a href="http://www.codinghorror.com"&gt;Coding Horror&lt;/a&gt; &lt;/body&gt; &lt;/html&gt;   Load the page and you see the alert box. Then follow the link off the page and hit the back button. In IE and Firefox you see the alert box again, in Safari you do not.  After a vigorous googling I've discovered others with similar problems but no really satisfactory answers. So my question is how can I make my pages work the same way in Safari after the user hits the back button as they do in other browsers?  If this is a stupid question please be gentle, javascript is somewhat new to me. How are echo and print different in PHP? Possible Duplicate:          Is there any major and fundamental difference between these two functions in PHP? How do you read CSS rule values with JavaScript?