how to generate all possible combinations of a 14x10 matrix containing only 1's and 0's

前端 未结 11 993
悲&欢浪女
悲&欢浪女 2021-01-23 23:32

I\'m working on a problem and one solution would require an input of every 14x10 matrix that is possible to be made up of 1\'s and 0\'s... how can I generate these so that I can

11条回答
  •  时光说笑
    2021-01-24 00:06

    I was actually much more pessimistic to begin with, but consider:

    from math import log, e
    
    def timeInYears(totalOpsNeeded=2**140, currentOpsPerSecond=10**9, doublingPeriodInYears=1.5):
        secondsPerYear = 365.25 * 24 * 60 * 60
        doublingPeriodInSeconds = doublingPeriodInYears * secondsPerYear
        k = log(2,e) / doublingPeriodInSeconds  # time-proportionality constant
        timeInSeconds = log(1 + k*totalOpsNeeded/currentOpsPerSecond, e) / k
        return timeInSeconds / secondsPerYear
    

    if we assume that computer processing power continues to double every 18 months, and you can currently do a billion combinations per second (optimistic, but for sake of argument) and you start today, your calculation will be complete on or about April 29th 2137.

提交回复
热议问题