Design an algorithm that takes in a stream z1, . . . , zM of M integers in [n] and at any time t can output a uniformly random element in z1, . . . , zt . Your algorithm may use at most polynomial in log n and log M space. Prove the correctness and analyze the space complexity of your algorithm. Y

Answers

Answer 1

Answer:

import random

def rand_select(*args):

   selected = random.choice(args)

   print( selected)

rand_select(12,32,43,54,2,34,65,2,64,74,97)

The space complexity of this program is O(1)

Explanation:

The list of arguments to the function is assigned to the variable "args" and the random's choice method randomly picks an item and assigns it to the variable "selected", then the variable is printed out on the screen. The memory used is 1 + 1 = 2, which is a constant, therefore making the space complexity to be O(1).


Related Questions

Overflow and roundoff errors result from real-world limitations in representing . . . (10 points)
A. number systems
B. fractions
C. place values

Answers

Answer:

C. place values

Explanation:

Place value can be defined as the numerical value representing a digit owing to its position in a number. Some examples of the various place values used in representing each digit are tenths, hundredths, thousandths, unit, tens, hundreds, thousands etc.

For example, in the number 316.2;

The place value of 3 is hundreds. The place value of 1 is tens. The place value of 6 is units. The place value of 2 is tenths.

In the real-world, their instances where there are limitations in counting and representing real numbers that are infinite (too small or too large). In order to overcome these limitations or barriers, we use place values.

An overflow error arises when a real number cannot be represented because it is too large and exceeds the upper limits of a range chosen.

Also, a roundoff error can be defined as the difference between the output generated from an algorithm using an exact or actual numbers and the output generated using rounded or finite-precision numbers.

Hence, overflow and roundoff errors result from real-world limitations in representing place values.

Hoda wants to create a new presentation in PowerPoint with existing graphics and designs. What is the easiest and fastest way for her to do this? Use an existing template. Design a new theme for the presentation. Create a custom template for the presentation. Search for a design template online.

Answers

Answer:

The answer is A

Explanation:

Edge 2020

write c++ program to find maximum number for three variables using statement ?​

Answers

Answer:

#include<iostream>

using namespace std;

int main(){

int n1, n2, n3;

cout<<"Enter any three numbers: ";

cin>>n1>>n2>>n3;

if(n1>=n2 && n1>=n3){

cout<<n1<<" is the maximum";}

else if(n2>=n1 && n2>=n3){

cout<<n2<<" is the maximum";}

else{

cout<<n3<<" is the maximum";}

return 0;

}

Explanation:

The program is written in C++ and to write this program, I assumed the three variables are integers. You can change from integer to double or float, if you wish.

This line declares n1, n2 and n3 as integers

int n1, n2, n3;

This line prompts user for three numbers

cout<<"Enter any three numbers: ";

This line gets user input for the three numbers

cin>>n1>>n2>>n3;

This if condition checks if n1 is the maximum and prints n1 as the maximum, if true

if(n1>=n2 && n1>=n3){

cout<<n1<<" is the maximum";}

This else if condition checks if n2 is the maximum and prints n2 as the maximum, if true

else if(n2>=n1 && n2>=n3){

cout<<n2<<" is the maximum";}

If the above conditions are false, then n3 is the maximum and this condition prints n3 as the maximum

else{

cout<<n3<<" is the maximum";}

return 0;

Typically you will not find biometric devices in _________ security buildings. Low High Minimal Medium

Answers

Answer:

Low

Explanation:

Biometrics security systems are hardware scanners that are useful for capturing the biometric of individuals as a means of verifying identity. These scans would be matched against the saved database and in turn access would be approved or denied to the system. In other words, biometric security gives the human body the “key” to unlock your access into buildings.

You will not find such devices in low security buildings.

Hiya people. I am a game developer and I need an idea for a new game. If you have any ideas, pls feel free to tell me. Best idea gets brainliest.

Answers

Answer:

A better RPG game all the one that are existing are the same dull thing

Explanation:

Answer:

There are many ideas you can get for games but now-a-days action games are getting more fame than others such as fortnite, freefire, pubg etc. I prefer you to make a game that is relatated to action or adventure. You can make it related to zombie hunting, or online fighting games, or some adventurous games like tomb raider.

