python_data_scien/algorithmic_thinking1/application1.py
def run_trial(self, num_nodes):
        """
        Conduct num_node trials using by applying random.choice()
        to the list of node numbers
        
        Updates the list of node numbers so that the number of instances of
        each node number is in the same ratio as the desired probabilities
        
        Returns:
        Set of nodes
        """
        
        # compute the neighbors for the newly-created node
        new_node_neighbors = set()
        for dummy_idx in range(num_nodes):
            new_node_neighbors.add(random.choice(self._node_numbers))
        
        # update the list of node numbers so that each node number 
        # appears in the correct ratio
        self._node_numbers.append(self._num_nodes)
        self._node_numbers.extend(list(new_node_neighbors))
        
        #update the number of nodes
        self._num_nodes += 1
        return new_node_neighbors

        Conduct num_node trials using by applying random.choice()
        to the list of node numbers
        
        Updates the list of node numbers so that the number of instances of
        each node number is in the same ratio as the desired probabilities
        
        Returns:
        Set of nodes
        
Conduct num_node trials using by applying random.choice()
to the list of node numbers

Updates the list of node numbers so that the number of instances of
each node number is in the same ratio as the desired probabilities
Conduct num_node trials using by applying random . choice () to the list of node numbers Updates the list of node numbers so that the number of instances of each node number is in the same ratio as the desired probabilities
def run_trial(self, num_nodes):
        new_node_neighbors = set()
        for dummy_idx in range(num_nodes):
            new_node_neighbors.add(random.choice(self._node_numbers))
        self._node_numbers.append(self._num_nodes)
        self._node_numbers.extend(list(new_node_neighbors))
        self._num_nodes += 1
        return new_node_neighbors
def run_trial ( self , num_nodes ) : new_node_neighbors = set ( ) for dummy_idx in range ( num_nodes ) : new_node_neighbors . add ( random . choice ( self . _node_numbers ) ) self . _node_numbers . append ( self . _num_nodes ) self . _node_numbers . extend ( list ( new_node_neighbors ) ) self . _num_nodes += 1 return new_node_neighbors
Conduct num_node trials using by applying random.choice()
to the list of node numbers
Conduct num_node trials using by applying random . choice () to the list of node numbers
"""
        Conduct num_node trials using by applying random.choice()
        to the list of node numbers
        
        Updates the list of node numbers so that the number of instances of
        each node number is in the same ratio as the desired probabilities
        
        Returns:
        Set of nodes
        """ # compute the neighbors for the newly-created node
 # update the list of node numbers so that each node number 
 # appears in the correct ratio
 #update the number of nodes

None
self
num_nodes