Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Make a unique filesystem path, without creating the file Date: Tue, 23 Feb 2016 11:33:55 +1100 Lines: 20 Message-ID: References: <85r3gf55k4.fsf@benfinney.id.au> <85mvr26dij.fsf@benfinney.id.au> <87ziusmvi0.fsf@elektro.pacujo.net> <56cb9bb5$0$1595$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de cCFqu3gBx64cApBscfV9fgDmmN+tGXJ5qZ3t+8pREybw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.032 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.01; 'received:209.85.223': 0.03; 'subject:file': 0.07; 'cc:addr:python-list': 0.09; 'expired': 0.09; 'here?': 0.09; '2016': 0.16; '23,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'utterly': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'feb': 0.23; 'header:In- Reply-To:1': 0.24; "doesn't": 0.26; 'chris': 0.26; 'message- id:@mail.gmail.com': 0.27; 'tue,': 0.34; 'received:google.com': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'received:209': 0.38; 'mean': 0.38; 'does': 0.39; 'subject:the': 0.39; 'some': 0.40; 'chance': 0.60; 'here.': 0.62; 'due': 0.65; '50%': 0.79; 'chrisa': 0.84; 'collision.': 0.84; 'paradox': 0.84; 'to:none': 0.91; 'birthday': 0.91; 'heat': 0.91; 'subject:Make': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=DPMdi1whKHqsWf6XBwp6jyJdSExoXoCanoZagMLtdlI=; b=x7kLjEQXHfUA1YCa18sj1itxFj0/RwmThK+S/bTSw8X6biAkLmggdxKZK0NxI6/tko 13wSlkCbVKpxFztK0/V2Uzoii8cpwY70DdYiEJsXwItOaim1ZkNSKpHKv5PR5+cWeO2B a949A5p3RRTaJzv2wqjII8YBPKA4BlHMd9zMDfh12anj5277f2pmbfopjVfSl90hTSX0 QI4YUgJyicEt2gpg0BStI0h7Pu2J+syHrBn1op8rzFve1Ye5u78zOnht5hwW2WH3LL5h +cVCD90MN3rzuWoIDPCFV1X+H9eQaNmiMI+WB54dhTqH8YlwPI2A8ImpNjuqqdZHprp9 OQKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=DPMdi1whKHqsWf6XBwp6jyJdSExoXoCanoZagMLtdlI=; b=ZcZmIfWC/gRKKywRpvAKAdqk4oQbm/RrEVzmGCsW8Q7IFhOiV9xcE/QxrNqVzB6wsU KY6s7eLmUUtO/ESYKhHbvq4coCSq5vc7QEzsYs6dMHxXlCxR7ZChEDH20VchKygA6bOZ PpGdQzpkWxXM/PpWqG3/vi0o1IqO1C5uPZ+w5Gg7/14PD0D/rGMgVAGSJbd4zmAr36o3 7rpg5cp4YZTbFp19mfXlvGp0iprtseJoBAIW5++XWG++p4EZLw+tTuRvpTtl+pwlt4uY UUJRhiKTVSVgFvM70vQmThz+WDw7TQ8NTeFm0Dw+rmlD4boTniQhi9MOTd3x3w7Wv4ld iMwA== X-Gm-Message-State: AG10YOQvbR+41FaOI2xcogXBzjghaC+cznTtov5pq8oIQDa2704Cg4w08hb9vqwrw/pHSQ8DlHH5VWe6IJKLwQ== X-Received: by 10.107.158.20 with SMTP id h20mr9775050ioe.31.1456187635749; Mon, 22 Feb 2016 16:33:55 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103383 On Tue, Feb 23, 2016 at 11:26 AM, Jon Ribbens wrote: > On 2016-02-23, Chris Angelico wrote: >> On Tue, Feb 23, 2016 at 11:08 AM, Jon Ribbens >> wrote: >>>> If you generate 2**128 + 1 such numbers, you are *guaranteed* to >>> >>> ... have expired due to the heat death of the universe. >> >> Maybe... but by the time you get to 2**64 of them, you have a 50% >> chance of a collision. (That's either utterly intuitive or completely >> counter-intuitive, depending on who you are.) > > Um, did you mean to say 2**127? Are you thinking of the > birthday paradox or something, which doesn't apply here? By the time you generate 2**64 of them, you have a 50% chance that some pair of them collides. Yes, the birthday paradox does apply here. ChrisA