Your company just installed a new web server within your DMZ. You have been asked to open up the port for secure web browsing on the firewall. Which port should you set as open to allow users to access this new server?

Answers

Answer:

The port that should be set open to allow users to access this new server is:

TCP port.

Explanation:

Ports are openings or entrance doors through which data packages have access to a PC or server.  TCP and UDP are transport protocols with port numbers.  TCP means Transmission Control Protocol.  They are used to connect two devices over the internet and other networks.  UDP means User Datagram Protocol.  They are used to connect applications and to speed the transfer of data.  Comparatively, UDP is faster, simpler, and more efficient than TCP.  TCP enables retransmission of lost data packets, which UDP cannot do.

ark titanoboa taming

Answers

Huh???????................

it is a passive tame throw the an egg down and it will eat it if it attacks you or gets attacked it will reset the taming process

Explanation:

An attempt to generate a large number of session IDs and have a server process them as part of a session hijack attempt is known as what type of attack

Answers

Answer:

An attempt to generate a large number of session IDs and have a server process them as part of a session hijack attempt is known as

TCP Session Hijacking.

Explanation:

TCP Session Hijacking is a cyber-attack in which illegitimate access is acquired to a client's server in the network.  The attacker then hijacks the TCP/IP session by reading and modifying transmitted data packets and also sending requests to the addressee's server.  To achieve this attack effectively, the hacker generates a large number of session IDs, thereby confusing the client's server to process them as a part of the users' sessions. Sessions (a series of interactions between two communication end points) are used by applications to store user parameters and, they remain alive until the user logs off.

list down four ways to start word 2010​

Answers

1Locate the Word icon on the Start button's All Programs menu. Don't click to start Word now!
2Right-click the Microsoft Word 2010 menu item. A pop-up menu appears.
3Choose Send To→Desktop (Create Shortcut).
4Press the Esc key to hide the Start button menu and view the desktop.

A cloud is an example of

Answers

soft and squishy looking

Answer:

1st one.

Explanation:

59. When analyzing the IDS logs, the system administrator noticed an alert was logged when the external router was accessed from the administrator's Computer to update the router configuration. What type of an alert is this

Answers

Answer:

False Positive

Explanation:

A false positive or false positive error may be defined as a result which indicated that the given conditions seems to exists when it actually does not. It is classified as a type I error. It tests a check for a single condition and then falsely provides a positive or affirmative decision.

In the context, a false positive type of error occurred when the external router of the system administrator was accessed from the computer of the administrator that was used to update the configuration of the router.

Question #1 Mutiple Select Which features are important when you plan a program? Select 4 options. Knowing what you want the program to do. Knowing how to find the result needed. Knowing what the user needs the program to accomplish. Knowing now many lines of code you are allowed to use Knowing what information is needed to find the result.​

Answers

Answer:

In planning a program, the following features are important.

- Knowing what you want the program to do.

- Knowing how to find the result needed.

- Knowing what the user needs the program to accomplish

- Knowing what information is needed to find the result

You start out by planning on what you want to create. Then you think of what programming language to use. The features to be included and then the task you want this program to accomplish

Answer:A,C,D,E

Explanation:

Which form of data does the image represent? (10 points)

A. Analog data
B. Digital data

Answers

Where is the image?, I cant answer if there is no image
b
.......…..................

Which form of data does the image represent? (10 points)
A. Analog data
B. Digital data

Answers

The image in the photograph is representing A. Analog Data. Analog data is data that is represented in a physical way. Where digital data is a set of individual symbols, analog data is stored in physical media, whether that's the surface grooves on a vinyl record, the magnetic tape of a VCR cassette, or other non-digital media. Analog and digital signals are different types which are mainly used to carry the data from one apparatus to another. Analog signals are continuous wave signals that change with time period whereas digital is a discrete signal is a nature. Examples of analog technology: photocopiers. old land-line telephones. audio tapes. old televisions (intensity and color information per scan line). Analog and digital signals are the types of signals carrying information. The major difference between both signals is that the analog signals that have continuous electrical signals, while digital signals have non-continuous electrical signals.

