• Breaking News

    Sunday, July 14, 2019

    Please somone help me , this is driving me crazy ! Computer Science

    Please somone help me , this is driving me crazy ! Computer Science


    Please somone help me , this is driving me crazy !

    Posted: 13 Jul 2019 08:29 PM PDT

    Can someone please explain to me how the bunch of transistors ( billions of them) are made to understand images and sound and all sorts of info. What i mean is , how does a cpu , which is basically an on off mechanisim and deals with electricity , is programmed to give us pixeles ? ( how do bytes m which are 8 bits , meaning are 8 small transistors with electicity on and off throught them , make a pixels or understand how to create a pixel ?

    submitted by /u/Avaka27
    [link] [comments]

    I wrote a Python visualizer for elementary cellular automata with random initial states that utilizes the Linux framebuffer

    Posted: 13 Jul 2019 07:57 AM PDT

    Rule 120 - Generated by the scipt below.

    #!/usr/bin/env python3 from random import randint XRES = 1024 YRES = 768 BPP = 4 BLACK = 0x000000 WHITE = 0xFFFFFF cells = [None] * XRES clone = [None] * XRES # Random initial state for i in range(XRES): cells[i] = randint(0, 1) # Make the cursor invisible print('\033[?25l') fbdev = open('/dev/fb0', 'wb') for y in range(YRES): for x in range(XRES): state = BLACK if cells[x] == 0 else WHITE fbdev.write((state).to_bytes(BPP, byteorder='little')) # The 3-cell neighbourhood p = cells[x - 1] q = cells[x] r = cells[(x + 1) % XRES] # Any rule in boolean or algebraic form clone[x] = p ^ q & r cells = clone.copy() fbdev.close() input() 

    Overview

    The script is meant to execute in the Linux console with permission to write to the fbdev.

    The result is YRES generations of XRES cells (each either BLACK or WHITE) that evolve according to the given rule.

    If you'd like to try this, first make sure to adjust XRES, YRES, and BPP to match your screen horizontal resolution, vertical resolution, and bytes per pxiel, respectively.

    I originally implemented this in C, but converted to Python to use its list negative indexing feature, which made handling the leftmost cell easier.

    References

    Elementary cellular automata

    Linux console

    Linux framebuffer

    I would love to hear your thoughts!

    submitted by /u/Sawuare
    [link] [comments]

    Unable to get a recurrence relation for this dynamic programming problem

    Posted: 13 Jul 2019 11:40 PM PDT

    I was trying out this DP problem: https://leetcode.com/problems/unique-binary-search-trees/

    I havent been able to figure out the correct recurrence relation here.

    Im trying to figure out how to build a recurrence relation. My idea was: The number of unique BSTs for n ie F(n) = Sum of BSTs with n as root + Sum of BSTs with n as leaf + Sum of BSTs with n as intermediate node.

    The first 2 terms are just F(n - 1) each but Im unable to figure out a formula for the last term

    Specifically for n = 4, (the ACTUAL ANSEWER is 14) the number of BSTs where n is an 'intermediate node' i.e. a node which is neither root nor leaf should be 4, but I can only draw 3: [1,null,4,2,null,null,3] , [1,null,4,3,null,2,null] and [2,1,4,null,null,3,null]

    Is my idea of finding the recurrence relation correct here and am I just missing one BST where 4 is an intermediate node or is the recurrence relation itself wrong?

    submitted by /u/ThiccShadyy
    [link] [comments]

    Outperforming Rust With Functional Programming

    Posted: 13 Jul 2019 11:31 PM PDT

    leela chess PUCT mechanism

    Posted: 13 Jul 2019 09:14 AM PDT

    How do we know w_i which is not possible to calculate using the tree search only ?

    From the lc0 slide, w_i is equal to summation of subtree of V ? How is this equivalent to winning ?

    https://i.redd.it/rpbvbe5di3a31.png

    https://i.redd.it/dsxnua5di3a31.png

    https://i.redd.it/lstpfy5di3a31.png

    submitted by /u/promach
    [link] [comments]

    No comments:

    Post a Comment