0% encontró este documento útil (0 votos)
27 vistas4 páginas

Examen II Pyd

Cargado por

valeria martinez
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd
0% encontró este documento útil (0 votos)
27 vistas4 páginas

Examen II Pyd

Cargado por

valeria martinez
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd

PROGRAMACION Y DECISIONES

EXAMEN II
2025

Correo envío: [Link]@[Link]


Hora envío: 06:00 PM.

I. DESARROLLO DE SOFTWARE

En esta actividad deberás resolver varios casos prácticos programando en Python con la biblioteca Tkinter
desde la plataforma Replit. Tu tarea es crear pequeñas aplicaciones interactivas que permitan resolver
situaciones de negocio utilizando cálculos, entradas de usuario y visualización de resultados mediante
una interfaz sencilla. Cada caso tiene un objetivo específico y deberás construir una ventana con
etiquetas, cuadros de texto y botones que ejecuten las operaciones necesarias. Asegúrate de que el
código sea claro, que las funciones estén bien organizadas y que los resultados se muestren
correctamente al usuario. El propósito es que practiques la lógica de programación y el diseño de
interfaces en un contexto empresarial real.

a) Enunciado

Crea un programa en Python utilizando Tkinter que permita calcular el costo total de una receta
gastronómica. El usuario deberá ingresar:
• El precio por unidad de dos ingredientes principales.
• La cantidad requerida de cada uno.
Luego, el programa debe permitir seleccionar el tipo de preparación mediante botones o un menú
desplegable con las siguientes opciones:
1. Plato frío
2. Plato caliente
3. Postre
Según la opción elegida, el programa aplicará un costo adicional por gastos generales (energía,
refrigeración o emplatado):
• Plato frío: +10% del costo total de ingredientes
• Plato caliente: +20% del costo total de ingredientes
• Postre: +15% del costo total de ingredientes
Finalmente, el programa debe mostrar en pantalla el costo total final de preparar la receta, con un
mensaje claro y legible para el usuario.

b) Enunciado:

Crea un programa en Python utilizando Tkinter que calcule el precio final de importación de un producto.
El usuario deberá ingresar:
• El precio original en dólares (USD).
• El tipo de cambio actual (valor del dólar en moneda local).
Luego, el programa debe permitir seleccionar el origen del producto mediante botones o un menú
desplegable con las siguientes opciones:
1. País con tratado de libre comercio (0% de arancel)
2. País sin tratado (15% de arancel)
3. País con arancel especial (25% de arancel)
El programa debe:
• Convertir el precio original a moneda local.
• Aplicar el arancel correspondiente según el origen del producto.
Finalmente, el programa debe mostrar en pantalla el precio final que deberá pagar la empresa
importadora, con un mensaje claro que indique el total en moneda local.

II. MANEJO DE BASES DE DATOS SQL

Esquema propuesto

Las bases de datos tienen la siguiente información:


• bank_customers(customer_id, first_name, last_name, gender, birth_year, region, branch,
onboarding_channel, segment, income_monthly)
• bank_products(product_id, product_name, product_level, risk_level, fee_monthly, channel_main)
• bank_contracts(contract_id, customer_id, product_id, period, status, score_utilizacion,
gasto_mensual, aprobado, mora_flag)

Consultas de SQL

1. Sobre-rendimiento por región vs. promedio regional


Devuelve customer_full_name, region, product_name, gasto_mensual, solo si gasto_mensual es
mayor al promedio de su región (promedio calculado sobre todos los contratos en
bank_contracts).
2. Canal de onboarding y evolución por período
Por onboarding_channel (de bank_customers) y period (de bank_contracts), calcula:
o número de contratos,
o gasto_mensual promedio,
o variación del promedio vs. el período previo dentro del mismo canal.
Ordena por onboarding_channel, period.
3. Top 5 productos por tasa de aprobación
Para cada product_name, calcula: total de contratos, aprobados (aprobado=1), tasa de
aprobación (%) y ordénalos desc. Devuelve Top 5.
4. Composición por producto_level y branch
Para cada combinación (product_level, branch), muestra # de contratos y la proporción por status
principal (ACTIVO/CANCELADO/MORA/SOLICITADO). Devuelve columnas prop_activo,
prop_cancelado, prop_mora, prop_solicitado.
5. “Mejor cliente por región” (score ponderado)

Define score = 0.7 × gasto_mensual ‾
+ 0.3 × score_utilizacion por cliente.
Devuelve, por región, el cliente con mayor score, incluyendo customer_full_name, branch,
n_contratos y el score.

Evidencia: consultas SQL + tablas resultantes + breve interpretación (1–2 líneas c/u).

c) POWERBI

Emplear las columnas disponibles en la base de datos bi_retail_sales.csv y haga un gráfico que le
permitirá explorar una perspectiva diferente del desempeño comercial y de los factores que influyen en
las ventas de la empresa. Explique claramente cómo el grafico puede ayudarle a la empresa a tomar
decisiones estratégicas.
1. ¿Cuáles son las categorías de producto con mayores ventas totales?
2. ¿Cómo ha cambiado el monto de ventas a lo largo del tiempo?
3. ¿Qué tiendas o sucursales generan más ventas totales?
4. ¿Cuál es el comportamiento de compra entre los diferentes tipos de cliente?
5. ¿Qué empleados tienen en promedio mayores ventas por transacción?
6. ¿Cómo se distribuyen las ventas por ciudad o región?
7. ¿Existe una relación entre la cantidad vendida y el monto total de ventas?

Proponga tres gráficos adicionales.