im trying to call the keys in a dictionary I have called "planet_dict". in order for them to be included in the for loop, the values of the keys have to be within a range of
273 <= x <= 373
I understand how to do this with certain values, but idk how to call them from a dictionary.

Answers

You can do something like this. My code iterates through the dictionary keys and then we use that key to get a value. We check if the value is between 273 and 373 and if it is, it's a water planet. My code is just a general idea of what to do. Instead of printing, you could add the key to a list and then print the contents of the list.

Database are pranized in
consist of a series of
which consist of a senes of​

Answers

Answer:

fields and records I guess is the answer

Spanning Tree Protocol (STP) is a loop-prevention mechanism used in modern networks. STP is, however, vulnerable to misconfiguration. Which protections accompany STP

Answers

Answer:

Any of the following:

1. Root Guard

2. BPDU Guard

3. BPDU Filtering

Explanation:

Given that STP an acronym of Spanning Tree Protocol, and its major purpose is to stop the bridge loops and the broadcast radiation that emanates from its topology.

Cisco carried out three instruments or tools to protect the STP topology. These protection tools accompany the STP, and they are the following:

1. Root Guard

2. BPDU Guard

3. BPDU Filtering

FIRST TO ANSWER RIGHT GETS BRAINLIEST!!!!! Which of the following sets of data would be represented best in a histogram?

A. the number of toys sold in five price ranges

B. the average monthly sales for the Big Toy Company

C. the number of each type of candy sold last month

D. the temperature at which hard candy melts

Answers

Answer:

b

Explanation:

I think it would be B. The average monthly sales for the big toy company because its giving data over history

Which of these are illegal activities? Check all that apply.

running a pyramid scheme
offering free gifts
threatening to harm property
downloading a virus
hacking a computer

Answers

Answer:

Offering free gifts

Explanation:

Answer:

ace

Explanation:

Should the security researcher have published exploit code that affects every version of Windows and cannot be patched

Answers

Answer:

No.

Explanation:

This is because there is probably the risk of malicious attackers grabbing the published exploit code that affects every window and then utilizes it for dubious purposes. Such as stealing vital information after gaining access.

The most ideal way for the security researcher to go about the exploit code that affects every version of the window is to meet the windows manufacturers, discuss the negative issues of windows software with them and eventually assist them in the software update to troubleshoot the patch.

Discuss two (2) methods for combining multiple anomaly detection methods to improve the identification of anomalous objects. You must consider both supervised and unsupervised cases in your discussion.

Answers

Answer:

Supervised anomaly detection is a process in data mining that uses a historic dataset of dependent variables and labeled independent variables to detect outliers or anomalies in the data been mined.

Unsupervised anomaly detection method uses unsupervised algorithms of unlabeled clusters to label and predicts and rule-out outliers or anomalies.

Explanation:

Anomaly detection is a method of identifying data or observations with high deviation or spread from other grouped data. Supervised and unsupervised machine learning algorithms are used to predict and detect abnormal datasets or outliers during data mining.

The supervised anomaly detection algorithm trains the model with a dataset, for the algorithm to derive a function it could use to predict outlier or anomalies. The unsupervised detection algorithm is able to cluster and label normal and abnormal data in the dataset, using this function to detect anomalies in future datasets.

To solve the difficulty of scaling memory organization, memories are physically organized into a ____-dimensional organization.
A) one
B) two
C) three
D) multi

Answers

The answer is D) multi

Which of these is an example of collective voice?
A. He hopes to make the world better for his children.
B. I have always dreamed of a kinder and better world.
C. We are here to make a better world for our children.
D. Your purpose is to make the world a better place.

Answers

Answer:

option C

hope it helps! please mark me brainliest..

Merry Christmas good day

Answer:

c

Explanation:

g The method of mapping where each memory locationis mapped to exactly one location in the cache is

Answers

Answer:

Direct Mapped Cache

Explanation:

Given that a Direct Mapped Cache is a form of mapping whereby each main memory address is mapped into precisely one cache block.

It is considered cheaper compared to the associative method of cache mapping, and it is faster when searching through it. This is because it utilizes a tag field only.

Hence, The method of mapping where each memory location is mapped to exactly one location in the cache is "Direct Mapped Cache"

In which program structure does the processor verify the mentioned condition only after executing the dependent statements once?

A. Switch Case Structure
B. Do While Structure
C. If Else Structure
D. For Structure
E. While Structure​

Answers

B. because you have to do it while in structure.
The answer is B , do while structure.

What is the output for the following line of code?
# print(3)
O3
O'3
O There is no output.
O An error statement is generated.

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct option for this question is: There is no output.

Because this is a Python code. and it is a comment statement. The code line that begins with the # symbol considered a comment statement.  The comment statement code will not be executed when you run the program.

While the other options are not correct because:

The given line of code is considered as a comment statement. The comment statement will be executed on running the program. It is used for understanding the program that helps the program to read and understand the logic being written here. When you run the comment statement, it will not produce any output or error.

Answer: O There is no output.

Explanation:

The "#" is utilized as a comment statement in Python code. It is not meant to be put into effect when the program is ran.

(Confirmed on EDGE)

I hope this helped!

Good luck <3

Mark is working on a feature film project. His job is to portray the economic status, occupation, and attitude of the characters visually. Which role is he playing?

Answers

Answer:

Videographer

Explanation:

Answer:

i think i would be costume designer

Explanation:

because if you spell videographer  it gives you the little red squiggly line

What is included in a linked list node?

I a reference to the next node
II an array reference
III a data element

Answers

Answer: I a reference to the next node

III a data element

Explanation:

A linked list is simply referred to as a linear data structure, whereby the elements would not be stored at memory locations that are together in the sequence.

In simple words, we can simply say that a linked list is made up of nodes in which, every node has a data element and also a link or reference to the next node that is in the list.

Therefore, based on the explanation above, the correct option will be:

I. a reference to the next node

III a data element

_________ can be used to provide access control, confidentiality, data origin authentication, connectionless integrity, rejection of replayed packets, and limited traffic flow confidentiality.

Answers

Answer:

IPSec

Explanation:

IPSec is an acronym for Internet Protocol Security. It is a standardized protocol used in determining the cryptographic and authenticated packets across the Internet Protocol networks.

It can be utilized to establish access control, confidentiality, data origin authentication, connectionless integrity, rejection of replayed packets, and limited traffic flow confidentiality.

Question # 6
Dropdown
Choose the line of code that completes this program.

Output:

dog named Tiger

class pet:
def __init__(self,strSpecies,strName):
self.species = strSpecies
self.petName = strName

def __str__(self):
return self.species + " named " + self.petName

def changeName(self, newName):
self.petName = newName

# main program
myPetA = pet('dog', 'Spot')


print(myPetA)

Answers

Answer:

myPetA.changeName('Tiger') should be it

Explanation:

Answer:

myPetA.changeName('Tiger')

Explanation:

Correct answer edge 2020