d) LECTO ESCRITURA

When Finance Meets Generative AI—Power, Peril, and the New Discipline of Saying “No”
Wall Street has always been fluent in math. What it is learning now is restraint. Generative AI promises a
step change in research productivity, client service, surveillance, and execution. It drafts credit memos in
seconds, flags suspicious wire transfers with uncanny recall, summarizes filings before a human has
brewed the coffee, and whispers trading “explanations” with the gloss of authority. But finance is not a
sandbox; it is a regulated system of record. In this domain, the most valuable capability may be the
institutional muscle to decline AI’s most tempting shortcuts.
Start with the upside. The boring parts of high-value work—document classification, reconciliation,
exception handling—are exactly where large language models (LLMs) excel. Pair an LLM with retrieval over
a firm’s internal corpus and you get a paralegal that never sleeps and a junior analyst who never complains.
In anti–money laundering, generative AI can compress “alert triage” timelines and convert unstructured
case notes into structured features that feed downstream models. In research, it can fuse earnings
transcripts, macro releases, and ESG disclosures into coherent narratives—and even generate counter-
arguments on command. For execution, generative tools can increasingly translate qualitative rationales
(“why the book moved”) into templated, auditable reports.
Yet every gain invites a blind spot. First is the illusion of precision: fluency masquerades as truth. An LLM
can produce a pristine rationale for a trade it does not understand, drawing on patterns that may not survive
the next regime shift. Second is data governance debt. A bank that spent a decade hardening its credit data
pipeline may suddenly funnel sensitive notes, emails, and chats into a model without the lineage,
retention, and purpose-limitation controls that regulators expect. Third is operational drift. Generative
systems evolve through fine-tuning and prompt engineering; unless those changes are versioned with the
same discipline as model weights, yesterday’s explanation will not match today’s output—even under
identical inputs.
Explainability is not optional theater. Finance needs decision logs, not just feature attributions. If a model
drafts a credit memo, the system should store the prompt, retrieval set, template version, and post-edit
diffs alongside the final recommendation. That audit trail must map to named controls in a Model Risk
Management framework—who approved the prompt, who validated the grounding corpus, who owns drift
monitors. SHAP values and saliency maps are still useful in tabular scoring, but generative pipelines add
new artifacts: retrieval quality reports, template tests, and hallucination stress tests. “Why did the model
say this?” is less important than “Did the process guarantee it could not say something we cannot defend?”
Fairness is the next fault line. Generative AI often sits upstream of consequential decisions—drafting
rationale that nudges a committee toward approval or denial. If the retrieval corpus embeds historical bias,
the model will surface it with polished confidence. The mitigation is not a single metric; it is curation and
constraint. Curate the documents the model may cite. Constrain outputs through guardrail prompts,
redaction layers, and post-generative checkers that reject unsupported claims and route edge cases to
humans. In other words, fairness is not only a property of the model; it is a property of the workflow.
What does deployment discipline look like? Treat generative AI as assistive, not authoritative. Default to
shadow mode: run the system in parallel, compare its outputs to human work, and quantify deltas in time-
to-decision, error rate, and downstream losses. Define stoplights in advance: which KPI moves trigger
rollback (e.g., a spike in unsupported citations, a drift in retrieval relevance below threshold, a surge in
compliance overrides). And design for fail-open human control: when the model is uncertain, off-
distribution, or confronted with a policy-sensitive scenario, it should stop generating and escalate.
The commercial question remains: where does this actually expand the frontier? Three areas stand out.
First, case narrative automation—turning messy investigator notes into standardized, searchable,
regulator-ready narratives. Second, knowledge retrieval for specialists—connecting domain experts to the
right paragraph in a 400-page filing or a decade of internal committee minutes. Third, client
communication at scale—hyper-personalized explanations that are grounded to approved content and
guardrailed for suitability. Each is measurable, auditable, and plausibly safer than end-to-end
“decisioning.”
The cultural challenge is sharper. Finance built careers on expert judgment; generative AI can feel like an
affront or a shortcut. The better metaphor is instrumentation. Just as VaR did not replace traders but forced
them to think probabilistically, generative tools can force teams to think procedurally: what documents
constitute the ground truth, what templates define acceptable language, what thresholds separate
“assist” from “act.” If a bank can answer those questions before a single prompt is deployed, it is likely
ready. If not, the technology will reveal not only patterns in text, but cracks in governance.
AI will not make finance less human; it will make the human parts—judgment, ethics, accountability—
more visible. The winners will pair computational fluency with institutional self-control. In a world where
models can say almost anything, the edge belongs to firms that can prove why they didn’t.

Answer the following within a cohesive narrative (do not submit bullet points):

• Thesis & Position: Do you agree that the primary competitive edge is “institutional self-control”?
Defend your stance with one concrete deployment scenario.

• Governance by Design: Propose a minimal, auditable workflow for a generative AI tool used in
credit memo drafting (include artifacts to store, owners, and rollback criteria).

• Bias & Fairness: Identify one realistic bias pathway in retrieval-augmented generation for AML or
credit. Specify a data curation and guardrail strategy to reduce harm without crippling utility.

• KPIs That Matter: Define two deployment KPIs—one for performance and one for robustness—
and explain how often they should be monitored and who signs off on breaches.

• Shadow to Production: Describe a 3-phase plan (shadow → constrained assist → scaled assist)
with explicit exit gates and validation checks at each phase.

• Counterfactual Failure: Construct a plausible failure case (market shock, policy change, corpus
contamination). Explain how your process contains damage and restores trust.

También podría gustarte