Other Questions
please help!! Write an informative essay that explains a natural phenomenon such as the Pitch Lake in Trinidad or the aurora borealis. The OutLine then the KWHL Chart. Please write in your own words, i will give brainliest and lots of points!!! 23. Which of the following is Not a dimension of religion?O A. Physical DimensionO B. Social DimensionO C. Material DimensionO D. Mythical Dimension A dog weighs 0.5 pound when.it is born.lt gains weight as it grows, and is 35 pounds at age 1 year.Then the dog stays the same weight for the rest of its life.It lives to be 15 years old.What is the domain of the function representing the weight, in pounds, of the dog in terms of its age inO0 to 1 yearO0to 15 yearsO0to 35 poundsO 0.5 to 35 pounds how can a cosmetologist make his or her clients feel more secure about the image that they present? help me , thank you very much for helping I GIVE BRAINLILSTE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ HELPPPPP MEEEEEEE PLSSSSMath assignment The first cultures in New Mexico _________. A. Develop a series of ancient roads.B. Were hunters and gatherers C. Built multistoried house from Adobe D. Were primarily farmers PLZ HELP ASAP!!!! :( 1 Ray is making a dessert by mixing honey and yogurt in the ratio of 2 to 13. How much yogurt and honey does he need to ma 600 grams of the dessert Someone help!Three customers have accounts owing money. The table shows the account balances.Which customer owes the least amount of money?Customer BalanceM. Palmer $56.72B. Leftwich $74.19R. Jordan $54.31M. Palmer B. Leftwich R. Jordan Overflow and roundoff errors result from real-world limitations in representing . . . (10 points)A. number systemsB. fractionsC. place values What are the respective concentrations (M) of Mg2+and Cl-afforded by dissolving 0.325 mol MgCl2 in water and diluting to 250 mL?A) 0.0013 and 0.0013B) 0.0013 and 0.0026C) 1.30 and.1.30D) 1.30 and 2.60E) 2.60 and 2.60 Liz wants to buy a shirt for $25.what will the total cost after tax be if Liz buys the shirt in Springfield NEED HELP ASAP PLS DONT JUST STEAL WILL MARK BRAINLYYou will read a news article and a prompt. Then, you will organize your own story ideas in the Narrative Organization Chart.Read the news article, NYC News News for the People, 2014, and read the prompt at the end of the article.Use the Narrative Organization Chart to plan your own story featuring the two teens as characters and the setting described in the prompt. Select and save the Narrative Organization Chart.Complete each box on your Narrative Organization Chart. Make sure to include:BeginningExposition: Describe your protagonist and settingName your protagonists and other characters.MiddleRising ActionMake sure to describe your antagonist: who is working against the protagonist?List two events in which the antagonist acts against the protagonist.ClimaxWhat decision does the character make that solves the problem?What action does the character take?EndFalling ActionWhat happens after this decision?ResolutionWhat happens at the end of the story?What do you want the reader to learn? This is the theme.Save your work to your computer or drive.Submit your work in 03.03 Planning Your Narrative Story.If you cannot save your chart, you can type the information into a document and submit.NYC News News For the PeopleMarch 15, 2014Today, March 15, 2014, the residents of New York City took advantage of the spring weather to join the NYC Historical Society in burying a time capsule. Their hope is that on March 15, 2114, it will be opened and the future residents of NYC will have a testament of what life was like 100 years in the past.Locked away in the titanium cylinder are important artifacts from the present day. "I want people of the future to understand what our lives were like, day to day how we communicated and how we spent our days," said 14-year-old Sylvia."Yeah, when they open this," exclaimed middle school student, Devonne, "they are not going to believe their eyes!"The objects inserted into the time capsule are varied. They were chosen by citizens from all walks of life and professions. Among those asked to contribute to the time capsule were librarians, teens, computer programmers, medical professionals, research scientists, gardeners, neurologists, biologists, and more.Etched onto the surface of the time capsule are the words of the author, William Faulkner, as he accepted the 1950 Nobel Prize for Literature:"I believe that man will not merely endure: he will prevail. He is immortal, not because he alone among creatures has an inexhaustible voice, but because he has a soul, a spirit capable of compassion and sacrifice and endurance."The capsule was buried today, with much hope for the future.Story PromptRead the following story prompt and think about how you will continue this story in your narrative.It is March 15, in the year 2514. The people of former New York are in desperate circumstances. They are being overrun, and they are losing hope. The banners proclaiming a Free the Real NYC lie in the gutters, trampled by terrified and panicked citizens. Two teens or kidz, as they are called now are on their way home from a secret meeting. As they walk in the shadows to avoid detection, they both trip on a huge titanium cylinder. Etched into the surface are a series of scratched-out words. The only words they can make out are, "he will prevail." They drag the heavy cylinder into a hidden alleyway and twist it open. The glow from their flashlights reveals the contents of the cylinder. With gasps of relief, they look at each other with hope in their eyes for the first time in years.Directions:Now that you have read the news article and the story prompt, use the Narrative Organization Chart to plan your own story featuring the two teens and the setting described in the prompt.Think about these ideas as you plan your story:How much time has passed since the news article was published?Who are these teens? What are their names? What are they like?What was the secret meeting about?What is their conflict?What is going on in NYC in 2514?Who is working against them?What do they learn at the end of the story? HELPWhat do you know about what makes a civilization? Instructions: Find the missing side. Round your answer to the nearest tenth. PLEASE HELP MEEEEE!!!!! What is the radius of a hemisphere with a volume of 6466 to the nearest tenth of a meter? which two statement descibe processes most likely to be involved in the formation of sedimentary rock? Write one safety tip you learned for each of these categories. The first one has been completed for you.